Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32 lines
1.3 KiB
ReStructuredText
32 lines
1.3 KiB
ReStructuredText
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
|
|
.. c:namespace:: V4L
|
|
|
|
.. _app-pri:
|
|
|
|
********************
|
|
Application Priority
|
|
********************
|
|
|
|
When multiple applications share a device it may be desirable to assign
|
|
them different priorities. Contrary to the traditional "rm -rf /" school
|
|
of thought, a video recording application could for example block other
|
|
applications from changing video controls or switching the current TV
|
|
channel. Another objective is to permit low priority applications
|
|
working in background, which can be preempted by user controlled
|
|
applications and automatically regain control of the device at a later
|
|
time.
|
|
|
|
Since these features cannot be implemented entirely in user space V4L2
|
|
defines the :ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` and
|
|
:ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctls to request and
|
|
query the access priority associate with a file descriptor. Opening a
|
|
device assigns a medium priority, compatible with earlier versions of
|
|
V4L2 and drivers not supporting these ioctls. Applications requiring a
|
|
different priority will usually call :ref:`VIDIOC_S_PRIORITY
|
|
<VIDIOC_G_PRIORITY>` after verifying the device with the
|
|
:ref:`VIDIOC_QUERYCAP` ioctl.
|
|
|
|
Ioctls changing driver properties, such as
|
|
:ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>`, return an ``EBUSY`` error code
|
|
after another application obtained higher priority.
|