v4l2: copy and set the actual size of the content
authorMichael Olbrich <m.olbrich@pengutronix.de>
Tue, 14 May 2013 10:03:03 +0000 (12:03 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 14 May 2013 10:57:14 +0000 (12:57 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=700282

sys/v4l2/gstv4l2object.c

index 054505d..65d17c4 100644 (file)
@@ -2551,9 +2551,9 @@ gst_v4l2_object_copy (GstV4l2Object * v4l2object, GstBuffer * dest,
 
     GST_DEBUG_OBJECT (v4l2object->element, "copy raw bytes");
     gst_buffer_map (src, &map, GST_MAP_READ);
-    gst_buffer_fill (dest, 0, map.data, map.size);
+    gst_buffer_fill (dest, 0, map.data, gst_buffer_get_size (src));
     gst_buffer_unmap (src, &map);
-    gst_buffer_resize (dest, 0, map.size);
+    gst_buffer_resize (dest, 0, gst_buffer_get_size (src));
   }
   GST_CAT_LOG_OBJECT (GST_CAT_PERFORMANCE, v4l2object->element,
       "slow copy into buffer %p", dest);