1 /* GStreamer Camera Control Channel Interface
2 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * cameracontrolchannel.c: cameracontrol channel object design
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.
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.
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.
26 #include "cameracontrolchannel.h"
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);
38 static GObjectClass *parent_class = NULL;
39 static guint signals[LAST_SIGNAL] = { 0 };
41 GType gst_camera_control_channel_get_type(void)
43 static GType gst_camera_control_channel_type = 0;
45 if (!gst_camera_control_channel_type) {
46 static const GTypeInfo camera_control_channel_info = {
47 sizeof (GstCameraControlChannelClass),
50 (GClassInitFunc) gst_camera_control_channel_class_init,
53 sizeof (GstCameraControlChannel),
55 (GInstanceInitFunc) gst_camera_control_channel_init,
59 gst_camera_control_channel_type = \
60 g_type_register_static(G_TYPE_OBJECT,
61 "GstCameraControlChannel",
62 &camera_control_channel_info,
66 return gst_camera_control_channel_type;
69 static void gst_camera_control_channel_class_init(GstCameraControlChannelClass* klass)
71 GObjectClass *object_klass = (GObjectClass*) klass;
73 parent_class = g_type_class_peek_parent (klass);
75 signals[SIGNAL_VALUE_CHANGED] = \
76 g_signal_new("control-value-changed",
77 G_TYPE_FROM_CLASS (klass),
79 G_STRUCT_OFFSET (GstCameraControlChannelClass, value_changed),
82 g_cclosure_marshal_VOID__INT,
87 object_klass->dispose = gst_camera_control_channel_dispose;
90 static void gst_camera_control_channel_init(GstCameraControlChannel* control_channel)
92 control_channel->label = NULL;
93 control_channel->min_value = control_channel->max_value = 0;
96 static void gst_camera_control_channel_dispose(GObject* object)
98 GstCameraControlChannel *control_channel = GST_CAMERA_CONTROL_CHANNEL(object);
100 if (control_channel->label) {
101 g_free (control_channel->label);
104 control_channel->label = NULL;
106 if (parent_class->dispose) {
107 parent_class->dispose (object);