Skip to content

Commit

Permalink
media: v4l2: Add ignore_streaming flag
Browse files Browse the repository at this point in the history
Add a new flag to the `struct v4l2_m2m_dev` to toggle whether a queue
must be streaming in order to allow queuing jobs to the ready queue.
Currently, both queues (CAPTURE & OUTPUT) must be streaming in order to
allow adding new jobs. This behavior limits the usability of M2M for
some drivers, as these have to be able, to perform analysis of the
sequence to ensure, that userspace prepares the CAPTURE queue correctly.

Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
  • Loading branch information
Sebastian Fricke authored and Hans Verkuil committed Nov 16, 2023
1 parent 7ad7d7f commit 103d15b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/media/v4l2-mem2mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ struct v4l2_m2m_queue_ctx {
* @last_src_buf: indicate the last source buffer for draining
* @next_buf_last: next capture queud buffer will be tagged as last
* @has_stopped: indicate the device has been stopped
* @ignore_cap_streaming: If true, job_ready can be called even if the CAPTURE
* queue is not streaming. This allows firmware to
* analyze the bitstream header which arrives on the
* OUTPUT queue. The driver must implement the job_ready
* callback correctly to make sure that the requirements
* for actual decoding are met.
* @m2m_dev: opaque pointer to the internal data to handle M2M context
* @cap_q_ctx: Capture (output to memory) queue context
* @out_q_ctx: Output (input from memory) queue context
Expand All @@ -106,6 +112,7 @@ struct v4l2_m2m_ctx {
struct vb2_v4l2_buffer *last_src_buf;
bool next_buf_last;
bool has_stopped;
bool ignore_cap_streaming;

/* internal use only */
struct v4l2_m2m_dev *m2m_dev;
Expand Down

0 comments on commit 103d15b

Please sign in to comment.