diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-01-02 19:29:04 -0500 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-02-22 03:55:01 -0500 |
commit | 38af12081e90cb9b7124b911d4efa2a6e5dc66b6 (patch) | |
tree | aa89f323b89ddbcb9746a069065a7fc8c7f26f28 | |
parent | 58c3b8861c00e68e0b39f3a1c2cd72b213aa97b3 (diff) | |
download | gstreamer-plugins-good-38af12081e90cb9b7124b911d4efa2a6e5dc66b6.tar.gz |
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
-rw-r--r-- | sys/v4l2/gstv4l2object.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 8923dd4c1..1e827b651 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 |