From 6193f52f2d88d0fd8ec286d9446c3ad21345a89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vanessa=20Chipirr=C3=A1s=20Naval=C3=B3n?= Date: Wed, 26 Aug 2015 11:57:24 +0200 Subject: [PATCH] faceblur: Change gstfaceblur to C++. Change the gstfaceblur.c file to cpp and add it into Makefile. It is necessary to migrate the faceblur plugin to C++, in order to load new and old classifiers, to make faceblur work with newer versions of Opencv. https://bugzilla.gnome.org/show_bug.cgi?id=753994 --- ext/opencv/Makefile.am | 2 +- ext/opencv/{gstfaceblur.c => gstfaceblur.cpp} | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) rename ext/opencv/{gstfaceblur.c => gstfaceblur.cpp} (96%) diff --git a/ext/opencv/Makefile.am b/ext/opencv/Makefile.am index 0d2e1bb1fc..2f24b3a677 100644 --- a/ext/opencv/Makefile.am +++ b/ext/opencv/Makefile.am @@ -12,7 +12,7 @@ libgstopencv_la_SOURCES = gstopencv.cpp \ gstcvsmooth.c \ gstcvsobel.c \ gstedgedetect.c \ - gstfaceblur.c \ + gstfaceblur.cpp \ gsthanddetect.c \ gstpyramidsegment.c \ gsttemplatematch.c \ diff --git a/ext/opencv/gstfaceblur.c b/ext/opencv/gstfaceblur.cpp similarity index 96% rename from ext/opencv/gstfaceblur.c rename to ext/opencv/gstfaceblur.cpp index e06a82c9cc..6ff7aed4a0 100644 --- a/ext/opencv/gstfaceblur.c +++ b/ext/opencv/gstfaceblur.cpp @@ -197,29 +197,30 @@ gst_face_blur_class_init (GstFaceBlurClass * klass) g_object_class_install_property (gobject_class, PROP_PROFILE, g_param_spec_string ("profile", "Profile", "Location of Haar cascade file to use for face blurion", - DEFAULT_PROFILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + DEFAULT_PROFILE, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_FLAGS, g_param_spec_flags ("flags", "Flags", "Flags to cvHaarDetectObjects", GST_TYPE_OPENCV_FACE_BLUR_FLAGS, DEFAULT_FLAGS, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_SCALE_FACTOR, g_param_spec_double ("scale-factor", "Scale factor", - "Factor by which the windows is scaled after each scan", - 1.1, 10.0, DEFAULT_SCALE_FACTOR, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + "Factor by which the windows is scaled after each scan", 1.1, 10.0, + DEFAULT_SCALE_FACTOR, + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_MIN_NEIGHBORS, g_param_spec_int ("min-neighbors", "Mininum neighbors", "Minimum number (minus 1) of neighbor rectangles that makes up " "an object", 0, G_MAXINT, DEFAULT_MIN_NEIGHBORS, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_MIN_SIZE_WIDTH, g_param_spec_int ("min-size-width", "Minimum size width", "Minimum window width size", 0, G_MAXINT, DEFAULT_MIN_SIZE_WIDTH, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); g_object_class_install_property (gobject_class, PROP_MIN_SIZE_HEIGHT, g_param_spec_int ("min-size-height", "Minimum size height", "Minimum window height size", 0, G_MAXINT, DEFAULT_MIN_SIZE_HEIGHT, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS))); gst_element_class_set_static_metadata (element_class, "faceblur",