summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-01-02 19:29:04 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-02-22 03:53:30 -0500
commit0b83e4ceaf7d9a5cc655ff96bd288b61ef106347 (patch)
tree8315e94b86b4e414ffac7598826be8a42a2c49e9 /sys
parentb460f18f1724431229c7ecb98737e9fc3fa7e4c9 (diff)
v4l2object: Update image size when extrapolating
Update the image size according the amount of data we are going to read/write. This workaround bugs in driver where the sizeimage provided by TRY/S_FMT represent the buffer length (maximum size) rather then the expected bytesused (buffer size). https://bugzilla.gnome.org/show_bug.cgi?id=775564
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2object.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 932512c2d..7686363bb 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -2963,6 +2963,13 @@ gst_v4l2_object_extrapolate_info (GstV4l2Object * v4l2object,
"stride %d, offset %" G_GSIZE_FORMAT, i, stride, info->stride[i],
info->offset[i]);
}
+
+ /* Update the image size according the amount of data we are going to
+ * read/write. This workaround bugs in driver where the sizeimage provided
+ * by TRY/S_FMT represent the buffer length (maximum size) rather then the expected
+ * bytesused (buffer size). */
+ if (offs < info->size)
+ info->size = offs;
}
static void