From: kapil Date: Fri, 8 May 2009 06:25:20 +0000 (+0530) Subject: Registering all elements under opencv plugin X-Git-Tag: RELEASE-0.11.1~772 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf9d13bb4ce1833964a55de26348f57c2705cb07;p=platform%2Fupstream%2Fgst-plugins-bad.git Registering all elements under opencv plugin --- diff --git a/ext/opencv/Makefile.am b/ext/opencv/Makefile.am index 0061f7e..7125827 100644 --- a/ext/opencv/Makefile.am +++ b/ext/opencv/Makefile.am @@ -1 +1,30 @@ SUBDIRS = edgedetect facedetect pyramidsegment + +# plugindir is set in configure + +plugin_LTLIBRARIES = libgstopencv.la + +# sources used to compile this plug-in +libgstopencv_la_SOURCES = gstopencv.c + +# flags used to compile this facedetect +# add other _CFLAGS and _LIBS as needed +libgstopencv_la_CFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS) \ + -I${top_srcdir}/ext/opencv/edgedetect \ + -I${top_srcdir}/ext/opencv/facedetect \ + -I${top_srcdir}/ext/opencv/pyramidsegment + +libgstopencv_la_LIBADD = $(GST_LIBS) $(OPENCV_LIBS) \ + $(top_builddir)/ext/opencv/edgedetect/libgstedgedetect.la \ + $(top_builddir)/ext/opencv/facedetect/libgstfacedetect.la \ + $(top_builddir)/ext/opencv/pyramidsegment/libgstpyramidsegment.la + +libgstopencv_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) + +libgstopencv_la_DEPENDENCIES = \ + $(top_builddir)/ext/opencv/edgedetect/libgstedgedetect.la \ + $(top_builddir)/ext/opencv/facedetect/libgstfacedetect.la \ + $(top_builddir)/ext/opencv/pyramidsegment/libgstpyramidsegment.la + +# headers we need but don't want installed +noinst_HEADERS = diff --git a/ext/opencv/edgedetect/Makefile.am b/ext/opencv/edgedetect/Makefile.am index 54c6657..6387502 100644 --- a/ext/opencv/edgedetect/Makefile.am +++ b/ext/opencv/edgedetect/Makefile.am @@ -1,6 +1,6 @@ # plugindir is set in configure -plugin_LTLIBRARIES = libgstedgedetect.la +noinst_LTLIBRARIES = libgstedgedetect.la # sources used to compile this plug-in libgstedgedetect_la_SOURCES = gstedgedetect.c diff --git a/ext/opencv/edgedetect/gstedgedetect.c b/ext/opencv/edgedetect/gstedgedetect.c index 26b4f47..c5c226a 100644 --- a/ext/opencv/edgedetect/gstedgedetect.c +++ b/ext/opencv/edgedetect/gstedgedetect.c @@ -316,8 +316,8 @@ gst_edgedetect_chain (GstPad * pad, GstBuffer * buf) * initialize the plug-in itself * register the element factories and other features */ -static gboolean -edgedetect_init (GstPlugin * edgedetect) +gboolean +gst_edgedetect_plugin_init (GstPlugin * plugin) { /* debug category for fltering log messages * @@ -326,22 +326,6 @@ edgedetect_init (GstPlugin * edgedetect) GST_DEBUG_CATEGORY_INIT (gst_edgedetect_debug, "edgedetect", 0, "Performs canny edge detection on videos and images"); - return gst_element_register (edgedetect, "edgedetect", GST_RANK_NONE, + return gst_element_register (plugin, "edgedetect", GST_RANK_NONE, GST_TYPE_EDGEDETECT); } - -/* gstreamer looks for this structure to register edgedetects - * - * exchange the string 'Template edgedetect' with your edgedetect description - */ -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "edgedetect", - "Performs canny edge detection on videos and images", - edgedetect_init, - VERSION, - "LGPL", - "GStreamer OpenCV Plugins", - "http://www.mikeasoft.com/" -) diff --git a/ext/opencv/edgedetect/gstedgedetect.h b/ext/opencv/edgedetect/gstedgedetect.h index 5931bf1..9d17632 100644 --- a/ext/opencv/edgedetect/gstedgedetect.h +++ b/ext/opencv/edgedetect/gstedgedetect.h @@ -86,6 +86,8 @@ struct _GstedgedetectClass GType gst_edgedetect_get_type (void); +gboolean gst_edgedetect_plugin_init (GstPlugin * plugin); + G_END_DECLS #endif /* __GST_EDGEDETECT_H__ */ diff --git a/ext/opencv/facedetect/Makefile.am b/ext/opencv/facedetect/Makefile.am index 21097ef..b0a91ee 100644 --- a/ext/opencv/facedetect/Makefile.am +++ b/ext/opencv/facedetect/Makefile.am @@ -1,6 +1,6 @@ # plugindir is set in configure -plugin_LTLIBRARIES = libgstfacedetect.la +noinst_LTLIBRARIES = libgstfacedetect.la # sources used to compile this plug-in libgstfacedetect_la_SOURCES = gstfacedetect.c diff --git a/ext/opencv/facedetect/gstfacedetect.c b/ext/opencv/facedetect/gstfacedetect.c index 1e1af4c..03d29b1 100644 --- a/ext/opencv/facedetect/gstfacedetect.c +++ b/ext/opencv/facedetect/gstfacedetect.c @@ -327,27 +327,13 @@ static void gst_facedetect_load_profile(Gstfacedetect * filter) { * initialize the plug-in itself * register the element factories and other features */ -static gboolean -facedetect_init (GstPlugin * facedetect) +gboolean +gst_facedetect_plugin_init (GstPlugin * plugin) { /* debug category for fltering log messages */ GST_DEBUG_CATEGORY_INIT (gst_facedetect_debug, "facedetect", 0, "Performs face detection on videos and images, providing detected positions via bus messages"); - return gst_element_register (facedetect, "facedetect", GST_RANK_NONE, + return gst_element_register (plugin, "facedetect", GST_RANK_NONE, GST_TYPE_FACEDETECT); } - - -/* gstreamer looks for this structure to register facedetect */ -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "facedetect", - "Performs face detection on videos and images, providing detected positions via bus messages", - facedetect_init, - VERSION, - "LGPL", - "GStreamer OpenCV Plugins", - "http://www.mikeasoft.com/" -) diff --git a/ext/opencv/facedetect/gstfacedetect.h b/ext/opencv/facedetect/gstfacedetect.h index 97e9e02..6ca56a7 100644 --- a/ext/opencv/facedetect/gstfacedetect.h +++ b/ext/opencv/facedetect/gstfacedetect.h @@ -88,6 +88,8 @@ struct _GstfacedetectClass GType gst_facedetect_get_type (void); +gboolean gst_facedetect_plugin_init (GstPlugin * plugin); + G_END_DECLS #endif /* __GST_FACEDETECT_H__ */ diff --git a/ext/opencv/gstopencv.c b/ext/opencv/gstopencv.c new file mode 100644 index 0000000..8c03647 --- /dev/null +++ b/ext/opencv/gstopencv.c @@ -0,0 +1,50 @@ +/* GStreamer + * Copyright (C) <2009> Kapil Agrawal + * + * gstopencv.c: plugin registering + * + * 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 "gstedgedetect.h" +#include "gstfacedetect.h" +#include "gstpyramidsegment.h" + +static gboolean +plugin_init (GstPlugin * plugin) +{ + + if (!gst_edgedetect_plugin_init (plugin)) + return FALSE; + + if (!gst_facedetect_plugin_init (plugin)) + return FALSE; + + if (!gst_pyramidsegment_plugin_init (plugin)) + return FALSE; + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "opencv", + "GStreamer OpenCV Plugins", + plugin_init, VERSION, "LGPL", "OpenCv", "http://opencv.willowgarage.com") diff --git a/ext/opencv/pyramidsegment/Makefile.am b/ext/opencv/pyramidsegment/Makefile.am index e55de2d..7c4a691 100644 --- a/ext/opencv/pyramidsegment/Makefile.am +++ b/ext/opencv/pyramidsegment/Makefile.am @@ -1,6 +1,4 @@ -# plugindir is set in configure - -plugin_LTLIBRARIES = libgstpyramidsegment.la +noinst_LTLIBRARIES = libgstpyramidsegment.la # sources used to compile this plug-in libgstpyramidsegment_la_SOURCES = gstpyramidsegment.c diff --git a/ext/opencv/pyramidsegment/gstpyramidsegment.c b/ext/opencv/pyramidsegment/gstpyramidsegment.c index 811baea..77afa0f 100644 --- a/ext/opencv/pyramidsegment/gstpyramidsegment.c +++ b/ext/opencv/pyramidsegment/gstpyramidsegment.c @@ -308,26 +308,13 @@ gst_pyramidsegment_chain (GstPad * pad, GstBuffer * buf) * initialize the plug-in itself * register the element factories and other features */ -static gboolean -pyramidsegment_init (GstPlugin * pyramidsegment) +gboolean +gst_pyramidsegment_plugin_init (GstPlugin * plugin) { /* debug category for fltering log messages */ GST_DEBUG_CATEGORY_INIT (gst_pyramidsegment_debug, "pyramidsegment", 0, "Applies pyramid segmentation to a video or image"); - return gst_element_register (pyramidsegment, "pyramidsegment", GST_RANK_NONE, + return gst_element_register (plugin, "pyramidsegment", GST_RANK_NONE, GST_TYPE_PYRAMIDSEGMENT); } - -/* gstreamer looks for this structure to register pyramidsegment */ -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "pyramidsegment", - "Applies pyramid segmentation to a video or image", - pyramidsegment_init, - VERSION, - "LGPL", - "GStreamer OpenCV Plugins", - "http://www.mikeasoft.com" -) diff --git a/ext/opencv/pyramidsegment/gstpyramidsegment.h b/ext/opencv/pyramidsegment/gstpyramidsegment.h index d083a62..5a04d81 100644 --- a/ext/opencv/pyramidsegment/gstpyramidsegment.h +++ b/ext/opencv/pyramidsegment/gstpyramidsegment.h @@ -92,6 +92,8 @@ struct _GstpyramidsegmentClass GType gst_pyramidsegment_get_type (void); +gboolean gst_pyramidsegment_plugin_init (GstPlugin * plugin); + G_END_DECLS #endif /* __GST_PYRAMIDSEGMENT_H__ */