if (format.fmt.pix.pixelformat != pixelformat)
goto invalid_pixelformat;
}
+
+ /* figure out the frame layout */
v4l2object->bytesperline = format.fmt.pix.bytesperline;
- /* FIXME, size for only one plane */
- v4l2object->size = v4l2object->bytesperline * height;
+ v4l2object->sizeimage = format.fmt.pix.sizeimage;
+
/* Is there a reason we require the caller to always specify a framerate? */
GST_DEBUG_OBJECT (v4l2object->element, "Desired framerate: %u/%u", fps_n,
GST_DEBUG_OBJECT (src,
"read/write mode: no downstream pool, using our own");
pool = obj->pool;
- size = obj->size;
+ size = obj->sizeimage;
} else {
/* in READ/WRITE mode, prefer a downstream pool because our own pool
* doesn't help much, we have to write to it as well */
/* use the bigest size, when we use our own pool we can't really do any
* other size than what the hardware gives us but for downstream pools
* we can try */
- size = MAX (size, obj->size);
+ size = MAX (size, obj->sizeimage);
}
break;
case GST_V4L2_IO_MMAP:
case GST_V4L2_IO_USERPTR:
/* in streaming mode, prefer our own pool */
pool = obj->pool;
- size = obj->size;
+ size = obj->sizeimage;
GST_DEBUG_OBJECT (src,
"streaming mode: using our own pool %" GST_PTR_FORMAT, pool);
break;