diff options
author | Kamil Debski <k.debski@samsung.com> | 2015-02-23 07:26:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-10 08:46:07 -0400 |
commit | f61bf13b6a07a93b9348e77808d369803f40b681 (patch) | |
tree | 44ab9d2d33ff1c70cc3d5798a70a913b342737e6 /include/media | |
parent | 06e7a9b638467fddf8f62ca9f07adc7754319461 (diff) |
[media] vb2: add allow_zero_bytesused flag to the vb2_queue struct
The vb2: fix bytesused == 0 handling (8a75ffb) patch changed the behavior
of __fill_vb2_buffer function, so that if bytesused is 0 it is set to the
size of the buffer. However, bytesused set to 0 is used by older codec
drivers as as indication used to mark the end of stream.
To keep backward compatibility, this patch adds a flag passed to the
vb2_queue_init function - allow_zero_bytesused. If the flag is set upon
initialization of the queue, the videobuf2 keeps the value of bytesused
intact in the OUTPUT queue and passes it to the driver.
Reported-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/videobuf2-core.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index e49dc6b0de81..a5790fd5d125 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -337,6 +337,7 @@ struct v4l2_fh; | |||
337 | * @io_modes: supported io methods (see vb2_io_modes enum) | 337 | * @io_modes: supported io methods (see vb2_io_modes enum) |
338 | * @fileio_read_once: report EOF after reading the first buffer | 338 | * @fileio_read_once: report EOF after reading the first buffer |
339 | * @fileio_write_immediately: queue buffer after each write() call | 339 | * @fileio_write_immediately: queue buffer after each write() call |
340 | * @allow_zero_bytesused: allow bytesused == 0 to be passed to the driver | ||
340 | * @lock: pointer to a mutex that protects the vb2_queue struct. The | 341 | * @lock: pointer to a mutex that protects the vb2_queue struct. The |
341 | * driver can set this to a mutex to let the v4l2 core serialize | 342 | * driver can set this to a mutex to let the v4l2 core serialize |
342 | * the queuing ioctls. If the driver wants to handle locking | 343 | * the queuing ioctls. If the driver wants to handle locking |
@@ -388,6 +389,7 @@ struct vb2_queue { | |||
388 | unsigned int io_modes; | 389 | unsigned int io_modes; |
389 | unsigned fileio_read_once:1; | 390 | unsigned fileio_read_once:1; |
390 | unsigned fileio_write_immediately:1; | 391 | unsigned fileio_write_immediately:1; |
392 | unsigned allow_zero_bytesused:1; | ||
391 | 393 | ||
392 | struct mutex *lock; | 394 | struct mutex *lock; |
393 | struct v4l2_fh *owner; | 395 | struct v4l2_fh *owner; |