Move all the several v4l/v4l2 plugins in one v4l and one v4l2 plugin
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Sat, 13 Sep 2003 08:58:49 +0000 (08:58 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Sat, 13 Sep 2003 08:58:49 +0000 (08:58 +0000)
Original commit message from CVS:
Move all the several v4l/v4l2 plugins in one v4l and one v4l2 plugin

sys/v4l2/Makefile.am
sys/v4l2/gstv4l2.c [new file with mode: 0644]
sys/v4l2/gstv4l2element.c
sys/v4l2/gstv4l2element.h
sys/v4l2/gstv4l2src.c
sys/v4l2/gstv4l2src.h

index 8c8f154..6aeee4e 100644 (file)
@@ -1,22 +1,21 @@
 
 plugin_LTLIBRARIES = \
-       libgstv4l2element.la \
-       libgstv4l2src.la
+       libgstvideo4linux2.la
 
-libgstv4l2element_la_SOURCES = gstv4l2element.c v4l2_calls.c v4l2-overlay_calls.c gstv4l2element-marshal.c
-libgstv4l2element_la_CFLAGS = $(GST_CFLAGS)
-libgstv4l2element_la_LIBADD =
-libgstv4l2element_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-
-libgstv4l2src_la_SOURCES = gstv4l2src.c v4l2src_calls.c
-libgstv4l2src_la_CFLAGS = $(GST_CFLAGS)
-libgstv4l2src_la_LIBADD = libgstv4l2element.la
-libgstv4l2src_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+libgstvideo4linux2_la_SOURCES = \
+       gstv4l2element.c v4l2_calls.c \
+       v4l2-overlay_calls.c \
+       gstv4l2element-marshal.c \
+       gstv4l2src.c v4l2src_calls.c
+libgstvideo4linux2_la_CFLAGS = $(GST_CFLAGS)
+libgstvideo4linux2_la_LIBADD =
+libgstvideo4linux2_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
 
 noinst_HEADERS = gstv4l2element.h v4l2_calls.h \
-               gstv4l2src.h v4l2src_calls.h gstv4l2element-marshal.h
+               gstv4l2src.h v4l2src_calls.h \
+               gstv4l2element-marshal.h
 
-EXTRA_libgstv4l2element_la_SOURCES = \
+EXTRA_libgstvideo4linux2_la_SOURCES = \
        gstv4l2element-marshal.list
 
 BUILT_SOURCES = \
diff --git a/sys/v4l2/gstv4l2.c b/sys/v4l2/gstv4l2.c
new file mode 100644 (file)
index 0000000..8ad7b31
--- /dev/null
@@ -0,0 +1,46 @@
+/* G-Streamer Video4linux2 video-capture plugin
+ * Copyright (C) 2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/gst.h>
+
+#include "gstv4l2element.h"
+#include "gstv4l2src.h"
+
+gboolean
+plugin_init (GModule   *module,
+            GstPlugin *plugin)
+{
+  if (!gst_v4l2element_factory_init (plugin) ||
+      !gst_v4l2src_factory_init (plugin)) {
+    return FALSE;
+  }
+
+  return TRUE;
+}
+
+GstPluginDesc plugin_desc = {
+       GST_VERSION_MAJOR,
+       GST_VERSION_MINOR,
+       "video4linux2",
+       plugin_init
+};
index 926e4a5..9ff553c 100644 (file)
@@ -473,9 +473,8 @@ gst_v4l2element_change_state (GstElement *element)
 }
 
 
-static gboolean
-plugin_init (GModule   *module,
-             GstPlugin *plugin)
+gboolean
+gst_v4l2element_factory_init (GstPlugin *plugin)
 {
        GstElementFactory *factory;
 
@@ -487,11 +486,3 @@ plugin_init (GModule   *module,
 
        return TRUE;
 }
-
-
-GstPluginDesc plugin_desc = {
-       GST_VERSION_MAJOR,
-       GST_VERSION_MINOR,
-       "v4l2element",
-       plugin_init
-};
index 76ad04d..6d86d4a 100644 (file)
@@ -112,4 +112,6 @@ struct _GstV4l2ElementClass {
 
 GType gst_v4l2element_get_type (void);
 
+gboolean gst_v4l2element_factory_init (GstPlugin *plugin);
+
 #endif /* __GST_V4L2ELEMENT_H__ */
index b7e5dab..015e3c4 100644 (file)
@@ -1061,9 +1061,8 @@ gst_v4l2src_buffer_free (GstBufferPool *pool,
 }
 
 
-static gboolean
-plugin_init (GModule   *module,
-             GstPlugin *plugin)
+gboolean
+gst_v4l2src_factory_init (GstPlugin *plugin)
 {
        GstElementFactory *factory;
 
@@ -1083,11 +1082,3 @@ plugin_init (GModule   *module,
 
        return TRUE;
 }
-
-
-GstPluginDesc plugin_desc = {
-       GST_VERSION_MAJOR,
-       GST_VERSION_MINOR,
-       "v4l2src",
-       plugin_init
-};
index 1b4ab09..da9664c 100644 (file)
@@ -98,4 +98,6 @@ struct _GstV4l2SrcClass {
 
 GType gst_v4l2src_get_type(void);
 
+gboolean gst_v4l2src_factory_init (GstPlugin *plugin);
+
 #endif /* __GST_V4L2SRC_H__ */