From 68eee929ce8aaa013666825b0e5f1be59a3155e7 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 13 Sep 2003 08:58:49 +0000 Subject: [PATCH] Move all the several v4l/v4l2 plugins in one v4l and one v4l2 plugin Original commit message from CVS: Move all the several v4l/v4l2 plugins in one v4l and one v4l2 plugin --- sys/v4l2/Makefile.am | 25 ++++++++++++------------- sys/v4l2/gstv4l2.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ sys/v4l2/gstv4l2element.c | 13 ++----------- sys/v4l2/gstv4l2element.h | 2 ++ sys/v4l2/gstv4l2src.c | 13 ++----------- sys/v4l2/gstv4l2src.h | 2 ++ 6 files changed, 66 insertions(+), 35 deletions(-) create mode 100644 sys/v4l2/gstv4l2.c diff --git a/sys/v4l2/Makefile.am b/sys/v4l2/Makefile.am index 8c8f154..6aeee4e 100644 --- a/sys/v4l2/Makefile.am +++ b/sys/v4l2/Makefile.am @@ -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 index 0000000..8ad7b31 --- /dev/null +++ b/sys/v4l2/gstv4l2.c @@ -0,0 +1,46 @@ +/* G-Streamer Video4linux2 video-capture plugin + * Copyright (C) 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 "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 +}; diff --git a/sys/v4l2/gstv4l2element.c b/sys/v4l2/gstv4l2element.c index 926e4a5..9ff553c 100644 --- a/sys/v4l2/gstv4l2element.c +++ b/sys/v4l2/gstv4l2element.c @@ -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 -}; diff --git a/sys/v4l2/gstv4l2element.h b/sys/v4l2/gstv4l2element.h index 76ad04d..6d86d4a 100644 --- a/sys/v4l2/gstv4l2element.h +++ b/sys/v4l2/gstv4l2element.h @@ -112,4 +112,6 @@ struct _GstV4l2ElementClass { GType gst_v4l2element_get_type (void); +gboolean gst_v4l2element_factory_init (GstPlugin *plugin); + #endif /* __GST_V4L2ELEMENT_H__ */ diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index b7e5dab..015e3c4 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -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 -}; diff --git a/sys/v4l2/gstv4l2src.h b/sys/v4l2/gstv4l2src.h index 1b4ab09..da9664c 100644 --- a/sys/v4l2/gstv4l2src.h +++ b/sys/v4l2/gstv4l2src.h @@ -98,4 +98,6 @@ struct _GstV4l2SrcClass { GType gst_v4l2src_get_type(void); +gboolean gst_v4l2src_factory_init (GstPlugin *plugin); + #endif /* __GST_V4L2SRC_H__ */ -- 2.7.4