Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 
0003 .. _app-pri:
0004 
0005 ********************
0006 Application Priority
0007 ********************
0008 
0009 When multiple applications share a device it may be desirable to assign
0010 them different priorities. Contrary to the traditional "rm -rf /" school
0011 of thought, a video recording application could for example block other
0012 applications from changing video controls or switching the current TV
0013 channel. Another objective is to permit low priority applications
0014 working in background, which can be preempted by user controlled
0015 applications and automatically regain control of the device at a later
0016 time.
0017 
0018 Since these features cannot be implemented entirely in user space V4L2
0019 defines the :ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` and
0020 :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctls to request and
0021 query the access priority associate with a file descriptor. Opening a
0022 device assigns a medium priority, compatible with earlier versions of
0023 V4L2 and drivers not supporting these ioctls. Applications requiring a
0024 different priority will usually call :ref:`VIDIOC_S_PRIORITY
0025 <VIDIOC_G_PRIORITY>` after verifying the device with the
0026 :ref:`VIDIOC_QUERYCAP` ioctl.
0027 
0028 Ioctls changing driver properties, such as
0029 :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>`, return an ``EBUSY`` error code
0030 after another application obtained higher priority.