mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
opencv: fixup gobject naming conventions
This commit is contained in:
parent
1f3b4ad574
commit
c613904c68
13 changed files with 274 additions and 274 deletions
|
@ -65,8 +65,8 @@
|
|||
#include "gstopencvutils.h"
|
||||
#include "gstedgedetect.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_edgedetect_debug);
|
||||
#define GST_CAT_DEFAULT gst_edgedetect_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_edge_detect_debug);
|
||||
#define GST_CAT_DEFAULT gst_edge_detect_debug
|
||||
|
||||
/* Filter signals and args */
|
||||
enum
|
||||
|
@ -100,21 +100,21 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB)
|
||||
);
|
||||
|
||||
GST_BOILERPLATE (Gstedgedetect, gst_edgedetect, GstElement, GST_TYPE_ELEMENT);
|
||||
GST_BOILERPLATE (GstEdgeDetect, gst_edge_detect, GstElement, GST_TYPE_ELEMENT);
|
||||
|
||||
static void gst_edgedetect_set_property (GObject * object, guint prop_id,
|
||||
static void gst_edge_detect_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_edgedetect_get_property (GObject * object, guint prop_id,
|
||||
static void gst_edge_detect_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static gboolean gst_edgedetect_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_edgedetect_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_edge_detect_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_edge_detect_chain (GstPad * pad, GstBuffer * buf);
|
||||
|
||||
/* Clean up */
|
||||
static void
|
||||
gst_edgedetect_finalize (GObject * obj)
|
||||
gst_edge_detect_finalize (GObject * obj)
|
||||
{
|
||||
Gstedgedetect *filter = GST_EDGEDETECT (obj);
|
||||
GstEdgeDetect *filter = GST_EDGE_DETECT (obj);
|
||||
|
||||
if (filter->cvImage != NULL) {
|
||||
cvReleaseImage (&filter->cvImage);
|
||||
|
@ -128,7 +128,7 @@ gst_edgedetect_finalize (GObject * obj)
|
|||
|
||||
/* GObject vmethod implementations */
|
||||
static void
|
||||
gst_edgedetect_base_init (gpointer gclass)
|
||||
gst_edge_detect_base_init (gpointer gclass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
|
||||
|
||||
|
@ -146,15 +146,15 @@ gst_edgedetect_base_init (gpointer gclass)
|
|||
|
||||
/* initialize the edgedetect's class */
|
||||
static void
|
||||
gst_edgedetect_class_init (GstedgedetectClass * klass)
|
||||
gst_edge_detect_class_init (GstEdgeDetectClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_edgedetect_finalize);
|
||||
gobject_class->set_property = gst_edgedetect_set_property;
|
||||
gobject_class->get_property = gst_edgedetect_get_property;
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_edge_detect_finalize);
|
||||
gobject_class->set_property = gst_edge_detect_set_property;
|
||||
gobject_class->get_property = gst_edge_detect_get_property;
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_MASK,
|
||||
g_param_spec_boolean ("mask", "Mask",
|
||||
|
@ -180,15 +180,15 @@ gst_edgedetect_class_init (GstedgedetectClass * klass)
|
|||
* initialize instance structure
|
||||
*/
|
||||
static void
|
||||
gst_edgedetect_init (Gstedgedetect * filter, GstedgedetectClass * gclass)
|
||||
gst_edge_detect_init (GstEdgeDetect * filter, GstEdgeDetectClass * gclass)
|
||||
{
|
||||
filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
|
||||
gst_pad_set_setcaps_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_edgedetect_set_caps));
|
||||
GST_DEBUG_FUNCPTR (gst_edge_detect_set_caps));
|
||||
gst_pad_set_getcaps_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||
gst_pad_set_chain_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_edgedetect_chain));
|
||||
GST_DEBUG_FUNCPTR (gst_edge_detect_chain));
|
||||
|
||||
filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
||||
gst_pad_set_getcaps_function (filter->srcpad,
|
||||
|
@ -203,10 +203,10 @@ gst_edgedetect_init (Gstedgedetect * filter, GstedgedetectClass * gclass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_edgedetect_set_property (GObject * object, guint prop_id,
|
||||
gst_edge_detect_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
Gstedgedetect *filter = GST_EDGEDETECT (object);
|
||||
GstEdgeDetect *filter = GST_EDGE_DETECT (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_MASK:
|
||||
|
@ -228,10 +228,10 @@ gst_edgedetect_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_edgedetect_get_property (GObject * object, guint prop_id,
|
||||
gst_edge_detect_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
Gstedgedetect *filter = GST_EDGEDETECT (object);
|
||||
GstEdgeDetect *filter = GST_EDGE_DETECT (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_MASK:
|
||||
|
@ -256,14 +256,14 @@ gst_edgedetect_get_property (GObject * object, guint prop_id,
|
|||
|
||||
/* this function handles the link with other elements */
|
||||
static gboolean
|
||||
gst_edgedetect_set_caps (GstPad * pad, GstCaps * caps)
|
||||
gst_edge_detect_set_caps (GstPad * pad, GstCaps * caps)
|
||||
{
|
||||
Gstedgedetect *filter;
|
||||
GstEdgeDetect *filter;
|
||||
GstPad *otherpad;
|
||||
gint width, height;
|
||||
GstStructure *structure;
|
||||
|
||||
filter = GST_EDGEDETECT (gst_pad_get_parent (pad));
|
||||
filter = GST_EDGE_DETECT (gst_pad_get_parent (pad));
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
gst_structure_get_int (structure, "width", &width);
|
||||
gst_structure_get_int (structure, "height", &height);
|
||||
|
@ -283,12 +283,12 @@ gst_edgedetect_set_caps (GstPad * pad, GstCaps * caps)
|
|||
* this function does the actual processing
|
||||
*/
|
||||
static GstFlowReturn
|
||||
gst_edgedetect_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_edge_detect_chain (GstPad * pad, GstBuffer * buf)
|
||||
{
|
||||
Gstedgedetect *filter;
|
||||
GstEdgeDetect *filter;
|
||||
GstBuffer *outbuf;
|
||||
|
||||
filter = GST_EDGEDETECT (GST_OBJECT_PARENT (pad));
|
||||
filter = GST_EDGE_DETECT (GST_OBJECT_PARENT (pad));
|
||||
|
||||
filter->cvImage->imageData = (char *) GST_BUFFER_DATA (buf);
|
||||
|
||||
|
@ -319,14 +319,14 @@ gst_edgedetect_chain (GstPad * pad, GstBuffer * buf)
|
|||
* register the element factories and other features
|
||||
*/
|
||||
gboolean
|
||||
gst_edgedetect_plugin_init (GstPlugin * plugin)
|
||||
gst_edge_detect_plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
/* debug category for fltering log messages
|
||||
*
|
||||
*/
|
||||
GST_DEBUG_CATEGORY_INIT (gst_edgedetect_debug, "edgedetect",
|
||||
GST_DEBUG_CATEGORY_INIT (gst_edge_detect_debug, "edgedetect",
|
||||
0, "Performs canny edge detection on videos and images");
|
||||
|
||||
return gst_element_register (plugin, "edgedetect", GST_RANK_NONE,
|
||||
GST_TYPE_EDGEDETECT);
|
||||
GST_TYPE_EDGE_DETECT);
|
||||
}
|
||||
|
|
|
@ -43,28 +43,28 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_EDGEDETECT_H__
|
||||
#define __GST_EDGEDETECT_H__
|
||||
#ifndef __GST_EDGE_DETECT_H__
|
||||
#define __GST_EDGE_DETECT_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <cv.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/* #defines don't like whitespacey bits */
|
||||
#define GST_TYPE_EDGEDETECT \
|
||||
(gst_edgedetect_get_type())
|
||||
#define GST_EDGEDETECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_EDGEDETECT,Gstedgedetect))
|
||||
#define GST_EDGEDETECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_EDGEDETECT,GstedgedetectClass))
|
||||
#define GST_IS_EDGEDETECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_EDGEDETECT))
|
||||
#define GST_IS_EDGEDETECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_EDGEDETECT))
|
||||
typedef struct _Gstedgedetect Gstedgedetect;
|
||||
typedef struct _GstedgedetectClass GstedgedetectClass;
|
||||
#define GST_TYPE_EDGE_DETECT \
|
||||
(gst_edge_detect_get_type())
|
||||
#define GST_EDGE_DETECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_EDGE_DETECT,GstEdgeDetect))
|
||||
#define GST_EDGE_DETECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_EDGE_DETECT,GstEdgeDetectClass))
|
||||
#define GST_IS_EDGE_DETECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_EDGE_DETECT))
|
||||
#define GST_IS_EDGE_DETECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_EDGE_DETECT))
|
||||
typedef struct _GstEdgeDetect GstEdgeDetect;
|
||||
typedef struct _GstEdgeDetectClass GstEdgeDetectClass;
|
||||
|
||||
struct _Gstedgedetect
|
||||
struct _GstEdgeDetect
|
||||
{
|
||||
GstElement element;
|
||||
|
||||
|
@ -77,14 +77,14 @@ struct _Gstedgedetect
|
|||
IplImage *cvEdge, *cvGray, *cvImage, *cvCEdge;
|
||||
};
|
||||
|
||||
struct _GstedgedetectClass
|
||||
struct _GstEdgeDetectClass
|
||||
{
|
||||
GstElementClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_edgedetect_get_type (void);
|
||||
GType gst_edge_detect_get_type (void);
|
||||
|
||||
gboolean gst_edgedetect_plugin_init (GstPlugin * plugin);
|
||||
gboolean gst_edge_detect_plugin_init (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_EDGEDETECT_H__ */
|
||||
#endif /* __GST_EDGE_DETECT_H__ */
|
||||
|
|
|
@ -65,8 +65,8 @@
|
|||
#include "gstopencvutils.h"
|
||||
#include "gstfaceblur.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_faceblur_debug);
|
||||
#define GST_CAT_DEFAULT gst_faceblur_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_face_blur_debug);
|
||||
#define GST_CAT_DEFAULT gst_face_blur_debug
|
||||
|
||||
#define DEFAULT_PROFILE "/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml"
|
||||
|
||||
|
@ -97,23 +97,23 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB)
|
||||
);
|
||||
|
||||
GST_BOILERPLATE (Gstfaceblur, gst_faceblur, GstElement, GST_TYPE_ELEMENT);
|
||||
GST_BOILERPLATE (GstFaceBlur, gst_face_blur, GstElement, GST_TYPE_ELEMENT);
|
||||
|
||||
static void gst_faceblur_set_property (GObject * object, guint prop_id,
|
||||
static void gst_face_blur_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_faceblur_get_property (GObject * object, guint prop_id,
|
||||
static void gst_face_blur_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static gboolean gst_faceblur_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_faceblur_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_face_blur_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_face_blur_chain (GstPad * pad, GstBuffer * buf);
|
||||
|
||||
static void gst_faceblur_load_profile (Gstfaceblur * filter);
|
||||
static void gst_face_blur_load_profile (GstFaceBlur * filter);
|
||||
|
||||
/* Clean up */
|
||||
static void
|
||||
gst_faceblur_finalize (GObject * obj)
|
||||
gst_face_blur_finalize (GObject * obj)
|
||||
{
|
||||
Gstfaceblur *filter = GST_FACEBLUR (obj);
|
||||
GstFaceBlur *filter = GST_FACE_BLUR (obj);
|
||||
|
||||
if (filter->cvImage) {
|
||||
cvReleaseImage (&filter->cvImage);
|
||||
|
@ -128,7 +128,7 @@ gst_faceblur_finalize (GObject * obj)
|
|||
|
||||
/* GObject vmethod implementations */
|
||||
static void
|
||||
gst_faceblur_base_init (gpointer gclass)
|
||||
gst_face_blur_base_init (gpointer gclass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
|
||||
|
||||
|
@ -146,16 +146,16 @@ gst_faceblur_base_init (gpointer gclass)
|
|||
|
||||
/* initialize the faceblur's class */
|
||||
static void
|
||||
gst_faceblur_class_init (GstfaceblurClass * klass)
|
||||
gst_face_blur_class_init (GstFaceBlurClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_faceblur_finalize);
|
||||
gobject_class->set_property = gst_faceblur_set_property;
|
||||
gobject_class->get_property = gst_faceblur_get_property;
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_face_blur_finalize);
|
||||
gobject_class->set_property = gst_face_blur_set_property;
|
||||
gobject_class->get_property = gst_face_blur_get_property;
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_PROFILE,
|
||||
g_param_spec_string ("profile", "Profile",
|
||||
|
@ -169,15 +169,15 @@ gst_faceblur_class_init (GstfaceblurClass * klass)
|
|||
* initialize instance structure
|
||||
*/
|
||||
static void
|
||||
gst_faceblur_init (Gstfaceblur * filter, GstfaceblurClass * gclass)
|
||||
gst_face_blur_init (GstFaceBlur * filter, GstFaceBlurClass * gclass)
|
||||
{
|
||||
filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
|
||||
gst_pad_set_setcaps_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_faceblur_set_caps));
|
||||
GST_DEBUG_FUNCPTR (gst_face_blur_set_caps));
|
||||
gst_pad_set_getcaps_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||
gst_pad_set_chain_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_faceblur_chain));
|
||||
GST_DEBUG_FUNCPTR (gst_face_blur_chain));
|
||||
|
||||
filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
||||
gst_pad_set_getcaps_function (filter->srcpad,
|
||||
|
@ -186,20 +186,20 @@ gst_faceblur_init (Gstfaceblur * filter, GstfaceblurClass * gclass)
|
|||
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
|
||||
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
|
||||
filter->profile = g_strdup (DEFAULT_PROFILE);
|
||||
gst_faceblur_load_profile (filter);
|
||||
gst_face_blur_load_profile (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_faceblur_set_property (GObject * object, guint prop_id,
|
||||
gst_face_blur_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
Gstfaceblur *filter = GST_FACEBLUR (object);
|
||||
GstFaceBlur *filter = GST_FACE_BLUR (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PROFILE:
|
||||
g_free (filter->profile);
|
||||
filter->profile = g_value_dup_string (value);
|
||||
gst_faceblur_load_profile (filter);
|
||||
gst_face_blur_load_profile (filter);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
@ -208,10 +208,10 @@ gst_faceblur_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_faceblur_get_property (GObject * object, guint prop_id,
|
||||
gst_face_blur_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
Gstfaceblur *filter = GST_FACEBLUR (object);
|
||||
GstFaceBlur *filter = GST_FACE_BLUR (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PROFILE:
|
||||
|
@ -227,14 +227,14 @@ gst_faceblur_get_property (GObject * object, guint prop_id,
|
|||
|
||||
/* this function handles the link with other elements */
|
||||
static gboolean
|
||||
gst_faceblur_set_caps (GstPad * pad, GstCaps * caps)
|
||||
gst_face_blur_set_caps (GstPad * pad, GstCaps * caps)
|
||||
{
|
||||
Gstfaceblur *filter;
|
||||
GstFaceBlur *filter;
|
||||
GstPad *otherpad;
|
||||
gint width, height;
|
||||
GstStructure *structure;
|
||||
|
||||
filter = GST_FACEBLUR (gst_pad_get_parent (pad));
|
||||
filter = GST_FACE_BLUR (gst_pad_get_parent (pad));
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
gst_structure_get_int (structure, "width", &width);
|
||||
gst_structure_get_int (structure, "height", &height);
|
||||
|
@ -253,13 +253,13 @@ gst_faceblur_set_caps (GstPad * pad, GstCaps * caps)
|
|||
* this function does the actual processing
|
||||
*/
|
||||
static GstFlowReturn
|
||||
gst_faceblur_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_face_blur_chain (GstPad * pad, GstBuffer * buf)
|
||||
{
|
||||
Gstfaceblur *filter;
|
||||
GstFaceBlur *filter;
|
||||
CvSeq *faces;
|
||||
int i;
|
||||
|
||||
filter = GST_FACEBLUR (GST_OBJECT_PARENT (pad));
|
||||
filter = GST_FACE_BLUR (GST_OBJECT_PARENT (pad));
|
||||
|
||||
filter->cvImage->imageData = (char *) GST_BUFFER_DATA (buf);
|
||||
|
||||
|
@ -294,7 +294,7 @@ gst_faceblur_chain (GstPad * pad, GstBuffer * buf)
|
|||
|
||||
|
||||
static void
|
||||
gst_faceblur_load_profile (Gstfaceblur * filter)
|
||||
gst_face_blur_load_profile (GstFaceBlur * filter)
|
||||
{
|
||||
filter->cvCascade =
|
||||
(CvHaarClassifierCascade *) cvLoad (filter->profile, 0, 0, 0);
|
||||
|
@ -309,12 +309,12 @@ gst_faceblur_load_profile (Gstfaceblur * filter)
|
|||
* register the element factories and other features
|
||||
*/
|
||||
gboolean
|
||||
gst_faceblur_plugin_init (GstPlugin * plugin)
|
||||
gst_face_blur_plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
/* debug category for filtering log messages */
|
||||
GST_DEBUG_CATEGORY_INIT (gst_faceblur_debug, "faceblur",
|
||||
GST_DEBUG_CATEGORY_INIT (gst_face_blur_debug, "faceblur",
|
||||
0, "Blurs faces in images and videos");
|
||||
|
||||
return gst_element_register (plugin, "faceblur", GST_RANK_NONE,
|
||||
GST_TYPE_FACEBLUR);
|
||||
GST_TYPE_FACE_BLUR);
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_FACEBLUR_H__
|
||||
#define __GST_FACEBLUR_H__
|
||||
#ifndef __GST_FACE_BLUR_H__
|
||||
#define __GST_FACE_BLUR_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <cv.h>
|
||||
|
@ -55,20 +55,20 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
/* #defines don't like whitespacey bits */
|
||||
#define GST_TYPE_FACEBLUR \
|
||||
(gst_faceblur_get_type())
|
||||
#define GST_FACEBLUR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FACEBLUR,Gstfaceblur))
|
||||
#define GST_FACEBLUR_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FACEBLUR,GstfaceblurClass))
|
||||
#define GST_IS_FACEBLUR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FACEBLUR))
|
||||
#define GST_IS_FACEBLUR_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FACEBLUR))
|
||||
typedef struct _Gstfaceblur Gstfaceblur;
|
||||
typedef struct _GstfaceblurClass GstfaceblurClass;
|
||||
#define GST_TYPE_FACE_BLUR \
|
||||
(gst_face_blur_get_type())
|
||||
#define GST_FACE_BLUR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FACE_BLUR,GstFaceBlur))
|
||||
#define GST_FACE_BLUR_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FACE_BLUR,GstFaceBlurClass))
|
||||
#define GST_IS_FACE_BLUR(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FACE_BLUR))
|
||||
#define GST_IS_FACE_BLUR_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FACE_BLUR))
|
||||
typedef struct _GstFaceBlur GstFaceBlur;
|
||||
typedef struct _GstFaceBlurClass GstFaceBlurClass;
|
||||
|
||||
struct _Gstfaceblur
|
||||
struct _GstFaceBlur
|
||||
{
|
||||
GstElement element;
|
||||
|
||||
|
@ -83,14 +83,14 @@ struct _Gstfaceblur
|
|||
CvMemStorage *cvStorage;
|
||||
};
|
||||
|
||||
struct _GstfaceblurClass
|
||||
struct _GstFaceBlurClass
|
||||
{
|
||||
GstElementClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_faceblur_get_type (void);
|
||||
GType gst_face_blur_get_type (void);
|
||||
|
||||
gboolean gst_faceblur_plugin_init (GstPlugin * plugin);
|
||||
gboolean gst_face_blur_plugin_init (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_FACEBLUR_H__ */
|
||||
#endif /* __GST_FACE_BLUR_H__ */
|
||||
|
|
|
@ -49,9 +49,9 @@
|
|||
*
|
||||
* Performs face detection on videos and images.
|
||||
*
|
||||
* The image is scaled down multiple times using the GstFacedetect::scale-factor
|
||||
* until the size is <= GstFacedetect::min-size-width or
|
||||
* GstFacedetect::min-size-height.
|
||||
* The image is scaled down multiple times using the GstFaceDetect::scale-factor
|
||||
* until the size is <= GstFaceDetect::min-size-width or
|
||||
* GstFaceDetect::min-size-height.
|
||||
*
|
||||
* <refsect2>
|
||||
* <title>Example launch line</title>
|
||||
|
@ -78,8 +78,8 @@
|
|||
|
||||
#include "gstfacedetect.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_facedetect_debug);
|
||||
#define GST_CAT_DEFAULT gst_facedetect_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_face_detect_debug);
|
||||
#define GST_CAT_DEFAULT gst_face_detect_debug
|
||||
|
||||
#define DEFAULT_FACE_PROFILE "/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml"
|
||||
#define DEFAULT_NOSE_PROFILE "/usr/share/opencv/haarcascades/haarcascade_mcs_nose.xml"
|
||||
|
@ -161,28 +161,28 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
GST_STATIC_CAPS ("video/x-raw-rgb")
|
||||
);
|
||||
|
||||
GST_BOILERPLATE (GstFacedetect, gst_facedetect, GstOpencvVideoFilter,
|
||||
GST_BOILERPLATE (GstFaceDetect, gst_face_detect, GstOpencvVideoFilter,
|
||||
GST_TYPE_OPENCV_VIDEO_FILTER);
|
||||
|
||||
static void gst_facedetect_set_property (GObject * object, guint prop_id,
|
||||
static void gst_face_detect_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_facedetect_get_property (GObject * object, guint prop_id,
|
||||
static void gst_face_detect_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static gboolean gst_facedetect_set_caps (GstOpencvVideoFilter * transform,
|
||||
static gboolean gst_face_detect_set_caps (GstOpencvVideoFilter * transform,
|
||||
gint in_width, gint in_height, gint in_depth, gint in_channels,
|
||||
gint out_width, gint out_height, gint out_depth, gint out_channels);
|
||||
static GstFlowReturn gst_facedetect_transform_ip (GstOpencvVideoFilter * base,
|
||||
static GstFlowReturn gst_face_detect_transform_ip (GstOpencvVideoFilter * base,
|
||||
GstBuffer * buf, IplImage * img);
|
||||
|
||||
static CvHaarClassifierCascade *gst_facedetect_load_profile (GstFacedetect *
|
||||
static CvHaarClassifierCascade *gst_face_detect_load_profile (GstFaceDetect *
|
||||
filter, gchar * profile);
|
||||
|
||||
/* Clean up */
|
||||
static void
|
||||
gst_facedetect_finalize (GObject * obj)
|
||||
gst_face_detect_finalize (GObject * obj)
|
||||
{
|
||||
GstFacedetect *filter = GST_FACEDETECT (obj);
|
||||
GstFaceDetect *filter = GST_FACE_DETECT (obj);
|
||||
|
||||
if (filter->cvGray)
|
||||
cvReleaseImage (&filter->cvGray);
|
||||
|
@ -209,7 +209,7 @@ gst_facedetect_finalize (GObject * obj)
|
|||
|
||||
/* GObject vmethod implementations */
|
||||
static void
|
||||
gst_facedetect_base_init (gpointer gclass)
|
||||
gst_face_detect_base_init (gpointer gclass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
|
||||
|
||||
|
@ -227,7 +227,7 @@ gst_facedetect_base_init (gpointer gclass)
|
|||
|
||||
/* initialize the facedetect's class */
|
||||
static void
|
||||
gst_facedetect_class_init (GstFacedetectClass * klass)
|
||||
gst_face_detect_class_init (GstFaceDetectClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstOpencvVideoFilterClass *gstopencvbasefilter_class;
|
||||
|
@ -235,12 +235,12 @@ gst_facedetect_class_init (GstFacedetectClass * klass)
|
|||
gobject_class = (GObjectClass *) klass;
|
||||
gstopencvbasefilter_class = (GstOpencvVideoFilterClass *) klass;
|
||||
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_facedetect_finalize);
|
||||
gobject_class->set_property = gst_facedetect_set_property;
|
||||
gobject_class->get_property = gst_facedetect_get_property;
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_face_detect_finalize);
|
||||
gobject_class->set_property = gst_face_detect_set_property;
|
||||
gobject_class->get_property = gst_face_detect_get_property;
|
||||
|
||||
gstopencvbasefilter_class->cv_trans_ip_func = gst_facedetect_transform_ip;
|
||||
gstopencvbasefilter_class->cv_set_caps = gst_facedetect_set_caps;
|
||||
gstopencvbasefilter_class->cv_trans_ip_func = gst_face_detect_transform_ip;
|
||||
gstopencvbasefilter_class->cv_set_caps = gst_face_detect_set_caps;
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_DISPLAY,
|
||||
g_param_spec_boolean ("display", "Display",
|
||||
|
@ -292,7 +292,7 @@ gst_facedetect_class_init (GstFacedetectClass * klass)
|
|||
* initialize instance structure
|
||||
*/
|
||||
static void
|
||||
gst_facedetect_init (GstFacedetect * filter, GstFacedetectClass * gclass)
|
||||
gst_face_detect_init (GstFaceDetect * filter, GstFaceDetectClass * gclass)
|
||||
{
|
||||
filter->face_profile = g_strdup (DEFAULT_FACE_PROFILE);
|
||||
filter->nose_profile = g_strdup (DEFAULT_NOSE_PROFILE);
|
||||
|
@ -305,23 +305,23 @@ gst_facedetect_init (GstFacedetect * filter, GstFacedetectClass * gclass)
|
|||
filter->min_size_width = DEFAULT_MIN_SIZE_WIDTH;
|
||||
filter->min_size_height = DEFAULT_MIN_SIZE_HEIGHT;
|
||||
filter->cvFaceDetect =
|
||||
gst_facedetect_load_profile (filter, filter->face_profile);
|
||||
gst_face_detect_load_profile (filter, filter->face_profile);
|
||||
filter->cvNoseDetect =
|
||||
gst_facedetect_load_profile (filter, filter->nose_profile);
|
||||
gst_face_detect_load_profile (filter, filter->nose_profile);
|
||||
filter->cvMouthDetect =
|
||||
gst_facedetect_load_profile (filter, filter->mouth_profile);
|
||||
gst_face_detect_load_profile (filter, filter->mouth_profile);
|
||||
filter->cvEyesDetect =
|
||||
gst_facedetect_load_profile (filter, filter->eyes_profile);
|
||||
gst_face_detect_load_profile (filter, filter->eyes_profile);
|
||||
|
||||
gst_opencv_video_filter_set_in_place (GST_OPENCV_VIDEO_FILTER_CAST (filter),
|
||||
TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_facedetect_set_property (GObject * object, guint prop_id,
|
||||
gst_face_detect_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GstFacedetect *filter = GST_FACEDETECT (object);
|
||||
GstFaceDetect *filter = GST_FACE_DETECT (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_FACE_PROFILE:
|
||||
|
@ -330,7 +330,7 @@ gst_facedetect_set_property (GObject * object, guint prop_id,
|
|||
cvReleaseHaarClassifierCascade (&filter->cvFaceDetect);
|
||||
filter->face_profile = g_value_dup_string (value);
|
||||
filter->cvFaceDetect =
|
||||
gst_facedetect_load_profile (filter, filter->face_profile);
|
||||
gst_face_detect_load_profile (filter, filter->face_profile);
|
||||
break;
|
||||
case PROP_NOSE_PROFILE:
|
||||
g_free (filter->nose_profile);
|
||||
|
@ -338,7 +338,7 @@ gst_facedetect_set_property (GObject * object, guint prop_id,
|
|||
cvReleaseHaarClassifierCascade (&filter->cvNoseDetect);
|
||||
filter->nose_profile = g_value_dup_string (value);
|
||||
filter->cvNoseDetect =
|
||||
gst_facedetect_load_profile (filter, filter->nose_profile);
|
||||
gst_face_detect_load_profile (filter, filter->nose_profile);
|
||||
break;
|
||||
case PROP_MOUTH_PROFILE:
|
||||
g_free (filter->mouth_profile);
|
||||
|
@ -346,7 +346,7 @@ gst_facedetect_set_property (GObject * object, guint prop_id,
|
|||
cvReleaseHaarClassifierCascade (&filter->cvMouthDetect);
|
||||
filter->mouth_profile = g_value_dup_string (value);
|
||||
filter->cvMouthDetect =
|
||||
gst_facedetect_load_profile (filter, filter->mouth_profile);
|
||||
gst_face_detect_load_profile (filter, filter->mouth_profile);
|
||||
break;
|
||||
case PROP_EYES_PROFILE:
|
||||
g_free (filter->eyes_profile);
|
||||
|
@ -354,7 +354,7 @@ gst_facedetect_set_property (GObject * object, guint prop_id,
|
|||
cvReleaseHaarClassifierCascade (&filter->cvEyesDetect);
|
||||
filter->eyes_profile = g_value_dup_string (value);
|
||||
filter->cvEyesDetect =
|
||||
gst_facedetect_load_profile (filter, filter->eyes_profile);
|
||||
gst_face_detect_load_profile (filter, filter->eyes_profile);
|
||||
break;
|
||||
case PROP_DISPLAY:
|
||||
filter->display = g_value_get_boolean (value);
|
||||
|
@ -381,10 +381,10 @@ gst_facedetect_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_facedetect_get_property (GObject * object, guint prop_id,
|
||||
gst_face_detect_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GstFacedetect *filter = GST_FACEDETECT (object);
|
||||
GstFaceDetect *filter = GST_FACE_DETECT (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_FACE_PROFILE:
|
||||
|
@ -427,13 +427,13 @@ gst_facedetect_get_property (GObject * object, guint prop_id,
|
|||
|
||||
/* this function handles the link with other elements */
|
||||
static gboolean
|
||||
gst_facedetect_set_caps (GstOpencvVideoFilter * transform, gint in_width,
|
||||
gst_face_detect_set_caps (GstOpencvVideoFilter * transform, gint in_width,
|
||||
gint in_height, gint in_depth, gint in_channels,
|
||||
gint out_width, gint out_height, gint out_depth, gint out_channels)
|
||||
{
|
||||
GstFacedetect *filter;
|
||||
GstFaceDetect *filter;
|
||||
|
||||
filter = GST_FACEDETECT (transform);
|
||||
filter = GST_FACE_DETECT (transform);
|
||||
|
||||
if (filter->cvGray)
|
||||
cvReleaseImage (&filter->cvGray);
|
||||
|
@ -450,7 +450,7 @@ gst_facedetect_set_caps (GstOpencvVideoFilter * transform, gint in_width,
|
|||
}
|
||||
|
||||
static GstMessage *
|
||||
gst_facedetect_message_new (GstFacedetect * filter, GstBuffer * buf)
|
||||
gst_face_detect_message_new (GstFaceDetect * filter, GstBuffer * buf)
|
||||
{
|
||||
GstBaseTransform *trans = GST_BASE_TRANSFORM_CAST (filter);
|
||||
GstStructure *s;
|
||||
|
@ -475,10 +475,10 @@ gst_facedetect_message_new (GstFacedetect * filter, GstBuffer * buf)
|
|||
* Performs the face detection
|
||||
*/
|
||||
static GstFlowReturn
|
||||
gst_facedetect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
|
||||
gst_face_detect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
|
||||
IplImage * img)
|
||||
{
|
||||
GstFacedetect *filter = GST_FACEDETECT (base);
|
||||
GstFaceDetect *filter = GST_FACE_DETECT (base);
|
||||
|
||||
if (filter->cvFaceDetect) {
|
||||
GstMessage *msg = NULL;
|
||||
|
@ -509,7 +509,7 @@ gst_facedetect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
|
|||
);
|
||||
|
||||
if (faces && faces->total > 0) {
|
||||
msg = gst_facedetect_message_new (filter, buf);
|
||||
msg = gst_face_detect_message_new (filter, buf);
|
||||
g_value_init (&facelist, GST_TYPE_LIST);
|
||||
}
|
||||
|
||||
|
@ -692,7 +692,7 @@ gst_facedetect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
|
|||
|
||||
|
||||
static CvHaarClassifierCascade *
|
||||
gst_facedetect_load_profile (GstFacedetect * filter, gchar * profile)
|
||||
gst_face_detect_load_profile (GstFaceDetect * filter, gchar * profile)
|
||||
{
|
||||
CvHaarClassifierCascade *cascade;
|
||||
|
||||
|
@ -709,13 +709,13 @@ gst_facedetect_load_profile (GstFacedetect * filter, gchar * profile)
|
|||
* register the element factories and other features
|
||||
*/
|
||||
gboolean
|
||||
gst_facedetect_plugin_init (GstPlugin * plugin)
|
||||
gst_face_detect_plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
/* debug category for fltering log messages */
|
||||
GST_DEBUG_CATEGORY_INIT (gst_facedetect_debug, "facedetect",
|
||||
GST_DEBUG_CATEGORY_INIT (gst_face_detect_debug, "facedetect",
|
||||
0,
|
||||
"Performs face detection on videos and images, providing detected positions via bus messages");
|
||||
|
||||
return gst_element_register (plugin, "facedetect", GST_RANK_NONE,
|
||||
GST_TYPE_FACEDETECT);
|
||||
GST_TYPE_FACE_DETECT);
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_FACEDETECT_H__
|
||||
#define __GST_FACEDETECT_H__
|
||||
#ifndef __GST_FACE_DETECT_H__
|
||||
#define __GST_FACE_DETECT_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <cv.h>
|
||||
|
@ -57,20 +57,20 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
/* #defines don't like whitespacey bits */
|
||||
#define GST_TYPE_FACEDETECT \
|
||||
(gst_facedetect_get_type())
|
||||
#define GST_FACEDETECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FACEDETECT,GstFacedetect))
|
||||
#define GST_FACEDETECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FACEDETECT,GstFacedetectClass))
|
||||
#define GST_IS_FACEDETECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FACEDETECT))
|
||||
#define GST_IS_FACEDETECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FACEDETECT))
|
||||
typedef struct _GstFacedetect GstFacedetect;
|
||||
typedef struct _GstFacedetectClass GstFacedetectClass;
|
||||
#define GST_TYPE_FACE_DETECT \
|
||||
(gst_face_detect_get_type())
|
||||
#define GST_FACE_DETECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FACE_DETECT,GstFaceDetect))
|
||||
#define GST_FACE_DETECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FACE_DETECT,GstFaceDetectClass))
|
||||
#define GST_IS_FACE_DETECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FACE_DETECT))
|
||||
#define GST_IS_FACE_DETECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FACE_DETECT))
|
||||
typedef struct _GstFaceDetect GstFaceDetect;
|
||||
typedef struct _GstFaceDetectClass GstFaceDetectClass;
|
||||
|
||||
struct _GstFacedetect
|
||||
struct _GstFaceDetect
|
||||
{
|
||||
GstOpencvVideoFilter element;
|
||||
|
||||
|
@ -94,14 +94,14 @@ struct _GstFacedetect
|
|||
CvMemStorage *cvStorage;
|
||||
};
|
||||
|
||||
struct _GstFacedetectClass
|
||||
struct _GstFaceDetectClass
|
||||
{
|
||||
GstOpencvVideoFilterClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_facedetect_get_type (void);
|
||||
GType gst_face_detect_get_type (void);
|
||||
|
||||
gboolean gst_facedetect_plugin_init (GstPlugin * plugin);
|
||||
gboolean gst_face_detect_plugin_init (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_FACEDETECT_H__ */
|
||||
#endif /* __GST_FACE_DETECT_H__ */
|
||||
|
|
|
@ -1092,7 +1092,7 @@ gst_motion_cells_chain (GstPad * pad, GstBuffer * buf)
|
|||
* register the element factories and other features
|
||||
*/
|
||||
gboolean
|
||||
gst_motioncells_plugin_init (GstPlugin * plugin)
|
||||
gst_motion_cells_plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
/* debug category for fltering log messages */
|
||||
GST_DEBUG_CATEGORY_INIT (gst_motion_cells_debug,
|
||||
|
|
|
@ -118,7 +118,7 @@ struct _GstMotioncellsClass
|
|||
|
||||
GType gst_motion_cells_get_type (void);
|
||||
|
||||
gboolean gst_motioncells_plugin_init (GstPlugin * plugin);
|
||||
gboolean gst_motion_cells_plugin_init (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_MOTION_CELLS_H__ */
|
||||
|
|
|
@ -58,22 +58,22 @@ plugin_init (GstPlugin * plugin)
|
|||
if (!gst_cv_sobel_plugin_init (plugin))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_edgedetect_plugin_init (plugin))
|
||||
if (!gst_edge_detect_plugin_init (plugin))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_faceblur_plugin_init (plugin))
|
||||
if (!gst_face_blur_plugin_init (plugin))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_facedetect_plugin_init (plugin))
|
||||
if (!gst_face_detect_plugin_init (plugin))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_motioncells_plugin_init (plugin))
|
||||
if (!gst_motion_cells_plugin_init (plugin))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_pyramidsegment_plugin_init (plugin))
|
||||
if (!gst_pyramid_segment_plugin_init (plugin))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_templatematch_plugin_init (plugin))
|
||||
if (!gst_template_match_plugin_init (plugin))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_opencv_text_overlay_plugin_init (plugin))
|
||||
|
|
|
@ -67,8 +67,8 @@
|
|||
|
||||
#define BLOCK_SIZE 1000
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_pyramidsegment_debug);
|
||||
#define GST_CAT_DEFAULT gst_pyramidsegment_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_pyramid_segment_debug);
|
||||
#define GST_CAT_DEFAULT gst_pyramid_segment_debug
|
||||
|
||||
/* Filter signals and args */
|
||||
enum
|
||||
|
@ -102,22 +102,22 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB)
|
||||
);
|
||||
|
||||
GST_BOILERPLATE (Gstpyramidsegment, gst_pyramidsegment, GstElement,
|
||||
GST_BOILERPLATE (GstPyramidSegment, gst_pyramid_segment, GstElement,
|
||||
GST_TYPE_ELEMENT);
|
||||
|
||||
static void gst_pyramidsegment_set_property (GObject * object, guint prop_id,
|
||||
static void gst_pyramid_segment_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_pyramidsegment_get_property (GObject * object, guint prop_id,
|
||||
static void gst_pyramid_segment_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static gboolean gst_pyramidsegment_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_pyramidsegment_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_pyramid_segment_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_pyramid_segment_chain (GstPad * pad, GstBuffer * buf);
|
||||
|
||||
/* Clean up */
|
||||
static void
|
||||
gst_pyramidsegment_finalize (GObject * obj)
|
||||
gst_pyramid_segment_finalize (GObject * obj)
|
||||
{
|
||||
Gstpyramidsegment *filter = GST_PYRAMIDSEGMENT (obj);
|
||||
GstPyramidSegment *filter = GST_PYRAMID_SEGMENT (obj);
|
||||
|
||||
if (filter->cvImage != NULL) {
|
||||
cvReleaseImage (&filter->cvImage);
|
||||
|
@ -129,7 +129,7 @@ gst_pyramidsegment_finalize (GObject * obj)
|
|||
|
||||
/* GObject vmethod implementations */
|
||||
static void
|
||||
gst_pyramidsegment_base_init (gpointer gclass)
|
||||
gst_pyramid_segment_base_init (gpointer gclass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
|
||||
|
||||
|
@ -147,16 +147,16 @@ gst_pyramidsegment_base_init (gpointer gclass)
|
|||
|
||||
/* initialize the pyramidsegment's class */
|
||||
static void
|
||||
gst_pyramidsegment_class_init (GstpyramidsegmentClass * klass)
|
||||
gst_pyramid_segment_class_init (GstPyramidSegmentClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_pyramidsegment_finalize);
|
||||
gobject_class->set_property = gst_pyramidsegment_set_property;
|
||||
gobject_class->get_property = gst_pyramidsegment_get_property;
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_pyramid_segment_finalize);
|
||||
gobject_class->set_property = gst_pyramid_segment_set_property;
|
||||
gobject_class->get_property = gst_pyramid_segment_get_property;
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_SILENT,
|
||||
g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?",
|
||||
|
@ -184,16 +184,16 @@ gst_pyramidsegment_class_init (GstpyramidsegmentClass * klass)
|
|||
* initialize instance structure
|
||||
*/
|
||||
static void
|
||||
gst_pyramidsegment_init (Gstpyramidsegment * filter,
|
||||
GstpyramidsegmentClass * gclass)
|
||||
gst_pyramid_segment_init (GstPyramidSegment * filter,
|
||||
GstPyramidSegmentClass * gclass)
|
||||
{
|
||||
filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
|
||||
gst_pad_set_setcaps_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_pyramidsegment_set_caps));
|
||||
GST_DEBUG_FUNCPTR (gst_pyramid_segment_set_caps));
|
||||
gst_pad_set_getcaps_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||
gst_pad_set_chain_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_pyramidsegment_chain));
|
||||
GST_DEBUG_FUNCPTR (gst_pyramid_segment_chain));
|
||||
|
||||
filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
||||
gst_pad_set_getcaps_function (filter->srcpad,
|
||||
|
@ -211,10 +211,10 @@ gst_pyramidsegment_init (Gstpyramidsegment * filter,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_pyramidsegment_set_property (GObject * object, guint prop_id,
|
||||
gst_pyramid_segment_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
Gstpyramidsegment *filter = GST_PYRAMIDSEGMENT (object);
|
||||
GstPyramidSegment *filter = GST_PYRAMID_SEGMENT (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_SILENT:
|
||||
|
@ -236,10 +236,10 @@ gst_pyramidsegment_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_pyramidsegment_get_property (GObject * object, guint prop_id,
|
||||
gst_pyramid_segment_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
Gstpyramidsegment *filter = GST_PYRAMIDSEGMENT (object);
|
||||
GstPyramidSegment *filter = GST_PYRAMID_SEGMENT (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_SILENT:
|
||||
|
@ -264,14 +264,14 @@ gst_pyramidsegment_get_property (GObject * object, guint prop_id,
|
|||
|
||||
/* this function handles the link with other elements */
|
||||
static gboolean
|
||||
gst_pyramidsegment_set_caps (GstPad * pad, GstCaps * caps)
|
||||
gst_pyramid_segment_set_caps (GstPad * pad, GstCaps * caps)
|
||||
{
|
||||
Gstpyramidsegment *filter;
|
||||
GstPyramidSegment *filter;
|
||||
GstPad *otherpad;
|
||||
GstStructure *structure;
|
||||
gint width, height;
|
||||
|
||||
filter = GST_PYRAMIDSEGMENT (gst_pad_get_parent (pad));
|
||||
filter = GST_PYRAMID_SEGMENT (gst_pad_get_parent (pad));
|
||||
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
gst_structure_get_int (structure, "width", &width);
|
||||
|
@ -289,12 +289,12 @@ gst_pyramidsegment_set_caps (GstPad * pad, GstCaps * caps)
|
|||
* this function does the actual processing
|
||||
*/
|
||||
static GstFlowReturn
|
||||
gst_pyramidsegment_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_pyramid_segment_chain (GstPad * pad, GstBuffer * buf)
|
||||
{
|
||||
Gstpyramidsegment *filter;
|
||||
GstPyramidSegment *filter;
|
||||
GstBuffer *outbuf;
|
||||
|
||||
filter = GST_PYRAMIDSEGMENT (GST_OBJECT_PARENT (pad));
|
||||
filter = GST_PYRAMID_SEGMENT (GST_OBJECT_PARENT (pad));
|
||||
|
||||
filter->cvImage->imageData = (char *) GST_BUFFER_DATA (buf);
|
||||
filter->cvSegmentedImage = cvCloneImage (filter->cvImage);
|
||||
|
@ -323,12 +323,12 @@ gst_pyramidsegment_chain (GstPad * pad, GstBuffer * buf)
|
|||
* register the element factories and other features
|
||||
*/
|
||||
gboolean
|
||||
gst_pyramidsegment_plugin_init (GstPlugin * plugin)
|
||||
gst_pyramid_segment_plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
/* debug category for fltering log messages */
|
||||
GST_DEBUG_CATEGORY_INIT (gst_pyramidsegment_debug, "pyramidsegment",
|
||||
GST_DEBUG_CATEGORY_INIT (gst_pyramid_segment_debug, "pyramidsegment",
|
||||
0, "Applies pyramid segmentation to a video or image");
|
||||
|
||||
return gst_element_register (plugin, "pyramidsegment", GST_RANK_NONE,
|
||||
GST_TYPE_PYRAMIDSEGMENT);
|
||||
GST_TYPE_PYRAMID_SEGMENT);
|
||||
}
|
||||
|
|
|
@ -43,28 +43,28 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_PYRAMIDSEGMENT_H__
|
||||
#define __GST_PYRAMIDSEGMENT_H__
|
||||
#ifndef __GST_PYRAMID_SEGMENT_H__
|
||||
#define __GST_PYRAMID_SEGMENT_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <cv.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/* #defines don't like whitespacey bits */
|
||||
#define GST_TYPE_PYRAMIDSEGMENT \
|
||||
(gst_pyramidsegment_get_type())
|
||||
#define GST_PYRAMIDSEGMENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PYRAMIDSEGMENT,Gstpyramidsegment))
|
||||
#define GST_PYRAMIDSEGMENT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PYRAMIDSEGMENT,GstpyramidsegmentClass))
|
||||
#define GST_IS_PYRAMIDSEGMENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PYRAMIDSEGMENT))
|
||||
#define GST_IS_PYRAMIDSEGMENT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PYRAMIDSEGMENT))
|
||||
typedef struct _Gstpyramidsegment Gstpyramidsegment;
|
||||
typedef struct _GstpyramidsegmentClass GstpyramidsegmentClass;
|
||||
#define GST_TYPE_PYRAMID_SEGMENT \
|
||||
(gst_pyramid_segment_get_type())
|
||||
#define GST_PYRAMID_SEGMENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PYRAMID_SEGMENT,GstPyramidSegment))
|
||||
#define GST_PYRAMID_SEGMENT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PYRAMID_SEGMENT,GstPyramidSegmentClass))
|
||||
#define GST_IS_PYRAMID_SEGMENT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PYRAMID_SEGMENT))
|
||||
#define GST_IS_PYRAMID_SEGMENT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PYRAMID_SEGMENT))
|
||||
typedef struct _GstPyramidSegment GstPyramidSegment;
|
||||
typedef struct _GstPyramidSegmentClass GstPyramidSegmentClass;
|
||||
|
||||
struct _Gstpyramidsegment
|
||||
struct _GstPyramidSegment
|
||||
{
|
||||
GstElement element;
|
||||
|
||||
|
@ -83,14 +83,14 @@ struct _Gstpyramidsegment
|
|||
int level;
|
||||
};
|
||||
|
||||
struct _GstpyramidsegmentClass
|
||||
struct _GstPyramidSegmentClass
|
||||
{
|
||||
GstElementClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_pyramidsegment_get_type (void);
|
||||
GType gst_pyramid_segment_get_type (void);
|
||||
|
||||
gboolean gst_pyramidsegment_plugin_init (GstPlugin * plugin);
|
||||
gboolean gst_pyramid_segment_plugin_init (GstPlugin * plugin);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_PYRAMIDSEGMENT_H__ */
|
||||
#endif /* __GST_PYRAMID_SEGMENT_H__ */
|
||||
|
|
|
@ -66,8 +66,8 @@
|
|||
#include "gstopencvutils.h"
|
||||
#include "gsttemplatematch.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_templatematch_debug);
|
||||
#define GST_CAT_DEFAULT gst_templatematch_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (gst_template_match_debug);
|
||||
#define GST_CAT_DEFAULT gst_template_match_debug
|
||||
|
||||
#define DEFAULT_METHOD (3)
|
||||
|
||||
|
@ -100,26 +100,26 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB)
|
||||
);
|
||||
|
||||
GST_BOILERPLATE (GstTemplateMatch, gst_templatematch, GstElement,
|
||||
GST_BOILERPLATE (GstTemplateMatch, gst_template_match, GstElement,
|
||||
GST_TYPE_ELEMENT);
|
||||
|
||||
static void gst_templatematch_finalize (GObject * object);
|
||||
static void gst_templatematch_set_property (GObject * object, guint prop_id,
|
||||
static void gst_template_match_finalize (GObject * object);
|
||||
static void gst_template_match_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_templatematch_get_property (GObject * object, guint prop_id,
|
||||
static void gst_template_match_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static gboolean gst_templatematch_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_templatematch_chain (GstPad * pad, GstBuffer * buf);
|
||||
static gboolean gst_template_match_set_caps (GstPad * pad, GstCaps * caps);
|
||||
static GstFlowReturn gst_template_match_chain (GstPad * pad, GstBuffer * buf);
|
||||
|
||||
static void gst_templatematch_load_template (GstTemplateMatch * filter);
|
||||
static void gst_templatematch_match (IplImage * input, IplImage * template,
|
||||
static void gst_template_match_load_template (GstTemplateMatch * filter);
|
||||
static void gst_template_match_match (IplImage * input, IplImage * template,
|
||||
IplImage * dist_image, double *best_res, CvPoint * best_pos, int method);
|
||||
|
||||
/* GObject vmethod implementations */
|
||||
|
||||
static void
|
||||
gst_templatematch_base_init (gpointer gclass)
|
||||
gst_template_match_base_init (gpointer gclass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
|
||||
|
||||
|
@ -137,15 +137,15 @@ gst_templatematch_base_init (gpointer gclass)
|
|||
|
||||
/* initialize the templatematch's class */
|
||||
static void
|
||||
gst_templatematch_class_init (GstTemplateMatchClass * klass)
|
||||
gst_template_match_class_init (GstTemplateMatchClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
|
||||
gobject_class->finalize = gst_templatematch_finalize;
|
||||
gobject_class->set_property = gst_templatematch_set_property;
|
||||
gobject_class->get_property = gst_templatematch_get_property;
|
||||
gobject_class->finalize = gst_template_match_finalize;
|
||||
gobject_class->set_property = gst_template_match_set_property;
|
||||
gobject_class->get_property = gst_template_match_get_property;
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_METHOD,
|
||||
g_param_spec_int ("method", "Method",
|
||||
|
@ -166,16 +166,16 @@ gst_templatematch_class_init (GstTemplateMatchClass * klass)
|
|||
* initialize instance structure
|
||||
*/
|
||||
static void
|
||||
gst_templatematch_init (GstTemplateMatch * filter,
|
||||
gst_template_match_init (GstTemplateMatch * filter,
|
||||
GstTemplateMatchClass * gclass)
|
||||
{
|
||||
filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
|
||||
gst_pad_set_setcaps_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_templatematch_set_caps));
|
||||
GST_DEBUG_FUNCPTR (gst_template_match_set_caps));
|
||||
gst_pad_set_getcaps_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||
gst_pad_set_chain_function (filter->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_templatematch_chain));
|
||||
GST_DEBUG_FUNCPTR (gst_template_match_chain));
|
||||
|
||||
filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
||||
gst_pad_set_getcaps_function (filter->srcpad,
|
||||
|
@ -189,14 +189,14 @@ gst_templatematch_init (GstTemplateMatch * filter,
|
|||
filter->cvDistImage = NULL;
|
||||
filter->cvImage = NULL;
|
||||
filter->method = DEFAULT_METHOD;
|
||||
gst_templatematch_load_template (filter);
|
||||
gst_template_match_load_template (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_templatematch_set_property (GObject * object, guint prop_id,
|
||||
gst_template_match_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GstTemplateMatch *filter = GST_TEMPLATEMATCH (object);
|
||||
GstTemplateMatch *filter = GST_TEMPLATE_MATCH (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_METHOD:
|
||||
|
@ -223,7 +223,7 @@ gst_templatematch_set_property (GObject * object, guint prop_id,
|
|||
break;
|
||||
case PROP_TEMPLATE:
|
||||
filter->template = (char *) g_value_get_string (value);
|
||||
gst_templatematch_load_template (filter);
|
||||
gst_template_match_load_template (filter);
|
||||
break;
|
||||
case PROP_DISPLAY:
|
||||
filter->display = g_value_get_boolean (value);
|
||||
|
@ -235,10 +235,10 @@ gst_templatematch_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_templatematch_get_property (GObject * object, guint prop_id,
|
||||
gst_template_match_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GstTemplateMatch *filter = GST_TEMPLATEMATCH (object);
|
||||
GstTemplateMatch *filter = GST_TEMPLATE_MATCH (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_METHOD:
|
||||
|
@ -260,14 +260,14 @@ gst_templatematch_get_property (GObject * object, guint prop_id,
|
|||
|
||||
/* this function handles the link with other elements */
|
||||
static gboolean
|
||||
gst_templatematch_set_caps (GstPad * pad, GstCaps * caps)
|
||||
gst_template_match_set_caps (GstPad * pad, GstCaps * caps)
|
||||
{
|
||||
GstTemplateMatch *filter;
|
||||
GstPad *otherpad;
|
||||
gint width, height;
|
||||
GstStructure *structure;
|
||||
|
||||
filter = GST_TEMPLATEMATCH (gst_pad_get_parent (pad));
|
||||
filter = GST_TEMPLATE_MATCH (gst_pad_get_parent (pad));
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
gst_structure_get_int (structure, "width", &width);
|
||||
gst_structure_get_int (structure, "height", &height);
|
||||
|
@ -282,10 +282,10 @@ gst_templatematch_set_caps (GstPad * pad, GstCaps * caps)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_templatematch_finalize (GObject * object)
|
||||
gst_template_match_finalize (GObject * object)
|
||||
{
|
||||
GstTemplateMatch *filter;
|
||||
filter = GST_TEMPLATEMATCH (object);
|
||||
filter = GST_TEMPLATE_MATCH (object);
|
||||
|
||||
if (filter->cvImage) {
|
||||
cvReleaseImageHeader (&filter->cvImage);
|
||||
|
@ -302,13 +302,13 @@ gst_templatematch_finalize (GObject * object)
|
|||
* this function does the actual processing
|
||||
*/
|
||||
static GstFlowReturn
|
||||
gst_templatematch_chain (GstPad * pad, GstBuffer * buf)
|
||||
gst_template_match_chain (GstPad * pad, GstBuffer * buf)
|
||||
{
|
||||
GstTemplateMatch *filter;
|
||||
CvPoint best_pos;
|
||||
double best_res;
|
||||
|
||||
filter = GST_TEMPLATEMATCH (GST_OBJECT_PARENT (pad));
|
||||
filter = GST_TEMPLATE_MATCH (GST_OBJECT_PARENT (pad));
|
||||
|
||||
/* FIXME Why template == NULL returns OK?
|
||||
* shouldn't it be a passthrough instead? */
|
||||
|
@ -344,7 +344,7 @@ gst_templatematch_chain (GstPad * pad, GstBuffer * buf)
|
|||
GstStructure *s;
|
||||
GstMessage *m;
|
||||
|
||||
gst_templatematch_match (filter->cvImage, filter->cvTemplateImage,
|
||||
gst_template_match_match (filter->cvImage, filter->cvTemplateImage,
|
||||
filter->cvDistImage, &best_res, &best_pos, filter->method);
|
||||
|
||||
s = gst_structure_new ("template_match",
|
||||
|
@ -376,7 +376,7 @@ gst_templatematch_chain (GstPad * pad, GstBuffer * buf)
|
|||
|
||||
|
||||
static void
|
||||
gst_templatematch_match (IplImage * input, IplImage * template,
|
||||
gst_template_match_match (IplImage * input, IplImage * template,
|
||||
IplImage * dist_image, double *best_res, CvPoint * best_pos, int method)
|
||||
{
|
||||
double dist_min = 0, dist_max = 0;
|
||||
|
@ -397,7 +397,7 @@ gst_templatematch_match (IplImage * input, IplImage * template,
|
|||
|
||||
|
||||
static void
|
||||
gst_templatematch_load_template (GstTemplateMatch * filter)
|
||||
gst_template_match_load_template (GstTemplateMatch * filter)
|
||||
{
|
||||
if (filter->template) {
|
||||
filter->cvTemplateImage =
|
||||
|
@ -416,13 +416,13 @@ gst_templatematch_load_template (GstTemplateMatch * filter)
|
|||
* register the element factories and other features
|
||||
*/
|
||||
gboolean
|
||||
gst_templatematch_plugin_init (GstPlugin * templatematch)
|
||||
gst_template_match_plugin_init (GstPlugin * templatematch)
|
||||
{
|
||||
/* debug category for fltering log messages */
|
||||
GST_DEBUG_CATEGORY_INIT (gst_templatematch_debug, "templatematch",
|
||||
GST_DEBUG_CATEGORY_INIT (gst_template_match_debug, "templatematch",
|
||||
0,
|
||||
"Performs template matching on videos and images, providing detected positions via bus messages");
|
||||
|
||||
return gst_element_register (templatematch, "templatematch", GST_RANK_NONE,
|
||||
GST_TYPE_TEMPLATEMATCH);
|
||||
GST_TYPE_TEMPLATE_MATCH);
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_TEMPLATEMATCH_H__
|
||||
#define __GST_TEMPLATEMATCH_H__
|
||||
#ifndef __GST_TEMPLATE_MATCH_H__
|
||||
#define __GST_TEMPLATE_MATCH_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <cv.h>
|
||||
|
@ -52,16 +52,16 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
/* #defines don't like whitespacey bits */
|
||||
#define GST_TYPE_TEMPLATEMATCH \
|
||||
(gst_templatematch_get_type())
|
||||
#define GST_TEMPLATEMATCH(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TEMPLATEMATCH,GstTemplateMatch))
|
||||
#define GST_TEMPLATEMATCH_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TEMPLATEMATCH,GstTemplateMatchClass))
|
||||
#define GST_IS_TEMPLATEMATCH(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TEMPLATEMATCH))
|
||||
#define GST_IS_TEMPLATEMATCH_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TEMPLATEMATCH))
|
||||
#define GST_TYPE_TEMPLATE_MATCH \
|
||||
(gst_template_match_get_type())
|
||||
#define GST_TEMPLATE_MATCH(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TEMPLATE_MATCH,GstTemplateMatch))
|
||||
#define GST_TEMPLATE_MATCH_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TEMPLATE_MATCH,GstTemplateMatchClass))
|
||||
#define GST_IS_TEMPLATE_MATCH(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TEMPLATE_MATCH))
|
||||
#define GST_IS_TEMPLATE_MATCH_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TEMPLATE_MATCH))
|
||||
typedef struct _GstTemplateMatch GstTemplateMatch;
|
||||
typedef struct _GstTemplateMatchClass GstTemplateMatchClass;
|
||||
|
||||
|
@ -84,9 +84,9 @@ struct _GstTemplateMatchClass
|
|||
GstElementClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_templatematch_get_type (void);
|
||||
GType gst_template_match_get_type (void);
|
||||
|
||||
gboolean gst_templatematch_plugin_init (GstPlugin * templatematch);
|
||||
gboolean gst_template_match_plugin_init (GstPlugin * templatematch);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_TEMPLATEMATCH_H__ */
|
||||
#endif /* __GST_TEMPLATE_MATCH_H__ */
|
||||
|
|
Loading…
Reference in a new issue