From: Nicolas Dufresne Date: Wed, 4 Dec 2013 21:49:13 +0000 (-0500) Subject: v4l2object: Move code block where it belongs X-Git-Tag: 1.19.3~509^2~4948 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2c32ec99750ca6e2a0bce3e1153d772588ca8aa;p=platform%2Fupstream%2Fgstreamer.git v4l2object: Move code block where it belongs https://bugzilla.gnome.org/show_bug.cgi?id=720568 --- diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 1181b61..08fca5d 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2558,12 +2558,6 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps) } if (V4L2_TYPE_IS_MULTIPLANAR (v4l2object->type)) { - /* even in v4l2 multiplanar mode we can work in contiguous mode - * if the device supports it */ - gint n_v4l_planes = - v4l2object->prefered_non_contiguous ? GST_VIDEO_INFO_N_PLANES (&info) : - 1; - GST_DEBUG_OBJECT (v4l2object->element, "Got format to %dx%d, format " "%" GST_FOURCC_FORMAT " colorspace %d, nb planes %d", format.fmt.pix_mp.width, format.fmt.pix_mp.height, @@ -2575,6 +2569,15 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps) format.fmt.pix_mp.height != height || format.fmt.pix_mp.pixelformat != pixelformat || format.fmt.pix_mp.field != field) { + /* even in v4l2 multiplanar mode we can work in contiguous mode + * if the device supports it */ + gint n_v4l_planes; + + if (v4l2object->prefered_non_contiguous) + n_v4l_planes = GST_VIDEO_INFO_N_PLANES (&info); + else + n_v4l_planes = 1; + /* something different, set the format */ GST_DEBUG_OBJECT (v4l2object->element, "Setting format to %dx%d, format " "%" GST_FOURCC_FORMAT, width, height, GST_FOURCC_ARGS (pixelformat));