Home | History | Annotate | Download | only in spec
      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 >ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</TITLE
      6 ><META
      7 NAME="GENERATOR"
      8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
      9 REL="HOME"
     10 TITLE="Video for Linux Two API Specification"
     11 HREF="book1.htm"><LINK
     12 REL="UP"
     13 TITLE="Function Reference"
     14 HREF="r7624.htm"><LINK
     15 REL="PREVIOUS"
     16 TITLE="ioctl VIDIOC_G_PARM, VIDIOC_S_PARM"
     17 HREF="r11680.htm"><LINK
     18 REL="NEXT"
     19 TITLE="ioctl VIDIOC_G_SLICED_VBI_CAP"
     20 HREF="r12051.htm"></HEAD
     21 ><BODY
     22 CLASS="REFENTRY"
     23 BGCOLOR="#FFFFFF"
     24 TEXT="#000000"
     25 LINK="#0000FF"
     26 VLINK="#840084"
     27 ALINK="#0000FF"
     28 ><DIV
     29 CLASS="NAVHEADER"
     30 ><TABLE
     31 SUMMARY="Header navigation table"
     32 WIDTH="100%"
     33 BORDER="0"
     34 CELLPADDING="0"
     35 CELLSPACING="0"
     36 ><TR
     37 ><TH
     38 COLSPAN="3"
     39 ALIGN="center"
     40 >Video for Linux Two API Specification: Revision 0.24</TH
     41 ></TR
     42 ><TR
     43 ><TD
     44 WIDTH="10%"
     45 ALIGN="left"
     46 VALIGN="bottom"
     47 ><A
     48 HREF="r11680.htm"
     49 ACCESSKEY="P"
     50 >Prev</A
     51 ></TD
     52 ><TD
     53 WIDTH="80%"
     54 ALIGN="center"
     55 VALIGN="bottom"
     56 ></TD
     57 ><TD
     58 WIDTH="10%"
     59 ALIGN="right"
     60 VALIGN="bottom"
     61 ><A
     62 HREF="r12051.htm"
     63 ACCESSKEY="N"
     64 >Next</A
     65 ></TD
     66 ></TR
     67 ></TABLE
     68 ><HR
     69 ALIGN="LEFT"
     70 WIDTH="100%"></DIV
     71 ><H1
     72 ><A
     73 NAME="VIDIOC-G-PRIORITY"
     74 ></A
     75 >ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</H1
     76 ><DIV
     77 CLASS="REFNAMEDIV"
     78 ><A
     79 NAME="AEN11950"
     80 ></A
     81 ><H2
     82 >Name</H2
     83 >VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY&nbsp;--&nbsp;Query or request the access priority associated with a
     84 file descriptor</DIV
     85 ><DIV
     86 CLASS="REFSYNOPSISDIV"
     87 ><A
     88 NAME="AEN11954"
     89 ></A
     90 ><H2
     91 >Synopsis</H2
     92 ><DIV
     93 CLASS="FUNCSYNOPSIS"
     94 ><P
     95 ></P
     96 ><A
     97 NAME="AEN11955"
     98 ></A
     99 ><P
    100 ><CODE
    101 ><CODE
    102 CLASS="FUNCDEF"
    103 >int ioctl</CODE
    104 >(int fd, int request, enum v4l2_priority *argp);</CODE
    105 ></P
    106 ><P
    107 ></P
    108 ></DIV
    109 ><DIV
    110 CLASS="FUNCSYNOPSIS"
    111 ><P
    112 ></P
    113 ><A
    114 NAME="AEN11965"
    115 ></A
    116 ><P
    117 ><CODE
    118 ><CODE
    119 CLASS="FUNCDEF"
    120 >int ioctl</CODE
    121 >(int fd, int request, const enum v4l2_priority *argp);</CODE
    122 ></P
    123 ><P
    124 ></P
    125 ></DIV
    126 ></DIV
    127 ><DIV
    128 CLASS="REFSECT1"
    129 ><A
    130 NAME="AEN11975"
    131 ></A
    132 ><H2
    133 >Arguments</H2
    134 ><P
    135 ></P
    136 ><DIV
    137 CLASS="VARIABLELIST"
    138 ><DL
    139 ><DT
    140 ><CODE
    141 CLASS="PARAMETER"
    142 >fd</CODE
    143 ></DT
    144 ><DD
    145 ><P
    146 >File descriptor returned by <A
    147 HREF="r14090.htm"
    148 ><CODE
    149 CLASS="FUNCTION"
    150 >open()</CODE
    151 ></A
    152 >.</P
    153 ></DD
    154 ><DT
    155 ><CODE
    156 CLASS="PARAMETER"
    157 >request</CODE
    158 ></DT
    159 ><DD
    160 ><P
    161 >VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY</P
    162 ></DD
    163 ><DT
    164 ><CODE
    165 CLASS="PARAMETER"
    166 >argp</CODE
    167 ></DT
    168 ><DD
    169 ><P
    170 >Pointer to an enum v4l2_priority type.</P
    171 ></DD
    172 ></DL
    173 ></DIV
    174 ></DIV
    175 ><DIV
    176 CLASS="REFSECT1"
    177 ><A
    178 NAME="AEN11995"
    179 ></A
    180 ><H2
    181 >Description</H2
    182 ><P
    183 >To query the current access priority
    184 applications call the <CODE
    185 CLASS="CONSTANT"
    186 >VIDIOC_G_PRIORITY</CODE
    187 > ioctl
    188 with a pointer to an enum v4l2_priority variable where the driver stores
    189 the current priority.</P
    190 ><P
    191 >To request an access priority applications store the
    192 desired priority in an enum v4l2_priority variable and call
    193 <CODE
    194 CLASS="CONSTANT"
    195 >VIDIOC_S_PRIORITY</CODE
    196 > ioctl with a pointer to this
    197 variable.</P
    198 ><DIV
    199 CLASS="TABLE"
    200 ><A
    201 NAME="V4L2-PRIORITY"
    202 ></A
    203 ><P
    204 ><B
    205 >Table 1. enum v4l2_priority</B
    206 ></P
    207 ><TABLE
    208 BORDER="0"
    209 FRAME="void"
    210 WIDTH="100%"
    211 CLASS="CALSTABLE"
    212 ><COL
    213 WIDTH="38%"
    214 TITLE="C1"><COL
    215 WIDTH="12%"
    216 TITLE="C2"><COL
    217 WIDTH="50%"
    218 TITLE="C3"><TBODY
    219 VALIGN="TOP"
    220 ><TR
    221 ><TD
    222 ><CODE
    223 CLASS="CONSTANT"
    224 >V4L2_PRIORITY_UNSET</CODE
    225 ></TD
    226 ><TD
    227 >0</TD
    228 ><TD
    229 >&nbsp;</TD
    230 ></TR
    231 ><TR
    232 ><TD
    233 ><CODE
    234 CLASS="CONSTANT"
    235 >V4L2_PRIORITY_BACKGROUND</CODE
    236 ></TD
    237 ><TD
    238 >1</TD
    239 ><TD
    240 >Lowest priority, usually applications running in
    241 background, for example monitoring VBI transmissions. A proxy
    242 application running in user space will be necessary if multiple
    243 applications want to read from a device at this priority.</TD
    244 ></TR
    245 ><TR
    246 ><TD
    247 ><CODE
    248 CLASS="CONSTANT"
    249 >V4L2_PRIORITY_INTERACTIVE</CODE
    250 ></TD
    251 ><TD
    252 >2</TD
    253 ><TD
    254 >&nbsp;</TD
    255 ></TR
    256 ><TR
    257 ><TD
    258 ><CODE
    259 CLASS="CONSTANT"
    260 >V4L2_PRIORITY_DEFAULT</CODE
    261 ></TD
    262 ><TD
    263 >2</TD
    264 ><TD
    265 >Medium priority, usually applications started and
    266 interactively controlled by the user. For example TV viewers, Teletext
    267 browsers, or just "panel" applications to change the channel or video
    268 controls. This is the default priority unless an application requests
    269 another.</TD
    270 ></TR
    271 ><TR
    272 ><TD
    273 ><CODE
    274 CLASS="CONSTANT"
    275 >V4L2_PRIORITY_RECORD</CODE
    276 ></TD
    277 ><TD
    278 >3</TD
    279 ><TD
    280 >Highest priority. Only one file descriptor can have
    281 this priority, it blocks any other fd from changing device properties.
    282 Usually applications which must not be interrupted, like video
    283 recording.</TD
    284 ></TR
    285 ></TBODY
    286 ></TABLE
    287 ></DIV
    288 ></DIV
    289 ><DIV
    290 CLASS="REFSECT1"
    291 ><A
    292 NAME="AEN12034"
    293 ></A
    294 ><H2
    295 >Return Value</H2
    296 ><P
    297 >On success <SPAN
    298 CLASS="RETURNVALUE"
    299 >0</SPAN
    300 > is returned, on error <SPAN
    301 CLASS="RETURNVALUE"
    302 >-1</SPAN
    303 > and the <CODE
    304 CLASS="VARNAME"
    305 >errno</CODE
    306 > variable is set appropriately:</P
    307 ><P
    308 ></P
    309 ><DIV
    310 CLASS="VARIABLELIST"
    311 ><DL
    312 ><DT
    313 ><SPAN
    314 CLASS="ERRORCODE"
    315 >EINVAL</SPAN
    316 ></DT
    317 ><DD
    318 ><P
    319 >The requested priority value is invalid, or the
    320 driver does not support access priorities.</P
    321 ></DD
    322 ><DT
    323 ><SPAN
    324 CLASS="ERRORCODE"
    325 >EBUSY</SPAN
    326 ></DT
    327 ><DD
    328 ><P
    329 >Another application already requested higher
    330 priority.</P
    331 ></DD
    332 ></DL
    333 ></DIV
    334 ></DIV
    335 ><DIV
    336 CLASS="NAVFOOTER"
    337 ><HR
    338 ALIGN="LEFT"
    339 WIDTH="100%"><TABLE
    340 SUMMARY="Footer navigation table"
    341 WIDTH="100%"
    342 BORDER="0"
    343 CELLPADDING="0"
    344 CELLSPACING="0"
    345 ><TR
    346 ><TD
    347 WIDTH="33%"
    348 ALIGN="left"
    349 VALIGN="top"
    350 ><A
    351 HREF="r11680.htm"
    352 ACCESSKEY="P"
    353 >Prev</A
    354 ></TD
    355 ><TD
    356 WIDTH="34%"
    357 ALIGN="center"
    358 VALIGN="top"
    359 ><A
    360 HREF="book1.htm"
    361 ACCESSKEY="H"
    362 >Home</A
    363 ></TD
    364 ><TD
    365 WIDTH="33%"
    366 ALIGN="right"
    367 VALIGN="top"
    368 ><A
    369 HREF="r12051.htm"
    370 ACCESSKEY="N"
    371 >Next</A
    372 ></TD
    373 ></TR
    374 ><TR
    375 ><TD
    376 WIDTH="33%"
    377 ALIGN="left"
    378 VALIGN="top"
    379 >ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</TD
    380 ><TD
    381 WIDTH="34%"
    382 ALIGN="center"
    383 VALIGN="top"
    384 ><A
    385 HREF="r7624.htm"
    386 ACCESSKEY="U"
    387 >Up</A
    388 ></TD
    389 ><TD
    390 WIDTH="33%"
    391 ALIGN="right"
    392 VALIGN="top"
    393 >ioctl VIDIOC_G_SLICED_VBI_CAP</TD
    394 ></TR
    395 ></TABLE
    396 ></DIV
    397 ></BODY
    398 ></HTML
    399 >
    400