summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gst/vaapi/gstvaapipostproc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c
index 556cb515..3a9ba4aa 100644
--- a/gst/vaapi/gstvaapipostproc.c
+++ b/gst/vaapi/gstvaapipostproc.c
@@ -1029,6 +1029,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;
@@ -1049,8 +1050,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)
@@ -1059,6 +1062,13 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
}
g_value_unset (&value);
+ /* remove GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META if
+ * the backend doesn't support opengl */
+ if (!gst_vaapi_display_has_opengl (GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc))
+ && gl_upload_meta_idx > -1) {
+ gst_caps_remove_structure (caps, gl_upload_meta_idx);
+ }
+
cleanup:
return caps;
}