v4l2: rename a variable
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 26 Jul 2011 14:15:05 +0000 (16:15 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 26 Jul 2011 14:15:05 +0000 (16:15 +0200)
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..

sys/v4l2/gstv4l2object.c
sys/v4l2/gstv4l2object.h
sys/v4l2/gstv4l2src.c

index 8dd9cc2..f84f552 100644 (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,
index 8689e8f..5120a93 100644 (file)
@@ -118,7 +118,7 @@ struct _GstV4l2Object {
   GstVideoInfo info;
 
   guint32 bytesperline;
-  guint size;
+  guint32 sizeimage;
   GstClockTime duration;
 
   /* wanted mode */
index a9511ab..6e66a40 100644 (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;