faceblur: post message when profile loading fails
This commit is contained in:
parent
555d29681b
commit
43a4498569
@ -174,6 +174,7 @@ gst_face_blur_init (GstFaceBlur * filter)
|
|||||||
{
|
{
|
||||||
filter->profile = g_strdup (DEFAULT_PROFILE);
|
filter->profile = g_strdup (DEFAULT_PROFILE);
|
||||||
gst_face_blur_load_profile (filter);
|
gst_face_blur_load_profile (filter);
|
||||||
|
filter->sent_profile_load_failed_msg = FALSE;
|
||||||
|
|
||||||
gst_opencv_video_filter_set_in_place (GST_OPENCV_VIDEO_FILTER_CAST (filter),
|
gst_opencv_video_filter_set_in_place (GST_OPENCV_VIDEO_FILTER_CAST (filter),
|
||||||
TRUE);
|
TRUE);
|
||||||
@ -190,6 +191,7 @@ gst_face_blur_set_property (GObject * object, guint prop_id,
|
|||||||
g_free (filter->profile);
|
g_free (filter->profile);
|
||||||
filter->profile = g_value_dup_string (value);
|
filter->profile = g_value_dup_string (value);
|
||||||
gst_face_blur_load_profile (filter);
|
gst_face_blur_load_profile (filter);
|
||||||
|
filter->sent_profile_load_failed_msg = FALSE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
@ -241,8 +243,17 @@ gst_face_blur_transform_ip (GstOpencvVideoFilter * transform,
|
|||||||
CvSeq *faces;
|
CvSeq *faces;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!filter->cvCascade)
|
if (!filter->cvCascade) {
|
||||||
|
if (filter->profile != NULL
|
||||||
|
&& filter->sent_profile_load_failed_msg == FALSE) {
|
||||||
|
GST_ELEMENT_WARNING (filter, RESOURCE, NOT_FOUND,
|
||||||
|
("Profile %s is missing.", filter->profile),
|
||||||
|
("missing faceblur profile file %s", filter->profile));
|
||||||
|
filter->sent_profile_load_failed_msg = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
|
|
||||||
cvCvtColor (img, filter->cvGray, CV_RGB2GRAY);
|
cvCvtColor (img, filter->cvGray, CV_RGB2GRAY);
|
||||||
cvClearMemStorage (filter->cvStorage);
|
cvClearMemStorage (filter->cvStorage);
|
||||||
|
@ -74,9 +74,10 @@ struct _GstFaceBlur
|
|||||||
{
|
{
|
||||||
GstOpencvVideoFilter element;
|
GstOpencvVideoFilter element;
|
||||||
|
|
||||||
gboolean display;
|
gboolean sent_profile_load_failed_msg;
|
||||||
|
|
||||||
gchar *profile;
|
gchar *profile;
|
||||||
|
gboolean display;
|
||||||
|
|
||||||
IplImage *cvGray;
|
IplImage *cvGray;
|
||||||
CvHaarClassifierCascade *cvCascade;
|
CvHaarClassifierCascade *cvCascade;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user