1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> 2<HTML 3><HEAD 4><TITLE 5>Application Priority</TITLE 6><META 7NAME="GENERATOR" 8CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK 9REL="HOME" 10TITLE="Video for Linux Two API Specification" 11HREF="book1.htm"><LINK 12REL="UP" 13TITLE="Common API Elements" 14HREF="c174.htm"><LINK 15REL="PREVIOUS" 16TITLE="Querying Capabilities" 17HREF="x282.htm"><LINK 18REL="NEXT" 19TITLE="Video Inputs and Outputs" 20HREF="x309.htm"></HEAD 21><BODY 22CLASS="SECTION" 23BGCOLOR="#FFFFFF" 24TEXT="#000000" 25LINK="#0000FF" 26VLINK="#840084" 27ALINK="#0000FF" 28><DIV 29CLASS="NAVHEADER" 30><TABLE 31SUMMARY="Header navigation table" 32WIDTH="100%" 33BORDER="0" 34CELLPADDING="0" 35CELLSPACING="0" 36><TR 37><TH 38COLSPAN="3" 39ALIGN="center" 40>Video for Linux Two API Specification: Revision 0.24</TH 41></TR 42><TR 43><TD 44WIDTH="10%" 45ALIGN="left" 46VALIGN="bottom" 47><A 48HREF="x282.htm" 49ACCESSKEY="P" 50>Prev</A 51></TD 52><TD 53WIDTH="80%" 54ALIGN="center" 55VALIGN="bottom" 56>Chapter 1. Common API Elements</TD 57><TD 58WIDTH="10%" 59ALIGN="right" 60VALIGN="bottom" 61><A 62HREF="x309.htm" 63ACCESSKEY="N" 64>Next</A 65></TD 66></TR 67></TABLE 68><HR 69ALIGN="LEFT" 70WIDTH="100%"></DIV 71><DIV 72CLASS="SECTION" 73><H1 74CLASS="SECTION" 75><A 76NAME="APP-PRI" 77>1.3. Application Priority</A 78></H1 79><P 80>When multiple applications share a device it may be 81desirable to assign them different priorities. Contrary to the 82traditional "rm -rf /" school of thought a video recording application 83could for example block other applications from changing video 84controls or switching the current TV channel. Another objective is to 85permit low priority applications working in background, which can be 86preempted by user controlled applications and automatically regain 87control of the device at a later time.</P 88><P 89>Since these features cannot be implemented entirely in user 90space V4L2 defines the <A 91HREF="r11946.htm" 92><CODE 93CLASS="CONSTANT" 94>VIDIOC_G_PRIORITY</CODE 95></A 96> and <A 97HREF="r11946.htm" 98><CODE 99CLASS="CONSTANT" 100>VIDIOC_S_PRIORITY</CODE 101></A 102> 103ioctls to request and query the access priority associate with a file 104descriptor. Opening a device assigns a medium priority, compatible 105with earlier versions of V4L2 and drivers not supporting these ioctls. 106Applications requiring a different priority will usually call 107<CODE 108CLASS="CONSTANT" 109>VIDIOC_S_PRIORITY</CODE 110> after verifying the device with 111the <A 112HREF="r13105.htm" 113><CODE 114CLASS="CONSTANT" 115>VIDIOC_QUERYCAP</CODE 116></A 117> ioctl.</P 118><P 119>Ioctls changing driver properties, such as <A 120HREF="r11217.htm" 121><CODE 122CLASS="CONSTANT" 123>VIDIOC_S_INPUT</CODE 124></A 125>, 126return an <SPAN 127CLASS="ERRORCODE" 128>EBUSY</SPAN 129> error code after another application obtained higher priority. 130An event mechanism to notify applications about asynchronous property 131changes has been proposed but not added yet.</P 132></DIV 133><DIV 134CLASS="NAVFOOTER" 135><HR 136ALIGN="LEFT" 137WIDTH="100%"><TABLE 138SUMMARY="Footer navigation table" 139WIDTH="100%" 140BORDER="0" 141CELLPADDING="0" 142CELLSPACING="0" 143><TR 144><TD 145WIDTH="33%" 146ALIGN="left" 147VALIGN="top" 148><A 149HREF="x282.htm" 150ACCESSKEY="P" 151>Prev</A 152></TD 153><TD 154WIDTH="34%" 155ALIGN="center" 156VALIGN="top" 157><A 158HREF="book1.htm" 159ACCESSKEY="H" 160>Home</A 161></TD 162><TD 163WIDTH="33%" 164ALIGN="right" 165VALIGN="top" 166><A 167HREF="x309.htm" 168ACCESSKEY="N" 169>Next</A 170></TD 171></TR 172><TR 173><TD 174WIDTH="33%" 175ALIGN="left" 176VALIGN="top" 177>Querying Capabilities</TD 178><TD 179WIDTH="34%" 180ALIGN="center" 181VALIGN="top" 182><A 183HREF="c174.htm" 184ACCESSKEY="U" 185>Up</A 186></TD 187><TD 188WIDTH="33%" 189ALIGN="right" 190VALIGN="top" 191>Video Inputs and Outputs</TD 192></TR 193></TABLE 194></DIV 195></BODY 196></HTML 197> 198