v4l2: rename a variable

Rename the size variable to sizeimage and fill it with the size that has been
given to use by the v4l2 driver instead of making something up..
This commit is contained in:
Wim Taymans 2011-07-26 16:15:05 +02:00
parent e43ab9f2cd
commit 8c4241427a
3 changed files with 8 additions and 6 deletions

View file

@ -2260,9 +2260,11 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps)
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,

View file

@ -118,7 +118,7 @@ struct _GstV4l2Object {
GstVideoInfo info;
guint32 bytesperline;
guint size;
guint32 sizeimage;
GstClockTime duration;
/* wanted mode */

View file

@ -562,7 +562,7 @@ gst_v4l2src_setup_allocation (GstBaseSrc * bsrc, GstQuery * query)
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 */
@ -570,14 +570,14 @@ gst_v4l2src_setup_allocation (GstBaseSrc * bsrc, GstQuery * query)
/* 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;