mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 02:32:23 +00:00
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
1 changed files with 7 additions and 0 deletions
|
@ -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…
Reference in a new issue