Path: blob/master/Documentation/DocBook/v4l/media-controller.xml
10821 views
<partinfo>1<authorgroup>2<author>3<firstname>Laurent</firstname>4<surname>Pinchart</surname>5<affiliation><address><email>[email protected]</email></address></affiliation>6<contrib>Initial version.</contrib>7</author>8</authorgroup>9<copyright>10<year>2010</year>11<holder>Laurent Pinchart</holder>12</copyright>1314<revhistory>15<!-- Put document revisions here, newest first. -->16<revision>17<revnumber>1.0.0</revnumber>18<date>2010-11-10</date>19<authorinitials>lp</authorinitials>20<revremark>Initial revision</revremark>21</revision>22</revhistory>23</partinfo>2425<title>Media Controller API</title>2627<chapter id="media_controller">28<title>Media Controller</title>2930<section id="media-controller-intro">31<title>Introduction</title>32<para>Media devices increasingly handle multiple related functions. Many USB33cameras include microphones, video capture hardware can also output video,34or SoC camera interfaces also perform memory-to-memory operations similar to35video codecs.</para>36<para>Independent functions, even when implemented in the same hardware, can37be modelled as separate devices. A USB camera with a microphone will be38presented to userspace applications as V4L2 and ALSA capture devices. The39devices' relationships (when using a webcam, end-users shouldn't have to40manually select the associated USB microphone), while not made available41directly to applications by the drivers, can usually be retrieved from42sysfs.</para>43<para>With more and more advanced SoC devices being introduced, the current44approach will not scale. Device topologies are getting increasingly complex45and can't always be represented by a tree structure. Hardware blocks are46shared between different functions, creating dependencies between seemingly47unrelated devices.</para>48<para>Kernel abstraction APIs such as V4L2 and ALSA provide means for49applications to access hardware parameters. As newer hardware expose an50increasingly high number of those parameters, drivers need to guess what51applications really require based on limited information, thereby52implementing policies that belong to userspace.</para>53<para>The media controller API aims at solving those problems.</para>54</section>5556<section id="media-controller-model">57<title>Media device model</title>58<para>Discovering a device internal topology, and configuring it at runtime,59is one of the goals of the media controller API. To achieve this, hardware60devices are modelled as an oriented graph of building blocks called entities61connected through pads.</para>62<para>An entity is a basic media hardware or software building block. It can63correspond to a large variety of logical blocks such as physical hardware64devices (CMOS sensor for instance), logical hardware devices (a building65block in a System-on-Chip image processing pipeline), DMA channels or66physical connectors.</para>67<para>A pad is a connection endpoint through which an entity can interact68with other entities. Data (not restricted to video) produced by an entity69flows from the entity's output to one or more entity inputs. Pads should not70be confused with physical pins at chip boundaries.</para>71<para>A link is a point-to-point oriented connection between two pads,72either on the same entity or on different entities. Data flows from a source73pad to a sink pad.</para>74</section>75</chapter>7677<appendix id="media-user-func">78<title>Function Reference</title>79<!-- Keep this alphabetically sorted. -->80&sub-media-func-open;81&sub-media-func-close;82&sub-media-func-ioctl;83<!-- All ioctls go here. -->84&sub-media-ioc-device-info;85&sub-media-ioc-enum-entities;86&sub-media-ioc-enum-links;87&sub-media-ioc-setup-link;88</appendix>899091