mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
v4l2: object: Adjust DMABuf negotiation base on io-mode
If the io-mode is forced by user to MMAP, USERPTR or RW, don't try and negotiated DMABuf caps feature. This would otherwise fail later. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
This commit is contained in:
parent
3ec1feb88f
commit
3ee04883ee
1 changed files with 13 additions and 1 deletions
|
@ -5190,6 +5190,7 @@ gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object, GstCaps * filter)
|
|||
GSList *walk;
|
||||
GSList *formats;
|
||||
guint32 fourcc = 0;
|
||||
gboolean enable_dmabuf = FALSE;
|
||||
|
||||
if (v4l2object->fmtdesc)
|
||||
fourcc = GST_V4L2_PIXELFORMAT (v4l2object);
|
||||
|
@ -5197,6 +5198,17 @@ gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object, GstCaps * filter)
|
|||
gst_v4l2_object_clear_format_list (v4l2object);
|
||||
formats = gst_v4l2_object_get_format_list (v4l2object);
|
||||
|
||||
switch (v4l2object->req_mode) {
|
||||
case GST_V4L2_IO_AUTO:
|
||||
case GST_V4L2_IO_DMABUF:
|
||||
case GST_V4L2_IO_DMABUF_IMPORT:
|
||||
enable_dmabuf = TRUE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Recover the fmtdesc, it may no longer exist, in which case it will be set
|
||||
* to null */
|
||||
if (fourcc)
|
||||
|
@ -5250,7 +5262,7 @@ gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object, GstCaps * filter)
|
|||
|
||||
sysmem_tmpl =
|
||||
gst_v4l2_object_v4l2fourcc_to_bare_struct (format->pixelformat,
|
||||
&dmabuf_tmpl);
|
||||
enable_dmabuf ? &dmabuf_tmpl : NULL);
|
||||
|
||||
if (!sysmem_tmpl && !dmabuf_tmpl) {
|
||||
GST_DEBUG_OBJECT (v4l2object->dbg_obj,
|
||||
|
|
Loading…
Reference in a new issue