1 /* GStreamer Camera Control Channel Interface
3 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd.
5 * Contact: Jeongmo Yang <jm80.yang@samsung.com>
7 * cameracontrolchannel.c: cameracontrol channel object design
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.
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.
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.
29 #include "cameracontrolchannel.h"
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);
41 static GObjectClass *parent_class = NULL;
42 static guint signals[LAST_SIGNAL] = { 0 };
44 GType gst_camera_control_channel_get_type(void)
46 static GType gst_camera_control_channel_type = 0;
48 if (!gst_camera_control_channel_type) {
49 static const GTypeInfo camera_control_channel_info = {
50 sizeof (GstCameraControlChannelClass),
53 (GClassInitFunc) gst_camera_control_channel_class_init,
56 sizeof (GstCameraControlChannel),
58 (GInstanceInitFunc) gst_camera_control_channel_init,
62 gst_camera_control_channel_type = \
63 g_type_register_static(G_TYPE_OBJECT,
64 "GstCameraControlChannel",
65 &camera_control_channel_info,
69 return gst_camera_control_channel_type;
72 static void gst_camera_control_channel_class_init(GstCameraControlChannelClass* klass)
74 GObjectClass *object_klass = (GObjectClass*) klass;
76 parent_class = g_type_class_peek_parent (klass);
78 signals[SIGNAL_VALUE_CHANGED] = \
79 g_signal_new("control-value-changed",
80 G_TYPE_FROM_CLASS (klass),
82 G_STRUCT_OFFSET (GstCameraControlChannelClass, value_changed),
85 g_cclosure_marshal_VOID__INT,
90 object_klass->dispose = gst_camera_control_channel_dispose;
93 static void gst_camera_control_channel_init(GstCameraControlChannel* control_channel)
95 control_channel->label = NULL;
96 control_channel->min_value = control_channel->max_value = 0;
99 static void gst_camera_control_channel_dispose(GObject* object)
101 GstCameraControlChannel *control_channel = GST_CAMERA_CONTROL_CHANNEL(object);
103 if (control_channel->label) {
104 g_free (control_channel->label);
107 control_channel->label = NULL;
109 if (parent_class->dispose) {
110 parent_class->dispose (object);