162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
262306a36Sopenharmony_ci.. c:namespace:: V4L
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci.. _VIDIOC_G_PRIORITY:
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci******************************************
762306a36Sopenharmony_ciioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY
862306a36Sopenharmony_ci******************************************
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciName
1162306a36Sopenharmony_ci====
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciVIDIOC_G_PRIORITY - VIDIOC_S_PRIORITY - Query or request the access priority associated with a file descriptor
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciSynopsis
1662306a36Sopenharmony_ci========
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci.. c:macro:: VIDIOC_G_PRIORITY
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_G_PRIORITY, enum v4l2_priority *argp)``
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci.. c:macro:: VIDIOC_S_PRIORITY
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_S_PRIORITY, const enum v4l2_priority *argp)``
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciArguments
2762306a36Sopenharmony_ci=========
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci``fd``
3062306a36Sopenharmony_ci    File descriptor returned by :c:func:`open()`.
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci``argp``
3362306a36Sopenharmony_ci    Pointer to an enum :c:type:`v4l2_priority` type.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciDescription
3662306a36Sopenharmony_ci===========
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ciTo query the current access priority applications call the
3962306a36Sopenharmony_ci:ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` ioctl with a pointer to an enum v4l2_priority
4062306a36Sopenharmony_civariable where the driver stores the current priority.
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciTo request an access priority applications store the desired priority in
4362306a36Sopenharmony_cian enum v4l2_priority variable and call :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctl
4462306a36Sopenharmony_ciwith a pointer to this variable.
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci.. c:type:: v4l2_priority
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci.. flat-table:: enum v4l2_priority
5162306a36Sopenharmony_ci    :header-rows:  0
5262306a36Sopenharmony_ci    :stub-columns: 0
5362306a36Sopenharmony_ci    :widths:       3 1 4
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci    * - ``V4L2_PRIORITY_UNSET``
5662306a36Sopenharmony_ci      - 0
5762306a36Sopenharmony_ci      -
5862306a36Sopenharmony_ci    * - ``V4L2_PRIORITY_BACKGROUND``
5962306a36Sopenharmony_ci      - 1
6062306a36Sopenharmony_ci      - Lowest priority, usually applications running in background, for
6162306a36Sopenharmony_ci	example monitoring VBI transmissions. A proxy application running
6262306a36Sopenharmony_ci	in user space will be necessary if multiple applications want to
6362306a36Sopenharmony_ci	read from a device at this priority.
6462306a36Sopenharmony_ci    * - ``V4L2_PRIORITY_INTERACTIVE``
6562306a36Sopenharmony_ci      - 2
6662306a36Sopenharmony_ci      -
6762306a36Sopenharmony_ci    * - ``V4L2_PRIORITY_DEFAULT``
6862306a36Sopenharmony_ci      - 2
6962306a36Sopenharmony_ci      - Medium priority, usually applications started and interactively
7062306a36Sopenharmony_ci	controlled by the user. For example TV viewers, Teletext browsers,
7162306a36Sopenharmony_ci	or just "panel" applications to change the channel or video
7262306a36Sopenharmony_ci	controls. This is the default priority unless an application
7362306a36Sopenharmony_ci	requests another.
7462306a36Sopenharmony_ci    * - ``V4L2_PRIORITY_RECORD``
7562306a36Sopenharmony_ci      - 3
7662306a36Sopenharmony_ci      - Highest priority. Only one file descriptor can have this priority,
7762306a36Sopenharmony_ci	it blocks any other fd from changing device properties. Usually
7862306a36Sopenharmony_ci	applications which must not be interrupted, like video recording.
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ciReturn Value
8162306a36Sopenharmony_ci============
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set
8462306a36Sopenharmony_ciappropriately. The generic error codes are described at the
8562306a36Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter.
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ciEINVAL
8862306a36Sopenharmony_ci    The requested priority value is invalid.
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ciEBUSY
9162306a36Sopenharmony_ci    Another application already requested higher priority.
92