va: jpegdec: Do not change the DMA template src caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4044>
This commit is contained in:
He Junyan 2023-06-16 20:12:32 +08:00 committed by GStreamer Marge Bot
parent 72e4bcf4df
commit 64d821af24

View file

@ -569,9 +569,6 @@ _fixup_src_caps (GstVaDisplay * display, GstCaps * caps)
} }
gst_structure_set_value (s, "format", &out); gst_structure_set_value (s, "format", &out);
g_value_unset (&out); g_value_unset (&out);
} else if (gst_caps_features_contains (f, GST_CAPS_FEATURE_MEMORY_DMABUF)) {
/* dmabuf exportation only handles NV12 */
gst_structure_set (s, "format", G_TYPE_STRING, "NV12", NULL);
} }
} }
@ -579,6 +576,7 @@ _fixup_src_caps (GstVaDisplay * display, GstCaps * caps)
} else if (GST_VA_DISPLAY_IS_IMPLEMENTATION (display, INTEL_I965)) { } else if (GST_VA_DISPLAY_IS_IMPLEMENTATION (display, INTEL_I965)) {
GstCaps *ret; GstCaps *ret;
GstStructure *s; GstStructure *s;
GstCapsFeatures *f;
guint i, len; guint i, len;
ret = gst_caps_copy (caps); ret = gst_caps_copy (caps);
@ -586,6 +584,12 @@ _fixup_src_caps (GstVaDisplay * display, GstCaps * caps)
len = gst_caps_get_size (ret); len = gst_caps_get_size (ret);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
s = gst_caps_get_structure (ret, i); s = gst_caps_get_structure (ret, i);
f = gst_caps_get_features (ret, i);
/* DMA kind formats have modifiers, we should not change */
if (gst_caps_features_contains (f, GST_CAPS_FEATURE_MEMORY_DMABUF))
continue;
/* only NV12 works in this nigthmare */ /* only NV12 works in this nigthmare */
gst_structure_set (s, "format", G_TYPE_STRING, "NV12", NULL); gst_structure_set (s, "format", G_TYPE_STRING, "NV12", NULL);
} }