OSDN Git Service

vb2: add (un)prepare_streaming queue ops
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 22 Jun 2022 09:31:44 +0000 (11:31 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 18 Nov 2022 14:48:17 +0000 (15:48 +0100)
commit36c6f1fb2ef769c36c417c8c1106439704eeb8c0
treecb453d8935f568c6a98d5f8615436bd7c3342ce6
parent73937efbbe8de9c2abf2259ec2f2505e53632f19
vb2: add (un)prepare_streaming queue ops

When userspace called VIDIOC_STREAMON, then you want to claim any streaming
resources needed and validate the video pipeline. Waiting for
start_streaming to be called is too late, since that can be postponed
until the required minimum of buffers is queued.

So add a prepare_streaming op (optional) that can be used for that
purpose, and a matching unprepare_streaming op (optional) that can
release any claimed resources. The unprepare_streaming op is called
when VIDIOC_STREAMOFF is called and q->streaming is 1, or when the
filehandle is closed while q->streaming is 1.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/common/videobuf2/videobuf2-core.c
include/media/videobuf2-core.h