mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
templatematch: Release cvImages when reloading templates are changing caps
This commit is contained in:
parent
7e0503ca89
commit
2683c87863
1 changed files with 7 additions and 0 deletions
|
@ -266,6 +266,9 @@ gst_template_match_handle_sink_event (GstPad * pad, GstObject * parent,
|
||||||
gst_event_parse_caps (event, &caps);
|
gst_event_parse_caps (event, &caps);
|
||||||
gst_video_info_from_caps (&info, caps);
|
gst_video_info_from_caps (&info, caps);
|
||||||
|
|
||||||
|
if (filter->cvImage) {
|
||||||
|
cvReleaseImageHeader (&filter->cvImage);
|
||||||
|
}
|
||||||
filter->cvImage =
|
filter->cvImage =
|
||||||
cvCreateImageHeader (cvSize (info.width, info.height), IPL_DEPTH_8U,
|
cvCreateImageHeader (cvSize (info.width, info.height), IPL_DEPTH_8U,
|
||||||
3);
|
3);
|
||||||
|
@ -406,6 +409,10 @@ static void
|
||||||
gst_template_match_load_template (GstTemplateMatch * filter)
|
gst_template_match_load_template (GstTemplateMatch * filter)
|
||||||
{
|
{
|
||||||
if (filter->template) {
|
if (filter->template) {
|
||||||
|
|
||||||
|
if (filter->cvTemplateImage) {
|
||||||
|
cvReleaseImage (&filter->cvTemplateImage);
|
||||||
|
}
|
||||||
filter->cvTemplateImage =
|
filter->cvTemplateImage =
|
||||||
cvLoadImage (filter->template, CV_LOAD_IMAGE_COLOR);
|
cvLoadImage (filter->template, CV_LOAD_IMAGE_COLOR);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue