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_OUTPUT, VIDIOC_S_OUTPUT</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_MODULATOR, VIDIOC_S_MODULATOR" 17 HREF="r11430.htm"><LINK 18 REL="NEXT" 19 TITLE="ioctl VIDIOC_G_PARM, VIDIOC_S_PARM" 20 HREF="r11680.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="r11430.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="r11680.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-OUTPUT" 74 ></A 75 >ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</H1 76 ><DIV 77 CLASS="REFNAMEDIV" 78 ><A 79 NAME="AEN11616" 80 ></A 81 ><H2 82 >Name</H2 83 >VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT -- Query or select the current video output</DIV 84 ><DIV 85 CLASS="REFSYNOPSISDIV" 86 ><A 87 NAME="AEN11620" 88 ></A 89 ><H2 90 >Synopsis</H2 91 ><DIV 92 CLASS="FUNCSYNOPSIS" 93 ><P 94 ></P 95 ><A 96 NAME="AEN11621" 97 ></A 98 ><P 99 ><CODE 100 ><CODE 101 CLASS="FUNCDEF" 102 >int ioctl</CODE 103 >(int fd, int request, int *argp);</CODE 104 ></P 105 ><P 106 ></P 107 ></DIV 108 ></DIV 109 ><DIV 110 CLASS="REFSECT1" 111 ><A 112 NAME="AEN11631" 113 ></A 114 ><H2 115 >Arguments</H2 116 ><P 117 ></P 118 ><DIV 119 CLASS="VARIABLELIST" 120 ><DL 121 ><DT 122 ><CODE 123 CLASS="PARAMETER" 124 >fd</CODE 125 ></DT 126 ><DD 127 ><P 128 >File descriptor returned by <A 129 HREF="r14090.htm" 130 ><CODE 131 CLASS="FUNCTION" 132 >open()</CODE 133 ></A 134 >.</P 135 ></DD 136 ><DT 137 ><CODE 138 CLASS="PARAMETER" 139 >request</CODE 140 ></DT 141 ><DD 142 ><P 143 >VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT</P 144 ></DD 145 ><DT 146 ><CODE 147 CLASS="PARAMETER" 148 >argp</CODE 149 ></DT 150 ><DD 151 ><P 152 ></P 153 ></DD 154 ></DL 155 ></DIV 156 ></DIV 157 ><DIV 158 CLASS="REFSECT1" 159 ><A 160 NAME="AEN11651" 161 ></A 162 ><H2 163 >Description</H2 164 ><P 165 >To query the current video output applications call the 166 <CODE 167 CLASS="CONSTANT" 168 >VIDIOC_G_OUTPUT</CODE 169 > ioctl with a pointer to an integer 170 where the driver stores the number of the output, as in the 171 struct <A 172 HREF="r9149.htm#V4L2-OUTPUT" 173 >v4l2_output</A 174 > <CODE 175 CLASS="STRUCTFIELD" 176 >index</CODE 177 > field. This ioctl 178 will fail only when there are no video outputs, returning the 179 <SPAN 180 CLASS="ERRORCODE" 181 >EINVAL</SPAN 182 > error code.</P 183 ><P 184 >To select a video output applications store the number of the 185 desired output in an integer and call the 186 <CODE 187 CLASS="CONSTANT" 188 >VIDIOC_S_OUTPUT</CODE 189 > ioctl with a pointer to this integer. 190 Side effects are possible. For example outputs may support different 191 video standards, so the driver may implicitly switch the current 192 standard. It is good practice to select an output before querying or 193 negotiating any other parameters.</P 194 ><P 195 >Information about video outputs is available using the 196 <A 197 HREF="r9149.htm" 198 ><CODE 199 CLASS="CONSTANT" 200 >VIDIOC_ENUMOUTPUT</CODE 201 ></A 202 > ioctl.</P 203 ></DIV 204 ><DIV 205 CLASS="REFSECT1" 206 ><A 207 NAME="AEN11663" 208 ></A 209 ><H2 210 >Return Value</H2 211 ><P 212 >On success <SPAN 213 CLASS="RETURNVALUE" 214 >0</SPAN 215 > is returned, on error <SPAN 216 CLASS="RETURNVALUE" 217 >-1</SPAN 218 > and the <CODE 219 CLASS="VARNAME" 220 >errno</CODE 221 > variable is set appropriately:</P 222 ><P 223 ></P 224 ><DIV 225 CLASS="VARIABLELIST" 226 ><DL 227 ><DT 228 ><SPAN 229 CLASS="ERRORCODE" 230 >EINVAL</SPAN 231 ></DT 232 ><DD 233 ><P 234 >The number of the video output is out of bounds, or 235 there are no video outputs at all and this ioctl is not 236 supported.</P 237 ></DD 238 ><DT 239 ><SPAN 240 CLASS="ERRORCODE" 241 >EBUSY</SPAN 242 ></DT 243 ><DD 244 ><P 245 >I/O is in progress, the output cannot be 246 switched.</P 247 ></DD 248 ></DL 249 ></DIV 250 ></DIV 251 ><DIV 252 CLASS="NAVFOOTER" 253 ><HR 254 ALIGN="LEFT" 255 WIDTH="100%"><TABLE 256 SUMMARY="Footer navigation table" 257 WIDTH="100%" 258 BORDER="0" 259 CELLPADDING="0" 260 CELLSPACING="0" 261 ><TR 262 ><TD 263 WIDTH="33%" 264 ALIGN="left" 265 VALIGN="top" 266 ><A 267 HREF="r11430.htm" 268 ACCESSKEY="P" 269 >Prev</A 270 ></TD 271 ><TD 272 WIDTH="34%" 273 ALIGN="center" 274 VALIGN="top" 275 ><A 276 HREF="book1.htm" 277 ACCESSKEY="H" 278 >Home</A 279 ></TD 280 ><TD 281 WIDTH="33%" 282 ALIGN="right" 283 VALIGN="top" 284 ><A 285 HREF="r11680.htm" 286 ACCESSKEY="N" 287 >Next</A 288 ></TD 289 ></TR 290 ><TR 291 ><TD 292 WIDTH="33%" 293 ALIGN="left" 294 VALIGN="top" 295 >ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</TD 296 ><TD 297 WIDTH="34%" 298 ALIGN="center" 299 VALIGN="top" 300 ><A 301 HREF="r7624.htm" 302 ACCESSKEY="U" 303 >Up</A 304 ></TD 305 ><TD 306 WIDTH="33%" 307 ALIGN="right" 308 VALIGN="top" 309 >ioctl VIDIOC_G_PARM, VIDIOC_S_PARM</TD 310 ></TR 311 ></TABLE 312 ></DIV 313 ></BODY 314 ></HTML 315 > 316