1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Appendix&#160;B.&#160;Common definitions for V4L2 and V4L2 subdev interfaces</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="v4l2spec.html" title="Part&#160;I.&#160;Video for Linux Two API Specification"><link rel="prev" href="func-write.html" title="V4L2 write()"><link rel="next" href="videodev.html" title="Appendix&#160;C.&#160;Video For Linux Two Header File"></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">Appendix&#160;B.&#160;Common definitions for V4L2 and V4L2 subdev interfaces</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="func-write.html">Prev</a>&#160;</td><th width="60%" align="center">Part&#160;I.&#160;Video for Linux Two API Specification</th><td width="20%" align="right">&#160;<a accesskey="n" href="videodev.html">Next</a></td></tr></table><hr></div><div class="appendix"><div class="titlepage"><div><div><h2 class="title"><a name="idp1117252324"></a>Appendix&#160;B.&#160;Common definitions for V4L2 and V4L2 subdev interfaces</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="apb.html#v4l2-selections-common">Common selection definitions</a></span></dt><dd><dl><dt><span class="section"><a href="apb.html#v4l2-selection-targets">Selection targets</a></span></dt><dt><span class="section"><a href="apb.html#v4l2-selection-flags">Selection flags</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="v4l2-selections-common"></a>Common selection definitions</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="apb.html#v4l2-selection-targets">Selection targets</a></span></dt><dt><span class="section"><a href="apb.html#v4l2-selection-flags">Selection flags</a></span></dt></dl></div><p>While the <a class="link" href="selection-api.html" title="Experimental API for cropping, composing and scaling">V4L2 selection
2  API</a> and <a class="link" href="subdev.html#v4l2-subdev-selections" title="Selections: cropping, scaling and composition">V4L2 subdev
3  selection APIs</a> are very similar, there's one fundamental
4  difference between the two. On sub-device API, the selection
5  rectangle refers to the media bus format, and is bound to a
6  sub-device's pad. On the V4L2 interface the selection rectangles
7  refer to the in-memory pixel format.</p><p>This section defines the common definitions of the
8  selection interfaces on the two APIs.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="v4l2-selection-targets"></a>Selection targets</h3></div></div></div><p>The precise meaning of the selection targets may be
9    dependent on which of the two interfaces they are used.</p><div class="table"><a name="v4l2-selection-targets-table"></a><p class="title"><b>Table&#160;B.1.&#160;Selection target definitions</b></p><div class="table-contents"><table summary="Selection target definitions" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"><col class="c4"><col class="c5"></colgroup><thead><tr><th align="left">Target name</th><th align="left">id</th><th align="left">Definition</th><th align="left">Valid for V4L2</th><th align="left">Valid for V4L2 subdev</th></tr></thead><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_SEL_TGT_CROP</code></td><td valign="top">0x0000</td><td valign="top">Crop rectangle. Defines the cropped area.</td><td valign="top">Yes</td><td valign="top">Yes</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_TGT_CROP_DEFAULT</code></td><td valign="top">0x0001</td><td valign="top">Suggested cropping rectangle that covers the "whole picture".</td><td valign="top">Yes</td><td valign="top">No</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_TGT_CROP_BOUNDS</code></td><td valign="top">0x0002</td><td valign="top">Bounds of the crop rectangle. All valid crop
10	    rectangles fit inside the crop bounds rectangle.
11	    </td><td valign="top">Yes</td><td valign="top">Yes</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_TGT_NATIVE_SIZE</code></td><td valign="top">0x0003</td><td valign="top">The native size of the device, e.g. a sensor's
12	    pixel array. <em class="structfield"><code>left</code></em> and
13	    <em class="structfield"><code>top</code></em> fields are zero for this
14	    target. Setting the native size will generally only make
15	    sense for memory to memory devices where the software can
16	    create a canvas of a given size in which for example a
17	    video frame can be composed. In that case
18	    V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size
19	    of that canvas.
20	    </td><td valign="top">Yes</td><td valign="top">Yes</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_TGT_COMPOSE</code></td><td valign="top">0x0100</td><td valign="top">Compose rectangle. Used to configure scaling
21	    and composition.</td><td valign="top">Yes</td><td valign="top">Yes</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_TGT_COMPOSE_DEFAULT</code></td><td valign="top">0x0101</td><td valign="top">Suggested composition rectangle that covers the "whole picture".</td><td valign="top">Yes</td><td valign="top">No</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_TGT_COMPOSE_BOUNDS</code></td><td valign="top">0x0102</td><td valign="top">Bounds of the compose rectangle. All valid compose
22	    rectangles fit inside the compose bounds rectangle.</td><td valign="top">Yes</td><td valign="top">Yes</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_TGT_COMPOSE_PADDED</code></td><td valign="top">0x0103</td><td valign="top">The active area and all padding pixels that are inserted or
23	    modified by hardware.</td><td valign="top">Yes</td><td valign="top">No</td></tr></tbody></table></div></div><br class="table-break"></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="v4l2-selection-flags"></a>Selection flags</h3></div></div></div><div class="table"><a name="v4l2-selection-flags-table"></a><p class="title"><b>Table&#160;B.2.&#160;Selection flag definitions</b></p><div class="table-contents"><table summary="Selection flag definitions" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"><col class="c4"><col class="c5"></colgroup><thead><tr><th align="left">Flag name</th><th align="left">id</th><th align="left">Definition</th><th align="left">Valid for V4L2</th><th align="left">Valid for V4L2 subdev</th></tr></thead><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_SEL_FLAG_GE</code></td><td valign="top">(1 &lt;&lt; 0)</td><td valign="top">Suggest the driver it should choose greater or
24	    equal rectangle (in size) than was requested. Albeit the
25	    driver may choose a lesser size, it will only do so due to
26	    hardware limitations. Without this flag (and
27	    <code class="constant">V4L2_SEL_FLAG_LE</code>) the
28	    behaviour is to choose the closest possible
29	    rectangle.</td><td valign="top">Yes</td><td valign="top">Yes</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_FLAG_LE</code></td><td valign="top">(1 &lt;&lt; 1)</td><td valign="top">Suggest the driver it
30	    should choose lesser or equal rectangle (in size) than was
31	    requested. Albeit the driver may choose a greater size, it
32	    will only do so due to hardware limitations.</td><td valign="top">Yes</td><td valign="top">Yes</td></tr><tr><td valign="top"><code class="constant">V4L2_SEL_FLAG_KEEP_CONFIG</code></td><td valign="top">(1 &lt;&lt; 2)</td><td valign="top">The configuration must not be propagated to any
33	    further processing steps. If this flag is not given, the
34	    configuration is propagated inside the subdevice to all
35	    further processing steps.</td><td valign="top">No</td><td valign="top">Yes</td></tr></tbody></table></div></div><br class="table-break"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="func-write.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="v4l2spec.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="videodev.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">V4L2 write()&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Appendix&#160;C.&#160;Video For Linux Two Header File</td></tr></table></div></body></html>
36