vaapipostproc: don't GLTextureUpload if dmabuf

Do not add the meta:GstVideoGLTextureUploadMeta feature if the render
element can handle dmabuf-based buffers, avoiding its negotiation.

Similar as "vaapidecode: do not add meta:GstVideoGLTextureUploadMeta
feature if can dmabuf"

https://bugzilla.gnome.org/show_bug.cgi?id=755072
This commit is contained in:
Julien Isorce 2016-10-19 15:33:41 +01:00 committed by Víctor Manuel Jáquez Leal
parent aa20508bcf
commit bc97987ffb

View file

@ -1032,6 +1032,7 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
{
GValue value = G_VALUE_INIT, v_format = G_VALUE_INIT;
guint i, num_structures;
gint gl_upload_meta_idx = -1;
if (postproc->filter == NULL)
goto cleanup;
@ -1052,8 +1053,10 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
GstStructure *structure;
if (gst_caps_features_contains (features,
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META))
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META)) {
gl_upload_meta_idx = i;
continue;
}
structure = gst_caps_get_structure (caps, i);
if (!structure)
@ -1062,6 +1065,11 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
}
g_value_unset (&value);
if (GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (postproc)
&& gl_upload_meta_idx > -1) {
gst_caps_remove_structure (caps, gl_upload_meta_idx);
}
cleanup:
return caps;
}