mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-05-18 00:12:46 +00:00
Merge branch 'issue3464' into 'main'
v4l2codecs: decoder: Reorder caps to prefer DMA_DRM ones Closes #3464 See merge request gstreamer/gstreamer!6645
This commit is contained in:
commit
e7974ebceb
|
@ -463,6 +463,20 @@ gst_v4l2_decoder_probe_caps_for_format (GstV4l2Decoder * self,
|
|||
return caps;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
filter_only_dmabuf_caps (GstCapsFeatures * features,
|
||||
GstStructure * structure, gpointer user_data)
|
||||
{
|
||||
return gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_DMABUF);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
filter_non_dmabuf_caps (GstCapsFeatures * features,
|
||||
GstStructure * structure, gpointer user_data)
|
||||
{
|
||||
return !gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_DMABUF);
|
||||
}
|
||||
|
||||
GstCaps *
|
||||
gst_v4l2_decoder_enum_src_formats (GstV4l2Decoder * self,
|
||||
GstStaticCaps * static_filter)
|
||||
|
@ -510,6 +524,11 @@ gst_v4l2_decoder_enum_src_formats (GstV4l2Decoder * self,
|
|||
gst_caps_unref (tmp);
|
||||
gst_caps_unref (filter);
|
||||
|
||||
tmp = gst_caps_copy (caps);
|
||||
gst_caps_filter_and_map_in_place (caps, filter_only_dmabuf_caps, NULL);
|
||||
gst_caps_filter_and_map_in_place (tmp, filter_non_dmabuf_caps, NULL);
|
||||
gst_caps_append (caps, tmp);
|
||||
|
||||
GST_DEBUG_OBJECT (self, "Probed caps: %" GST_PTR_FORMAT, caps);
|
||||
|
||||
return caps;
|
||||
|
|
Loading…
Reference in a new issue