diff --git a/sys/v4l/Makefile.am b/sys/v4l/Makefile.am index 50cd1e23b8..dad907f91a 100644 --- a/sys/v4l/Makefile.am +++ b/sys/v4l/Makefile.am @@ -1,27 +1,16 @@ -plugin_LTLIBRARIES = libgstv4lelement.la libgstv4lsrc.la \ - libgstv4lmjpegsrc.la libgstv4lmjpegsink.la +plugin_LTLIBRARIES = libgstvideo4linux.la -libgstv4lelement_la_SOURCES = gstv4lelement.c v4l_calls.c \ - v4l-overlay_calls.c gstv4lelement-marshal.c -libgstv4lelement_la_CFLAGS = $(GST_CFLAGS) -libgstv4lelement_la_LIBADD = -libgstv4lelement_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) - -libgstv4lsrc_la_SOURCES = gstv4lsrc.c v4lsrc_calls.c -libgstv4lsrc_la_CFLAGS = $(GST_CFLAGS) -libgstv4lsrc_la_LIBADD = libgstv4lelement.la -libgstv4lsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) - -libgstv4lmjpegsrc_la_SOURCES = gstv4lmjpegsrc.c v4lmjpegsrc_calls.c -libgstv4lmjpegsrc_la_CFLAGS = $(GST_CFLAGS) -libgstv4lmjpegsrc_la_LIBADD = libgstv4lelement.la -libgstv4lmjpegsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) - -libgstv4lmjpegsink_la_SOURCES = gstv4lmjpegsink.c v4lmjpegsink_calls.c -libgstv4lmjpegsink_la_CFLAGS = $(GST_CFLAGS) -libgstv4lmjpegsink_la_LIBADD = libgstv4lelement.la -libgstv4lmjpegsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstvideo4linux_la_SOURCES = \ + gstv4lelement.c v4l_calls.c \ + v4l-overlay_calls.c \ + gstv4lelement-marshal.c \ + gstv4lsrc.c v4lsrc_calls.c \ + gstv4lmjpegsrc.c v4lmjpegsrc_calls.c \ + gstv4lmjpegsink.c v4lmjpegsink_calls.c +libgstvideo4linux_la_CFLAGS = $(GST_CFLAGS) +libgstvideo4linux_la_LIBADD = +libgstvideo4linux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) noinst_HEADERS = gstv4lelement.h v4l_calls.h \ gstv4lsrc.h v4lsrc_calls.h \ @@ -29,7 +18,7 @@ noinst_HEADERS = gstv4lelement.h v4l_calls.h \ gstv4lmjpegsink.h v4lmjpegsink_calls.h \ videodev_mjpeg.h gstv4lelement-marshal.h -EXTRA_libgstv4lelement_la_SOURCES = \ +EXTRA_libgstvideo4linux_la_SOURCES = \ gstv4lelement-marshal.list BUILT_SOURCES = \ diff --git a/sys/v4l/gstv4l.c b/sys/v4l/gstv4l.c new file mode 100644 index 0000000000..0968872200 --- /dev/null +++ b/sys/v4l/gstv4l.c @@ -0,0 +1,51 @@ +/* G-Streamer video4linux plugins + * Copyright (C) 2001-2002 Ronald Bultje + * + * 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 + +#include "gstv4lelement.h" +#include "gstv4lsrc.h" +#include "gstv4lmjpegsrc.h" +#include "gstv4lmjpegsink.h" + +static gboolean +plugin_init (GModule *module, + GstPlugin *plugin) +{ + if (!gst_v4lelement_factory_init (plugin) || + !gst_v4lsrc_factory_init (plugin) || + !gst_v4lmjpegsrc_factory_init (plugin) || + !gst_v4lmjpegsink_factory_init (plugin)) { + return FALSE; + } + + return TRUE; + +} + +GstPluginDesc plugin_desc = { + GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "video4linux", + plugin_init +}; diff --git a/sys/v4l/gstv4lelement.c b/sys/v4l/gstv4lelement.c index 7c14d5f451..62b85331e7 100644 --- a/sys/v4l/gstv4lelement.c +++ b/sys/v4l/gstv4lelement.c @@ -85,8 +85,6 @@ static void gst_v4lelement_get_property (GObject *ob GValue *value, GParamSpec *pspec); static GstElementStateReturn gst_v4lelement_change_state (GstElement *element); -static gboolean plugin_init (GModule *module, - GstPlugin *plugin); static GstElementClass *parent_class = NULL; @@ -554,9 +552,8 @@ gst_v4lelement_change_state (GstElement *element) } -static gboolean -plugin_init (GModule *module, - GstPlugin *plugin) +gboolean +gst_v4lelement_factory_init (GstPlugin *plugin) { GstElementFactory *factory; @@ -568,11 +565,3 @@ plugin_init (GModule *module, return TRUE; } - - -GstPluginDesc plugin_desc = { - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "v4lelement", - plugin_init -}; diff --git a/sys/v4l/gstv4lelement.h b/sys/v4l/gstv4lelement.h index f4c9f07d9f..4559983455 100644 --- a/sys/v4l/gstv4lelement.h +++ b/sys/v4l/gstv4lelement.h @@ -117,6 +117,8 @@ struct _GstV4lElementClass { GType gst_v4lelement_get_type(void); +gboolean gst_v4lelement_factory_init (GstPlugin *plugin); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/sys/v4l/gstv4lmjpegsink.c b/sys/v4l/gstv4lmjpegsink.c index a3226cd64d..b1103a0e9b 100644 --- a/sys/v4l/gstv4lmjpegsink.c +++ b/sys/v4l/gstv4lmjpegsink.c @@ -470,9 +470,8 @@ gst_v4lmjpegsink_change_state (GstElement *element) } -static gboolean -plugin_init (GModule *module, - GstPlugin *plugin) +gboolean +gst_v4lmjpegsink_factory_init (GstPlugin *plugin) { GstElementFactory *factory; GstCaps *caps; @@ -504,11 +503,3 @@ plugin_init (GModule *module, return TRUE; } - - -GstPluginDesc plugin_desc = { - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "v4lmjpegsink", - plugin_init -}; diff --git a/sys/v4l/gstv4lmjpegsink.h b/sys/v4l/gstv4lmjpegsink.h index fee447e65e..d8ed50a377 100644 --- a/sys/v4l/gstv4lmjpegsink.h +++ b/sys/v4l/gstv4lmjpegsink.h @@ -94,6 +94,8 @@ struct _GstV4lMjpegSinkClass { GType gst_v4lmjpegsink_get_type(void); +gboolean gst_v4lmjpegsink_factory_init (GstPlugin *plugin); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/sys/v4l/gstv4lmjpegsrc.c b/sys/v4l/gstv4lmjpegsrc.c index c0721d1461..73582890ad 100644 --- a/sys/v4l/gstv4lmjpegsrc.c +++ b/sys/v4l/gstv4lmjpegsrc.c @@ -848,8 +848,8 @@ gst_v4lmjpegsrc_buffer_free (GstBufferPool *pool, GstBuffer *buf, gpointer user_ } -static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +gboolean +gst_v4lmjpegsrc_factory_init (GstPlugin *plugin) { GstElementFactory *factory; GstCaps *caps; @@ -881,11 +881,3 @@ plugin_init (GModule *module, GstPlugin *plugin) return TRUE; } - - -GstPluginDesc plugin_desc = { - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "v4lmjpegsrc", - plugin_init -}; diff --git a/sys/v4l/gstv4lmjpegsrc.h b/sys/v4l/gstv4lmjpegsrc.h index bd86c1c8ab..ad923cae23 100644 --- a/sys/v4l/gstv4lmjpegsrc.h +++ b/sys/v4l/gstv4lmjpegsrc.h @@ -112,6 +112,8 @@ struct _GstV4lMjpegSrcClass { GType gst_v4lmjpegsrc_get_type(void); +gboolean gst_v4lmjpegsrc_factory_init (GstPlugin *plugin); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/sys/v4l/gstv4lsrc.c b/sys/v4l/gstv4lsrc.c index 11f9aa9115..cc022756f4 100644 --- a/sys/v4l/gstv4lsrc.c +++ b/sys/v4l/gstv4lsrc.c @@ -827,9 +827,8 @@ gst_v4lsrc_set_clock (GstElement *element, } -static gboolean -plugin_init (GModule *module, - GstPlugin *plugin) +gboolean +gst_v4lsrc_init_init (GstPlugin *plugin) { GstElementFactory *factory; @@ -850,11 +849,3 @@ plugin_init (GModule *module, return TRUE; } - - -GstPluginDesc plugin_desc = { - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "v4lsrc", - plugin_init -}; diff --git a/sys/v4l/gstv4lsrc.h b/sys/v4l/gstv4lsrc.h index 39304767e2..81376dc011 100644 --- a/sys/v4l/gstv4lsrc.h +++ b/sys/v4l/gstv4lsrc.h @@ -94,6 +94,8 @@ struct _GstV4lSrcClass { GType gst_v4lsrc_get_type(void); +gboolean gst_v4lsrc_init_init (GstPlugin *plugin); + #ifdef __cplusplus } #endif /* __cplusplus */