tizen 2.3.1 release
[framework/multimedia/gst-plugins-base0.10.git] / gst-libs / gst / interfaces / cameracontrolchannel.c
1 /* GStreamer Camera Control Channel Interface
2  *
3  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd.
4  *
5  * Contact: Jeongmo Yang <jm80.yang@samsung.com>
6  *
7  * cameracontrolchannel.c: cameracontrol channel object design
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #ifdef HAVE_CONFIG_H
26 #include "config.h"
27 #endif
28
29 #include "cameracontrolchannel.h"
30
31 enum {
32         /* FILL ME */
33         SIGNAL_VALUE_CHANGED,
34         LAST_SIGNAL
35 };
36
37 static void gst_camera_control_channel_class_init(GstCameraControlChannelClass* klass);
38 static void gst_camera_control_channel_init(GstCameraControlChannel* control_channel);
39 static void gst_camera_control_channel_dispose(GObject* object);
40
41 static GObjectClass *parent_class = NULL;
42 static guint signals[LAST_SIGNAL] = { 0 };
43
44 GType gst_camera_control_channel_get_type(void)
45 {
46         static GType gst_camera_control_channel_type = 0;
47
48         if (!gst_camera_control_channel_type) {
49                 static const GTypeInfo camera_control_channel_info = {
50                         sizeof (GstCameraControlChannelClass),
51                         NULL,
52                         NULL,
53                         (GClassInitFunc) gst_camera_control_channel_class_init,
54                         NULL,
55                         NULL,
56                         sizeof (GstCameraControlChannel),
57                         0,
58                         (GInstanceInitFunc) gst_camera_control_channel_init,
59                         NULL
60                 };
61
62                 gst_camera_control_channel_type = \
63                         g_type_register_static(G_TYPE_OBJECT,
64                                                "GstCameraControlChannel",
65                                                &camera_control_channel_info,
66                                                0);
67         }
68
69         return gst_camera_control_channel_type;
70 }
71
72 static void gst_camera_control_channel_class_init(GstCameraControlChannelClass* klass)
73 {
74         GObjectClass *object_klass = (GObjectClass*) klass;
75
76         parent_class = g_type_class_peek_parent (klass);
77
78         signals[SIGNAL_VALUE_CHANGED] = \
79                 g_signal_new("control-value-changed",
80                              G_TYPE_FROM_CLASS (klass),
81                              G_SIGNAL_RUN_LAST,
82                              G_STRUCT_OFFSET (GstCameraControlChannelClass, value_changed),
83                              NULL,
84                              NULL,
85                              g_cclosure_marshal_VOID__INT,
86                              G_TYPE_NONE,
87                              1,
88                              G_TYPE_INT);
89
90         object_klass->dispose = gst_camera_control_channel_dispose;
91 }
92
93 static void gst_camera_control_channel_init(GstCameraControlChannel* control_channel)
94 {
95         control_channel->label = NULL;
96         control_channel->min_value = control_channel->max_value = 0;
97 }
98
99 static void gst_camera_control_channel_dispose(GObject* object)
100 {
101         GstCameraControlChannel *control_channel = GST_CAMERA_CONTROL_CHANNEL(object);
102
103         if (control_channel->label) {
104                 g_free (control_channel->label);
105         }
106
107         control_channel->label = NULL;
108
109         if (parent_class->dispose) {
110                 parent_class->dispose (object);
111         }
112 }