From 2f00119e3bad0d839fcb32667ddd60e6a3904916 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 14 Mar 2014 00:31:32 +0100 Subject: [PATCH] v4l2bufferpool: Use obj->n_v4l2_planes for correct number of planes Buffer pool was guessing wrongly the number of planes rather then reading the value from obj->n_v4l2_planes. This was causing format YU12 (I420) to fail upon check. --- sys/v4l2/gstv4l2bufferpool.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index f209345..f117030 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -428,13 +428,9 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config) if (!pool->add_videometa && GST_VIDEO_INFO_FORMAT (&obj->info) != GST_VIDEO_FORMAT_ENCODED) { - /* in non MPLANE mode, there is only one bytesperline field */ - gint nb_checked_planes = - V4L2_TYPE_IS_MULTIPLANAR (obj->type) ? GST_VIDEO_INFO_N_PLANES (&obj-> - info) : 1; gint stride = 0; gint i = 0; - for (i = 0; i < nb_checked_planes; i++) { + for (i = 0; i < obj->n_v4l2_planes; i++) { /* we don't have video metadata, and we are dealing with raw video, * see if the strides are compatible */ stride = GST_VIDEO_INFO_PLANE_STRIDE (&obj->info, i); -- 2.7.4