diff options
author | David Rothlisberger <david.rothlisberger@youview.com> | 2012-06-01 16:07:34 +0100 |
---|---|---|
committer | Thiago Santos <ts.santos@osg.sisa.samsung.com> | 2014-07-28 14:17:28 -0300 |
commit | c77808055de487260363adf4969a4b62cc9048a8 (patch) | |
tree | b7988c705bce7878a0a4fbca6457d723471ebcd1 | |
parent | 056d652b922c6bf926bbfdcd3e9edbf31944e605 (diff) |
templatematch: Pass video through when nothing to match against
The early return was bypassing the call to gst_pad_push. With no
filter->template (and thus no filter->cvTemplateImage) the rest of this
function is essentially a no-op (except for the call to gst_pad_push).
This (plus the previous commit) allows templatematch to be
enabled/disabled without removing it entirely from the pipeline, by
setting/unsetting the template property.
-rw-r--r-- | ext/opencv/gsttemplatematch.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/opencv/gsttemplatematch.c b/ext/opencv/gsttemplatematch.c index 47fee9ee1..aea85d660 100644 --- a/ext/opencv/gsttemplatematch.c +++ b/ext/opencv/gsttemplatematch.c @@ -316,9 +316,7 @@ gst_template_match_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) filter = GST_TEMPLATE_MATCH (parent); - /* FIXME Why template == NULL returns OK? - * shouldn't it be a passthrough instead? */ - if ((!filter) || (!buf) || filter->template == NULL) { + if ((!filter) || (!buf)) { return GST_FLOW_OK; } GST_LOG_OBJECT (filter, "Buffer size %u", (guint) gst_buffer_get_size (buf)); @@ -327,7 +325,7 @@ gst_template_match_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) gst_buffer_map (buf, &info, GST_MAP_READWRITE); filter->cvImage->imageData = (char *) info.data; - if (!filter->cvDistImage) { + if (filter->cvTemplateImage && !filter->cvDistImage) { if (filter->cvTemplateImage->width > filter->cvImage->width) { GST_WARNING ("Template Image is wider than input image"); } else if (filter->cvTemplateImage->height > filter->cvImage->height) { |