summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2016-02-04 10:16:00 +0200
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-02-09 12:18:27 +0100
commit1f6d29641d25d7c0d4de499ea3fc3c694cf0af7c (patch)
tree4650e2ecf04e01001b8568ad60683e0aee504ec8
parentd9beeafe4bab91570ec6860dd3348e7b9e8c9c5c (diff)
vaapisink: Fix wrong caps advertising
The get_caps() should only report the supported formats. https://bugzilla.gnome.org/show_bug.cgi?id=761147
-rw-r--r--gst/vaapi/gstvaapisink.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c
index c73b2bb7..8f42e096 100644
--- a/gst/vaapi/gstvaapisink.c
+++ b/gst/vaapi/gstvaapisink.c
@@ -1206,18 +1206,32 @@ gst_vaapisink_get_caps_impl (GstBaseSink * base_sink)
{
GstVaapiSink *const sink = GST_VAAPISINK_CAST (base_sink);
GstCaps *out_caps, *raw_caps;
+ static const char surface_caps_str[] =
+ GST_VAAPI_MAKE_ENC_SURFACE_CAPS ";"
+ GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE
+ "," GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION,
+ "{ ENCODED, NV12, I420, YV12 }");
- out_caps = gst_static_pad_template_get_caps (&gst_vaapisink_sink_factory);
- if (!out_caps)
- return NULL;
+ GstCapsFeatures *const features =
+ gst_caps_features_new
+ (GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, NULL);
+
+ out_caps = gst_caps_from_string (surface_caps_str);
if (GST_VAAPI_PLUGIN_BASE_DISPLAY (sink)) {
raw_caps =
gst_vaapi_plugin_base_get_allowed_raw_caps (GST_VAAPI_PLUGIN_BASE
(sink));
if (raw_caps) {
+ GstCaps *feature_caps;
+
out_caps = gst_caps_make_writable (out_caps);
+
gst_caps_append (out_caps, gst_caps_copy (raw_caps));
+
+ feature_caps = gst_caps_copy (raw_caps);
+ gst_caps_set_features (feature_caps, 0, features);
+ gst_caps_append (out_caps, feature_caps);
}
}
return out_caps;