1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl MEDIA_IOC_SETUP_LINK</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="media-user-func.html" title="Appendix&#160;L.&#160;Function Reference"><link rel="prev" href="media-ioc-enum-links.html" title="ioctl MEDIA_IOC_ENUM_LINKS"><link rel="next" href="gen_errors.html" title="Chapter&#160;19.&#160;Generic Error Codes"></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">ioctl MEDIA_IOC_SETUP_LINK</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="media-ioc-enum-links.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;L.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="gen_errors.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="media-ioc-setup-link"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>MEDIA_IOC_SETUP_LINK &#8212; Modify the properties of a link</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">request</var>, </td></tr><tr><td>&#160;</td><td>struct media_link_desc *<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1134445364"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by
2	  <a class="link" href="media-func-open.html" title="media open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>MEDIA_IOC_SETUP_LINK</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1134449228"></a><h2>Description</h2><p>To change link properties applications fill a struct&#160;<a class="link" href="media-ioc-enum-links.html#media-link-desc" title="Table&#160;L.8.&#160;struct media_link_desc">media_link_desc</a> with
3    link identification information (source and sink pad) and the new requested
4    link flags. They then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to
5    that structure.</p><p>The only configurable property is the <code class="constant">ENABLED</code>
6    link flag to enable/disable a link. Links marked with the
7    <code class="constant">IMMUTABLE</code> link flag can not be enabled or disabled.
8    </p><p>Link configuration has no side effect on other links. If an enabled
9    link at the sink pad prevents the link from being enabled, the driver
10    returns with an <span class="errorcode">EBUSY</span> error code.</p><p>Only links marked with the <code class="constant">DYNAMIC</code> link flag can
11    be enabled/disabled while streaming media data. Attempting to enable or
12    disable a streaming non-dynamic link will return an <span class="errorcode">EBUSY</span> error code.</p><p>If the specified link can't be found the driver returns with an
13    <span class="errorcode">EINVAL</span> error code.</p></div><div class="refsect1"><a name="idp1134453228"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The struct&#160;<a class="link" href="media-ioc-enum-links.html#media-link-desc" title="Table&#160;L.8.&#160;struct media_link_desc">media_link_desc</a> references a non-existing link, or the
14	  link is immutable and an attempt to modify its configuration was made.
15	  </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="media-ioc-enum-links.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="media-user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="gen_errors.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl MEDIA_IOC_ENUM_LINKS&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;19.&#160;Generic Error Codes</td></tr></table></div></body></html>
16