GstStructure *structure;
guint32 fourcc;
const gchar *mimetype;
+ struct v4l2_fmtdesc *fmt;
/* default unknown values */
fourcc = 0;
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;
GST_DEBUG_OBJECT (v4l2object, "unhandled format");
return FALSE;
}
+unsupported_format:
+ {
+ GST_DEBUG_OBJECT (v4l2object, "unsupported format");
+ return FALSE;
+ }
}
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