faceblur: Release memory storage
And also release cvImages and memory storage when changing caps or reusing the element.
This commit is contained in:
parent
48e95f3d6f
commit
ae1027297c
@ -121,6 +121,7 @@ gst_face_blur_finalize (GObject * obj)
|
|||||||
if (filter->cvImage) {
|
if (filter->cvImage) {
|
||||||
cvReleaseImage (&filter->cvImage);
|
cvReleaseImage (&filter->cvImage);
|
||||||
cvReleaseImage (&filter->cvGray);
|
cvReleaseImage (&filter->cvGray);
|
||||||
|
cvReleaseMemStorage (&filter->cvStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (filter->profile);
|
g_free (filter->profile);
|
||||||
@ -241,6 +242,12 @@ gst_face_blur_handle_sink_event (GstPad * pad, GstObject * parent,
|
|||||||
gst_structure_get_int (structure, "width", &width);
|
gst_structure_get_int (structure, "width", &width);
|
||||||
gst_structure_get_int (structure, "height", &height);
|
gst_structure_get_int (structure, "height", &height);
|
||||||
|
|
||||||
|
if (filter->cvImage) {
|
||||||
|
cvReleaseImage (&filter->cvImage);
|
||||||
|
cvReleaseImage (&filter->cvGray);
|
||||||
|
cvReleaseMemStorage (&filter->cvStorage);
|
||||||
|
}
|
||||||
|
|
||||||
filter->cvImage = cvCreateImage (cvSize (width, height), IPL_DEPTH_8U, 3);
|
filter->cvImage = cvCreateImage (cvSize (width, height), IPL_DEPTH_8U, 3);
|
||||||
filter->cvGray = cvCreateImage (cvSize (width, height), IPL_DEPTH_8U, 1);
|
filter->cvGray = cvCreateImage (cvSize (width, height), IPL_DEPTH_8U, 1);
|
||||||
filter->cvStorage = cvCreateMemStorage (0);
|
filter->cvStorage = cvCreateMemStorage (0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user