Registering all elements under opencv plugin

This commit is contained in:
kapil 2009-05-08 11:55:20 +05:30 committed by Thiago Santos
parent 2f77a06d23
commit cf9d13bb4c
11 changed files with 97 additions and 57 deletions

View file

@ -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 =

View file

@ -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

View file

@ -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/"
)

View file

@ -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__ */

View file

@ -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

View file

@ -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/"
)

View file

@ -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__ */

50
ext/opencv/gstopencv.c Normal file
View file

@ -0,0 +1,50 @@
/* GStreamer
* Copyright (C) <2009> Kapil Agrawal <kapil@mediamagictechnologies.com>
*
* 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")

View file

@ -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

View file

@ -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"
)

View file

@ -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__ */