1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Application Priority</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="common.html" title="Chapter&#160;1.&#160;Common API Elements"><link rel="prev" href="querycap.html" title="Querying Capabilities"><link rel="next" href="video.html" title="Video Inputs and Outputs"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Application Priority</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="querycap.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;1.&#160;Common API Elements</th><td width="20%" align="right">&#160;<a accesskey="n" href="video.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="app-pri"></a>Application Priority</h2></div></div></div><p>When multiple applications share a device it may be
2desirable to assign them different priorities. Contrary to the
3traditional "rm -rf /" school of thought a video recording application
4could for example block other applications from changing video
5controls or switching the current TV channel. Another objective is to
6permit low priority applications working in background, which can be
7preempted by user controlled applications and automatically regain
8control of the device at a later time.</p><p>Since these features cannot be implemented entirely in user
9space V4L2 defines the <a class="link" href="vidioc-g-priority.html" title="ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY"><code class="constant">VIDIOC_G_PRIORITY</code></a> and <a class="link" href="vidioc-g-priority.html" title="ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY"><code class="constant">VIDIOC_S_PRIORITY</code></a>
10ioctls to request and query the access priority associate with a file
11descriptor. Opening a device assigns a medium priority, compatible
12with earlier versions of V4L2 and drivers not supporting these ioctls.
13Applications requiring a different priority will usually call
14<code class="constant">VIDIOC_S_PRIORITY</code> after verifying the device with
15the <a class="link" href="vidioc-querycap.html" title="ioctl VIDIOC_QUERYCAP"><code class="constant">VIDIOC_QUERYCAP</code></a> ioctl.</p><p>Ioctls changing driver properties, such as <a class="link" href="vidioc-g-input.html" title="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"><code class="constant">VIDIOC_S_INPUT</code></a>,
16return an <span class="errorcode">EBUSY</span> error code after another application obtained higher priority.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="querycap.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="common.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="video.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Querying Capabilities&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Video Inputs and Outputs</td></tr></table></div></body></html>
17