summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMike Sheldon <mike@mikeasoft.com>2009-05-06 15:49:42 +0100
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2010-09-08 17:15:47 -0300
commit2f77a06d233b7519daa168c23884546e2b4ab1f4 (patch)
tree555580f0e6c0616afe6c013513b5b03ec9811d47 /ext
parent4b9ae0088bb71dbef08f353a639b9f7767904bba (diff)
downloadgstreamer-plugins-bad-2f77a06d233b7519daa168c23884546e2b4ab1f4.tar.gz
Fix the profile parameter in the facedetect element to accept a string correctly
Diffstat (limited to 'ext')
-rw-r--r--ext/opencv/facedetect/gstfacedetect.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/opencv/facedetect/gstfacedetect.c b/ext/opencv/facedetect/gstfacedetect.c
index e1e6d70da..1e1af4ce9 100644
--- a/ext/opencv/facedetect/gstfacedetect.c
+++ b/ext/opencv/facedetect/gstfacedetect.c
@@ -112,7 +112,7 @@ static void gst_facedetect_get_property (GObject * object, guint prop_id,
static gboolean gst_facedetect_set_caps (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_facedetect_chain (GstPad * pad, GstBuffer * buf);
-static void gst_facedetect_load_profile (GObject * object);
+static void gst_facedetect_load_profile (Gstfacedetect * filter);
/* Clean up */
static void
@@ -167,8 +167,8 @@ gst_facedetect_class_init (GstfacedetectClass * klass)
g_param_spec_boolean ("display", "Display", "Sets whether the detected faces should be highlighted in the output",
TRUE, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_PROFILE,
- g_param_spec_char ("profile", "Profile", "Location of Haar cascade file to use for face detection",
- G_MININT8, G_MAXINT8, DEFAULT_PROFILE, G_PARAM_READWRITE));
+ g_param_spec_string ("profile", "Profile", "Location of Haar cascade file to use for face detection",
+ DEFAULT_PROFILE, G_PARAM_READWRITE));
}
/* initialize the new element
@@ -207,7 +207,7 @@ gst_facedetect_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_PROFILE:
- filter->profile = g_value_get_char (value);
+ filter->profile = g_value_dup_string (value);
gst_facedetect_load_profile(filter);
break;
case PROP_DISPLAY:
@@ -227,7 +227,7 @@ gst_facedetect_get_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_PROFILE:
- g_value_set_char (value, filter->profile);
+ g_value_take_string (value, filter->profile);
break;
case PROP_DISPLAY:
g_value_set_boolean (value, filter->display);
@@ -315,9 +315,7 @@ gst_facedetect_chain (GstPad * pad, GstBuffer * buf)
}
-static void gst_facedetect_load_profile(GObject * object) {
- Gstfacedetect *filter = GST_FACEDETECT (object);
-
+static void gst_facedetect_load_profile(Gstfacedetect * filter) {
filter->cvCascade = (CvHaarClassifierCascade*)cvLoad(filter->profile, 0, 0, 0 );
if (!filter->cvCascade) {
GST_WARNING ("Couldn't load Haar classifier cascade: %s.", filter->profile);