mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
v4l2: handle unsupported formats
This commit is contained in:
parent
87d9a57aba
commit
44fa0b9cab
2 changed files with 21 additions and 1 deletions
|
@ -1376,6 +1376,7 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
|
|||
GstStructure *structure;
|
||||
guint32 fourcc;
|
||||
const gchar *mimetype;
|
||||
struct v4l2_fmtdesc *fmt;
|
||||
|
||||
/* default unknown values */
|
||||
fourcc = 0;
|
||||
|
@ -1503,7 +1504,11 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
|
|||
if (fourcc == 0)
|
||||
goto unhandled_format;
|
||||
|
||||
*format = gst_v4l2_object_get_format_from_fourcc (v4l2object, fourcc);
|
||||
fmt = gst_v4l2_object_get_format_from_fourcc (v4l2object, fourcc);
|
||||
if (fmt == NULL)
|
||||
goto unsupported_format;
|
||||
|
||||
*format = fmt;
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
@ -1533,6 +1538,11 @@ unhandled_format:
|
|||
GST_DEBUG_OBJECT (v4l2object, "unhandled format");
|
||||
return FALSE;
|
||||
}
|
||||
unsupported_format:
|
||||
{
|
||||
GST_DEBUG_OBJECT (v4l2object, "unsupported format");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -747,9 +747,19 @@ gst_v4l2sink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
|
|||
|
||||
GST_DEBUG_OBJECT (v4l2sink, "render buffer: %p", buf);
|
||||
|
||||
if (G_UNLIKELY (obj->pool == NULL))
|
||||
goto not_negotiated;
|
||||
|
||||
ret = gst_v4l2_buffer_pool_process (obj->pool, buf);
|
||||
|
||||
return ret;
|
||||
|
||||
/* ERRORS */
|
||||
not_negotiated:
|
||||
{
|
||||
GST_ERROR_OBJECT (bsink, "not negotiated");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_XVIDEO
|
||||
|
|
Loading…
Reference in a new issue