v4l2: always generate video info from caps

In the past gst_video_info_from_caps() only video/x-raw. Now it also
supports other video/* and image/* formats.
With this patch the format won't be GST_VIDEO_FORMAT_UNKOWN and
gst_v4l2_buffer_pool_set_config() handles strides correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=699570
This commit is contained in:
Michael Olbrich 2013-05-03 12:46:37 +02:00 committed by Sebastian Dröge
parent 1e777ede92
commit 53da901cc9

View file

@ -1423,11 +1423,10 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
mimetype = gst_structure_get_name (structure);
if (g_str_equal (mimetype, "video/x-raw")) {
/* raw caps, parse into video info */
if (!gst_video_info_from_caps (info, caps))
goto invalid_format;
if (!gst_video_info_from_caps (info, caps))
goto invalid_format;
if (g_str_equal (mimetype, "video/x-raw")) {
switch (GST_VIDEO_INFO_FORMAT (info)) {
case GST_VIDEO_FORMAT_I420:
fourcc = V4L2_PIX_FMT_YUV420;
@ -1491,9 +1490,6 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
} else {
gboolean dimensions = TRUE;
/* no video caps, construct videoinfo ourselves */
gst_video_info_init (info);
if (g_str_equal (mimetype, "video/mpegts")) {
fourcc = V4L2_PIX_FMT_MPEG;
dimensions = FALSE;