summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-03-01 11:35:49 +0100
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-03-01 11:35:49 +0100
commit861ef4d218b40391ae752dae43ac8b8e3cd5f5ca (patch)
tree6adfac308a8f0b546f109be9283fa5c6db12606e
parent0bae36bb88324c9cbc94477ef8a0c2be797db18d (diff)
vaapidecode: intersect with filter in getcaps()
In commit 6034734d I forgot to add the caps filter intersection in the getcaps() vmethod generating a regression when a capsfilter is set in the pipeline. This commit adds the caps filter intersection.
-rw-r--r--gst/vaapi/gstvaapidecode.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c
index ed68ccb9..8b40baf3 100644
--- a/gst/vaapi/gstvaapidecode.c
+++ b/gst/vaapi/gstvaapidecode.c
@@ -1005,13 +1005,16 @@ static GstCaps *
gst_vaapidecode_sink_getcaps (GstVideoDecoder * vdec, GstCaps * filter)
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
+ GstCaps *tmp, *caps = NULL;
if (decode->allowed_caps)
goto bail;
/* if we haven't a display yet, return our pad's template caps */
- if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode))
- return gst_pad_get_pad_template_caps (GST_VIDEO_DECODER_SINK_PAD (vdec));
+ if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode)) {
+ caps = gst_pad_get_pad_template_caps (GST_VIDEO_DECODER_SINK_PAD (vdec));
+ goto bail;
+ }
/* if the allowed caps calculation fails, return an empty caps, so
* the auto-plug can try other decoder */
@@ -1019,7 +1022,16 @@ gst_vaapidecode_sink_getcaps (GstVideoDecoder * vdec, GstCaps * filter)
return gst_caps_new_empty ();
bail:
- return gst_caps_ref (decode->allowed_caps);
+ if (!caps)
+ caps = gst_caps_ref (decode->allowed_caps);
+
+ if (filter) {
+ tmp = caps;
+ caps = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST);
+ gst_caps_unref (tmp);
+ }
+
+ return caps;
}
static gboolean