if (!resuscitated) {
GST_LOG_OBJECT (pool->v4l2elem,
"buffer %p (data %p, len %u) not recovered, unmapping",
- buffer, GST_BUFFER_DATA (buffer), buffer->vbuffer.length);
+ buffer, GST_BUFFER_DATA (buffer), buffer->mmap_length);
gst_mini_object_unref (GST_MINI_OBJECT (pool));
- v4l2_munmap ((void *) GST_BUFFER_DATA (buffer), buffer->vbuffer.length);
+ v4l2_munmap ((void *) GST_BUFFER_DATA (buffer), buffer->mmap_length);
GST_MINI_OBJECT_CLASS (v4l2buffer_parent_class)->finalize (GST_MINI_OBJECT
(buffer));
GST_LOG_OBJECT (pool->v4l2elem, " length: %u", ret->vbuffer.length);
GST_LOG_OBJECT (pool->v4l2elem, " input: %u", ret->vbuffer.input);
+ ret->mmap_length = ret->vbuffer.length;
data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd,
ret->vbuffer.m.offset);
GstBuffer buffer;
struct v4l2_buffer vbuffer;
+ /* warning: the size of mmap buffer and
+ * the actual frame-buffer can be different. */
+ size_t mmap_length;
/* FIXME: have GstV4l2Src* instead, as this has GstV4l2BufferPool* */
/* FIXME: do we really want to fix this if GstV4l2Buffer/Pool is shared