diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2009-12-09 08:40:01 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 04:53:14 -0300 |
commit | 1651333b09743887bc2dd3d158a11853a2be3fe7 (patch) | |
tree | 965dd31e8fbd0c866bbcd47b86baccc238101ef7 /Documentation/DocBook/v4l/media-ioc-enum-links.xml | |
parent | 140d88165c25137e871f9559e67986ed89251105 (diff) | |
download | lwn-1651333b09743887bc2dd3d158a11853a2be3fe7.tar.gz lwn-1651333b09743887bc2dd3d158a11853a2be3fe7.zip |
[media] media: Entities, pads and links enumeration
Create the following two ioctls and implement them at the media device
level to enumerate entities, pads and links.
- MEDIA_IOC_ENUM_ENTITIES: Enumerate entities and their properties
- MEDIA_IOC_ENUM_LINKS: Enumerate all pads and links for a given entity
Entity IDs can be non-contiguous. Userspace applications should
enumerate entities using the MEDIA_ENT_ID_FLAG_NEXT flag. When the flag
is set in the entity ID, the MEDIA_IOC_ENUM_ENTITIES will return the
next entity with an ID bigger than the requested one.
Only forward links that originate at one of the entity's source pads are
returned during the enumeration process.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/DocBook/v4l/media-ioc-enum-links.xml')
-rw-r--r-- | Documentation/DocBook/v4l/media-ioc-enum-links.xml | 202 |
1 files changed, 202 insertions, 0 deletions
diff --git a/Documentation/DocBook/v4l/media-ioc-enum-links.xml b/Documentation/DocBook/v4l/media-ioc-enum-links.xml new file mode 100644 index 000000000000..6da884159cab --- /dev/null +++ b/Documentation/DocBook/v4l/media-ioc-enum-links.xml @@ -0,0 +1,202 @@ +<refentry id="media-ioc-enum-links"> + <refmeta> + <refentrytitle>ioctl MEDIA_IOC_ENUM_LINKS</refentrytitle> + &manvol; + </refmeta> + + <refnamediv> + <refname>MEDIA_IOC_ENUM_LINKS</refname> + <refpurpose>Enumerate all pads and links for a given entity</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>ioctl</function></funcdef> + <paramdef>int <parameter>fd</parameter></paramdef> + <paramdef>int <parameter>request</parameter></paramdef> + <paramdef>struct media_links_enum *<parameter>argp</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </refsynopsisdiv> + + <refsect1> + <title>Arguments</title> + + <variablelist> + <varlistentry> + <term><parameter>fd</parameter></term> + <listitem> + <para>File descriptor returned by + <link linkend='media-func-open'><function>open()</function></link>.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>request</parameter></term> + <listitem> + <para>MEDIA_IOC_ENUM_LINKS</para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>argp</parameter></term> + <listitem> + <para></para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Description</title> + + <para>To enumerate pads and/or links for a given entity, applications set + the entity field of a &media-links-enum; structure and initialize the + &media-pad-desc; and &media-link-desc; structure arrays pointed by the + <structfield>pads</structfield> and <structfield>links</structfield> fields. + They then call the MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this + structure.</para> + <para>If the <structfield>pads</structfield> field is not NULL, the driver + fills the <structfield>pads</structfield> array with information about the + entity's pads. The array must have enough room to store all the entity's + pads. The number of pads can be retrieved with the &MEDIA-IOC-ENUM-ENTITIES; + ioctl.</para> + <para>If the <structfield>links</structfield> field is not NULL, the driver + fills the <structfield>links</structfield> array with information about the + entity's outbound links. The array must have enough room to store all the + entity's outbound links. The number of outbound links can be retrieved with + the &MEDIA-IOC-ENUM-ENTITIES; ioctl.</para> + <para>Only forward links that originate at one of the entity's source pads + are returned during the enumeration process.</para> + + <table pgwide="1" frame="none" id="media-links-enum"> + <title>struct <structname>media_links_enum</structname></title> + <tgroup cols="3"> + &cs-str; + <tbody valign="top"> + <row> + <entry>__u32</entry> + <entry><structfield>entity</structfield></entry> + <entry>Entity id, set by the application.</entry> + </row> + <row> + <entry>struct &media-pad-desc;</entry> + <entry>*<structfield>pads</structfield></entry> + <entry>Pointer to a pads array allocated by the application. Ignored + if NULL.</entry> + </row> + <row> + <entry>struct &media-link-desc;</entry> + <entry>*<structfield>links</structfield></entry> + <entry>Pointer to a links array allocated by the application. Ignored + if NULL.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table pgwide="1" frame="none" id="media-pad-desc"> + <title>struct <structname>media_pad_desc</structname></title> + <tgroup cols="3"> + &cs-str; + <tbody valign="top"> + <row> + <entry>__u32</entry> + <entry><structfield>entity</structfield></entry> + <entry>ID of the entity this pad belongs to.</entry> + </row> + <row> + <entry>__u16</entry> + <entry><structfield>index</structfield></entry> + <entry>0-based pad index.</entry> + </row> + <row> + <entry>__u32</entry> + <entry><structfield>flags</structfield></entry> + <entry>Pad flags, see <xref linkend="media-pad-flag" /> for more details.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table frame="none" pgwide="1" id="media-pad-flag"> + <title>Media pad flags</title> + <tgroup cols="2"> + <colspec colname="c1"/> + <colspec colname="c2"/> + <tbody valign="top"> + <row> + <entry><constant>MEDIA_PAD_FL_SINK</constant></entry> + <entry>Input pad, relative to the entity. Input pads sink data and + are targets of links.</entry> + </row> + <row> + <entry><constant>MEDIA_PAD_FL_SOURCE</constant></entry> + <entry>Output pad, relative to the entity. Output pads source data + and are origins of links.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table pgwide="1" frame="none" id="media-link-desc"> + <title>struct <structname>media_links_desc</structname></title> + <tgroup cols="3"> + &cs-str; + <tbody valign="top"> + <row> + <entry>struct &media-pad-desc;</entry> + <entry><structfield>source</structfield></entry> + <entry>Pad at the origin of this link.</entry> + </row> + <row> + <entry>struct &media-pad-desc;</entry> + <entry><structfield>sink</structfield></entry> + <entry>Pad at the target of this link.</entry> + </row> + <row> + <entry>__u32</entry> + <entry><structfield>flags</structfield></entry> + <entry>Link flags, see <xref linkend="media-link-flag" /> for more details.</entry> + </row> + </tbody> + </tgroup> + </table> + + <table frame="none" pgwide="1" id="media-link-flag"> + <title>Media link flags</title> + <tgroup cols="2"> + <colspec colname="c1"/> + <colspec colname="c2"/> + <tbody valign="top"> + <row> + <entry><constant>MEDIA_LNK_FL_ENABLED</constant></entry> + <entry>The link is enabled and can be used to transfer media data. + When two or more links target a sink pad, only one of them can be + enabled at a time.</entry> + </row> + <row> + <entry><constant>MEDIA_LNK_FL_IMMUTABLE</constant></entry> + <entry>The link enabled state can't be modified at runtime. An + immutable link is always enabled.</entry> + </row> + </tbody> + </tgroup> + </table> + <para>One and only one of <constant>MEDIA_PAD_FL_SINK</constant> and + <constant>MEDIA_PAD_FL_SOURCE</constant> must be set for every pad.</para> + </refsect1> + + <refsect1> + &return-value; + + <variablelist> + <varlistentry> + <term><errorcode>EINVAL</errorcode></term> + <listitem> + <para>The &media-links-enum; <structfield>id</structfield> references + a non-existing entity.</para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> +</refentry> |