Sophie

Sophie

distrib > Fedora > 18 > x86_64 > media > updates > by-pkgid > 1a595394b241504ff370a8d12ebfcea7 > files > 3809

kernel-doc-3.11.10-100.fc18.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</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="user-func.html" title="Appendix&#160;A.&#160;Function Reference" /><link rel="prev" href="vidioc-dv-timings-cap.html" title="ioctl VIDIOC_DV_TIMINGS_CAP" /><link rel="next" href="vidioc-enumaudio.html" title="ioctl VIDIOC_ENUMAUDIO" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-dv-timings-cap.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;A.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="vidioc-enumaudio.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="vidioc-encoder-cmd"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD &#8212; Execute an encoder command</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 <strong class="fsfunc">ioctl</strong>(</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 v4l2_encoder_cmd *<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a id="idm140470011376880"></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 <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD</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 id="idm140470011368720"></a><h2>Description</h2><p>These ioctls control an audio/video (usually MPEG-) encoder.
<code class="constant">VIDIOC_ENCODER_CMD</code> sends a command to the
encoder, <code class="constant">VIDIOC_TRY_ENCODER_CMD</code> can be used to
try a command without actually executing it.</p><p>To send a command applications must initialize all fields of a
    struct&#160;<a class="link" href="vidioc-encoder-cmd.html#v4l2-encoder-cmd" title="Table&#160;A.20.&#160;struct v4l2_encoder_cmd">v4l2_encoder_cmd</a> and call
    <code class="constant">VIDIOC_ENCODER_CMD</code> or
    <code class="constant">VIDIOC_TRY_ENCODER_CMD</code> with a pointer to this
    structure.</p><p>The <em class="structfield"><code>cmd</code></em> field must contain the
command code. The <em class="structfield"><code>flags</code></em> field is currently
only used by the STOP command and contains one bit: If the
<code class="constant">V4L2_ENC_CMD_STOP_AT_GOP_END</code> flag is set,
encoding will continue until the end of the current <em class="wordasword">Group
Of Pictures</em>, otherwise it will stop immediately.</p><p>A <code class="function">read</code>() or <a class="link" href="vidioc-streamon.html" title="ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF"><code class="constant">VIDIOC_STREAMON</code></a> call sends an implicit
START command to the encoder if it has not been started yet. After a STOP command,
<code class="function">read</code>() calls will read the remaining data
buffered by the driver. When the buffer is empty,
<code class="function">read</code>() will return zero and the next
<code class="function">read</code>() call will restart the encoder.</p><p>A <code class="function">close</code>() or <a class="link" href="vidioc-streamon.html" title="ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF"><code class="constant">VIDIOC_STREAMOFF</code></a> call of a streaming
file descriptor sends an implicit immediate STOP to the encoder, and all buffered
data is discarded.</p><p>These ioctls are optional, not all drivers may support
them. They were introduced in Linux 2.6.21.</p><div class="table"><a id="v4l2-encoder-cmd"></a><p class="title"><strong>Table&#160;A.20.&#160;struct <span class="structname">v4l2_encoder_cmd</span></strong></p><div class="table-contents"><table summary="struct v4l2_encoder_cmd" width="100%" border="0"><colgroup><col class="c1" /><col class="c2" /><col class="c3" /></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>cmd</code></em></td><td valign="top">The encoder command, see <a class="xref" href="vidioc-encoder-cmd.html#encoder-cmds" title="Table&#160;A.21.&#160;Encoder Commands">Table&#160;A.21, &#8220;Encoder Commands&#8221;</a>.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>flags</code></em></td><td valign="top">Flags to go with the command, see <a class="xref" href="vidioc-encoder-cmd.html#encoder-flags" title="Table&#160;A.22.&#160;Encoder Command Flags">Table&#160;A.22, &#8220;Encoder Command Flags&#8221;</a>. If no flags are defined for
this command, drivers and applications must set this field to
zero.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>data</code></em>[8]</td><td valign="top">Reserved for future extensions. Drivers and
applications must set the array to zero.</td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="encoder-cmds"></a><p class="title"><strong>Table&#160;A.21.&#160;Encoder Commands</strong></p><div class="table-contents"><table summary="Encoder Commands" width="100%" border="0"><colgroup><col class="c1" /><col class="c2" /><col class="c3" /></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_ENC_CMD_START</code></td><td valign="top">0</td><td valign="top">Start the encoder. When the encoder is already
running or paused, this command does nothing. No flags are defined for
this command.</td></tr><tr><td valign="top"><code class="constant">V4L2_ENC_CMD_STOP</code></td><td valign="top">1</td><td valign="top">Stop the encoder. When the
<code class="constant">V4L2_ENC_CMD_STOP_AT_GOP_END</code> flag is set,
encoding will continue until the end of the current <em class="wordasword">Group
Of Pictures</em>, otherwise encoding will stop immediately.
When the encoder is already stopped, this command does
nothing.</td></tr><tr><td valign="top"><code class="constant">V4L2_ENC_CMD_PAUSE</code></td><td valign="top">2</td><td valign="top">Pause the encoder. When the encoder has not been
started yet, the driver will return an <span class="errorcode">EPERM</span> error code. When the encoder is
already paused, this command does nothing. No flags are defined for
this command.</td></tr><tr><td valign="top"><code class="constant">V4L2_ENC_CMD_RESUME</code></td><td valign="top">3</td><td valign="top">Resume encoding after a PAUSE command. When the
encoder has not been started yet, the driver will return an <span class="errorcode">EPERM</span> error code.
When the encoder is already running, this command does nothing. No
flags are defined for this command.</td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="encoder-flags"></a><p class="title"><strong>Table&#160;A.22.&#160;Encoder Command Flags</strong></p><div class="table-contents"><table summary="Encoder Command Flags" width="100%" border="0"><colgroup><col class="c1" /><col class="c2" /><col class="c3" /></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_ENC_CMD_STOP_AT_GOP_END</code></td><td valign="top">0x0001</td><td valign="top">Stop encoding at the end of the current <em class="wordasword">Group Of
Pictures</em>, rather than immediately.</td></tr></tbody></table></div></div><br class="table-break" /></div><div class="refsect1"><a id="idm140470011316448"></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 <em class="structfield"><code>cmd</code></em> field is invalid.</p></dd><dt><span class="term"><span class="errorcode">EPERM</span></span></dt><dd><p>The application sent a PAUSE or RESUME command when
the encoder was not running.</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="vidioc-dv-timings-cap.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="vidioc-enumaudio.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_DV_TIMINGS_CAP&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;ioctl VIDIOC_ENUMAUDIO</td></tr></table></div></body></html>