v4l2object: Don't use mmap64 if off_t is 64-bit
[platform/upstream/gst-plugins-good.git] / sys / v4l2 / gstv4l2tuner.c
index c885dc6..66cc2c1 100644 (file)
@@ -1,7 +1,7 @@
 /* GStreamer
  *
  * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
- *               2006 Edgard Lima <edgard.lima@indt.org.br>
+ *               2006 Edgard Lima <edgard.lima@gmail.com>
  *
  * gstv4l2tuner.c: tuner interface implementation for V4L2
  *
@@ -17,8 +17,8 @@
  *
  * You should have received a copy of the GNU Library General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
 
 #include <gst/gst.h>
 
+#include "gstv4l2object.h"
 #include "gstv4l2tuner.h"
 #include "gstv4l2object.h"
-#include "v4l2_calls.h"
-
-static void gst_v4l2_tuner_channel_class_init (GstV4l2TunerChannelClass *
-    klass);
-static void gst_v4l2_tuner_channel_init (GstV4l2TunerChannel * channel);
-
-static void gst_v4l2_tuner_norm_class_init (GstV4l2TunerNormClass * klass);
-static void gst_v4l2_tuner_norm_init (GstV4l2TunerNorm * norm);
 
-static GstTunerNormClass *norm_parent_class = NULL;
-static GstTunerChannelClass *channel_parent_class = NULL;
+G_DEFINE_TYPE (GstV4l2TunerChannel, gst_v4l2_tuner_channel,
+    GST_TYPE_TUNER_CHANNEL);
 
-GType
-gst_v4l2_tuner_channel_get_type (void)
-{
-  static GType gst_v4l2_tuner_channel_type = 0;
-
-  if (!gst_v4l2_tuner_channel_type) {
-    static const GTypeInfo v4l2_tuner_channel_info = {
-      sizeof (GstV4l2TunerChannelClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) gst_v4l2_tuner_channel_class_init,
-      NULL,
-      NULL,
-      sizeof (GstV4l2TunerChannel),
-      0,
-      (GInstanceInitFunc) gst_v4l2_tuner_channel_init,
-      NULL
-    };
-
-    gst_v4l2_tuner_channel_type =
-        g_type_register_static (GST_TYPE_TUNER_CHANNEL,
-        "GstV4l2TunerChannel", &v4l2_tuner_channel_info, 0);
-  }
+G_DEFINE_TYPE (GstV4l2TunerNorm, gst_v4l2_tuner_norm, GST_TYPE_TUNER_NORM);
 
-  return gst_v4l2_tuner_channel_type;
-}
 
 static void
 gst_v4l2_tuner_channel_class_init (GstV4l2TunerChannelClass * klass)
 {
-  channel_parent_class = g_type_class_peek_parent (klass);
 }
 
 static void
@@ -82,37 +50,9 @@ gst_v4l2_tuner_channel_init (GstV4l2TunerChannel * channel)
   channel->audio = (guint32) - 1;
 }
 
-GType
-gst_v4l2_tuner_norm_get_type (void)
-{
-  static GType gst_v4l2_tuner_norm_type = 0;
-
-  if (!gst_v4l2_tuner_norm_type) {
-    static const GTypeInfo v4l2_tuner_norm_info = {
-      sizeof (GstV4l2TunerNormClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) gst_v4l2_tuner_norm_class_init,
-      NULL,
-      NULL,
-      sizeof (GstV4l2TunerNorm),
-      0,
-      (GInstanceInitFunc) gst_v4l2_tuner_norm_init,
-      NULL
-    };
-
-    gst_v4l2_tuner_norm_type =
-        g_type_register_static (GST_TYPE_TUNER_NORM,
-        "GstV4l2TunerNorm", &v4l2_tuner_norm_info, 0);
-  }
-
-  return gst_v4l2_tuner_norm_type;
-}
-
 static void
 gst_v4l2_tuner_norm_class_init (GstV4l2TunerNormClass * klass)
 {
-  norm_parent_class = g_type_class_peek_parent (klass);
 }
 
 static void