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