Some interface implementations for video4linux/video4linux2 plugins: a Tuner interfac...
[platform/upstream/gstreamer.git] / gst-libs / gst / interfaces / tunernorm.c
1 /* GStreamer Tuner
2  * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  *
4  * tunernorm.c: tuner norm 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 "tunernorm.h"
27
28 enum {
29   /* FILL ME */
30   LAST_SIGNAL
31 };
32
33 static void gst_tuner_norm_class_init (GstTunerNormClass *klass);
34 static void gst_tuner_norm_init       (GstTunerNorm *norm);
35 static void gst_tuner_norm_dispose    (GObject      *object);
36
37 static GObjectClass *parent_class = NULL;
38 /*static guint signals[LAST_SIGNAL] = { 0 };*/
39
40 GType
41 gst_tuner_norm_get_type (void)
42 {
43   static GType gst_tuner_norm_type = 0;
44
45   if (!gst_tuner_norm_type) {
46     static const GTypeInfo tuner_norm_info = {
47       sizeof (GstTunerNormClass),
48       NULL,
49       NULL,
50       (GClassInitFunc) gst_tuner_norm_class_init,
51       NULL,
52       NULL,
53       sizeof (GstTunerNorm),
54       0,
55       (GInstanceInitFunc) gst_tuner_norm_init,
56       NULL
57     };
58
59     gst_tuner_norm_type =
60         g_type_register_static (G_TYPE_OBJECT,
61                                 "GstTunerNorm",
62                                 &tuner_norm_info, 0);
63   }
64
65   return gst_tuner_norm_type;
66 }
67
68 static void
69 gst_tuner_norm_class_init (GstTunerNormClass *klass)
70 {
71   GObjectClass *object_klass = (GObjectClass *) klass;
72
73   parent_class = g_type_class_ref (G_TYPE_OBJECT);
74
75   object_klass->dispose = gst_tuner_norm_dispose;
76 }
77
78 static void
79 gst_tuner_norm_init (GstTunerNorm *norm)
80 {
81   norm->label = NULL;
82   norm->fps = 0.;
83 }
84
85 static void
86 gst_tuner_norm_dispose (GObject *object)
87 {
88   GstTunerNorm *norm = GST_TUNER_NORM (object);
89
90   if (norm->label)
91     g_free (norm->label);
92
93   if (parent_class->dispose)
94     parent_class->dispose (object);
95 }