mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[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 <[email protected]>
Signed-off-by: Kamil Debski <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
06e7a9b638
commit
f61bf13b6a
2 changed files with 35 additions and 6 deletions
|
|
@ -337,6 +337,7 @@ struct v4l2_fh;
|
|||
* @io_modes: supported io methods (see vb2_io_modes enum)
|
||||
* @fileio_read_once: report EOF after reading the first buffer
|
||||
* @fileio_write_immediately: queue buffer after each write() call
|
||||
* @allow_zero_bytesused: allow bytesused == 0 to be passed to the driver
|
||||
* @lock: pointer to a mutex that protects the vb2_queue struct. The
|
||||
* driver can set this to a mutex to let the v4l2 core serialize
|
||||
* the queuing ioctls. If the driver wants to handle locking
|
||||
|
|
@ -388,6 +389,7 @@ struct vb2_queue {
|
|||
unsigned int io_modes;
|
||||
unsigned fileio_read_once:1;
|
||||
unsigned fileio_write_immediately:1;
|
||||
unsigned allow_zero_bytesused:1;
|
||||
|
||||
struct mutex *lock;
|
||||
struct v4l2_fh *owner;
|
||||
|
|
|
|||
Loading…
Reference in a new issue