From 53da901cc9814ba6581b113ce9e82db25f297147 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Fri, 3 May 2013 12:46:37 +0200 Subject: [PATCH] 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 --- sys/v4l2/gstv4l2object.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index dd9f79b4a0..054505dbb3 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -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;