chromium/native_client_sdk/doc_generated/pepper_beta/c/struct_p_p_b___media_stream_audio_track__0__1.html

{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_MediaStreamAudioTrack Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
  <div>
<!-- Generated by Doxygen 1.7.6.1 -->


</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PPB_MediaStreamAudioTrack" --><h2>
Data Fields</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a578685c385942e0f9e9e3b041dea4f17">IsMediaStreamAudioTrack</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a73f0f222f60ceed5f662ef3db7dee21b">Configure</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track, const int32_t attrib_list[], struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a3ad96bc4cd30dd580871a789a749819c">GetAttrib</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track, <a class="el" href="group___enums.html#ga2f729c238ba74adc778c0d0bc17c453f">PP_MediaStreamAudioTrack_Attrib</a> attrib, int32_t *value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a54bbc279f3440f49fbb9ad357ba4d224">GetId</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a21037392fc0a6fb893881fddb204002f">HasEnded</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#af7941e0bcb6c2aac5bb2dc7397d22b96">GetBuffer</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> *buffer, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#af43b8871ebeeed2466437fcb23ce994d">RecycleBuffer</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> buffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a459bc28c5a626eb4a59a81286e9f8a58">Close</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track)</td></tr>
</table>
<hr /><h2>Field Documentation</h2>
<a class="anchor" id="a459bc28c5a626eb4a59a81286e9f8a58"></a><!-- doxytag: member="PPB_MediaStreamAudioTrack::Close" ref="a459bc28c5a626eb4a59a81286e9f8a58" args=")(PP_Resource audio_track)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a459bc28c5a626eb4a59a81286e9f8a58">PPB_MediaStreamAudioTrack::Close</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Closes the MediaStream audio track and disconnects it from the audio source. </p>
<p>After calling <code><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a459bc28c5a626eb4a59a81286e9f8a58" title="Closes the MediaStream audio track and disconnects it from the audio source.">Close()</a></code>, no new buffers will be received.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">audio_track</td><td>A <code>PP_Resource</code> corresponding to a MediaStream audio track resource. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a73f0f222f60ceed5f662ef3db7dee21b"></a><!-- doxytag: member="PPB_MediaStreamAudioTrack::Configure" ref="a73f0f222f60ceed5f662ef3db7dee21b" args=")(PP_Resource audio_track, const int32_t attrib_list[], struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a73f0f222f60ceed5f662ef3db7dee21b">PPB_MediaStreamAudioTrack::Configure</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track, const int32_t attrib_list[], struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Configures underlying buffers for incoming audio samples. </p>
<p>If the application doesn't want to drop samples, then the <code>PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS</code> should be chosen such that inter-buffer processing time variability won't overrun all the input buffers. If all buffers are filled, then samples will be dropped. The application can detect this by examining the timestamp on returned buffers. If <code><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a73f0f222f60ceed5f662ef3db7dee21b" title="Configures underlying buffers for incoming audio samples.">Configure()</a></code> is not called, default settings will be used. Calls to Configure while the plugin holds buffers will fail. Example usage from plugin code: </p>
<div class="fragment"><pre class="fragment"> int32_t attribs[] = {
     <a class="code" href="group___enums.html#gga2f729c238ba74adc778c0d0bc17c453fae157f98fb5bc32ca0e193e5b8198c7dc" title="The maximum number of buffers to hold audio samples.">PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS</a>, 4,
     <a class="code" href="group___enums.html#gga2f729c238ba74adc778c0d0bc17c453fa13c3fa0a2740301acda8b218bac8b972" title="The duration of an audio buffer in milliseconds.">PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION</a>, 10,
     <a class="code" href="group___enums.html#gga2f729c238ba74adc778c0d0bc17c453fa5f1f0d353fe407fe10ac3c0e908aba4f" title="Attribute list terminator.">PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE</a>};
 track_if-&gt;Configure(track, attribs, callback);
</pre></div><dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">audio_track</td><td>A <code>PP_Resource</code> corresponding to an audio resource. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">attrib_list</td><td>A list of attribute name-value pairs in which each attribute is immediately followed by the corresponding desired value. The list is terminated by <code>PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called upon completion of <code><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a73f0f222f60ceed5f662ef3db7dee21b" title="Configures underlying buffers for incoming audio samples.">Configure()</a></code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a3ad96bc4cd30dd580871a789a749819c"></a><!-- doxytag: member="PPB_MediaStreamAudioTrack::GetAttrib" ref="a3ad96bc4cd30dd580871a789a749819c" args=")(PP_Resource audio_track, PP_MediaStreamAudioTrack_Attrib attrib, int32_t *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a3ad96bc4cd30dd580871a789a749819c">PPB_MediaStreamAudioTrack::GetAttrib</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track, <a class="el" href="group___enums.html#ga2f729c238ba74adc778c0d0bc17c453f">PP_MediaStreamAudioTrack_Attrib</a> attrib, int32_t *value)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets attribute value for a given attribute name. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">audio_track</td><td>A <code>PP_Resource</code> corresponding to an audio resource. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">attrib</td><td>A <code>PP_MediaStreamAudioTrack_Attrib</code> for querying. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">value</td><td>A int32_t for storing the attribute value on success. Otherwise, the value will not be changed.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="af7941e0bcb6c2aac5bb2dc7397d22b96"></a><!-- doxytag: member="PPB_MediaStreamAudioTrack::GetBuffer" ref="af7941e0bcb6c2aac5bb2dc7397d22b96" args=")(PP_Resource audio_track, PP_Resource *buffer, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#af7941e0bcb6c2aac5bb2dc7397d22b96">PPB_MediaStreamAudioTrack::GetBuffer</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> *buffer, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the next audio buffer from the MediaStream track. </p>
<p>If internal processing is slower than the incoming buffer rate, new buffers will be dropped from the incoming stream. Once all buffers are full, audio samples will be dropped until <code><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#af43b8871ebeeed2466437fcb23ce994d" title="Recycles a buffer returned by GetBuffer(), so the track can reuse the buffer.">RecycleBuffer()</a></code> is called to free a slot for another buffer. If there are no audio data in the input buffer, <code>PP_OK_COMPLETIONPENDING</code> will be returned immediately and the <code>callback</code> will be called, when a new buffer of audio samples is received or an error happens.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">audio_track</td><td>A <code>PP_Resource</code> corresponding to an audio resource. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">buffer</td><td>A <code>PP_Resource</code> corresponding to an AudioBuffer resource. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called upon completion of <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#af7941e0bcb6c2aac5bb2dc7397d22b96" title="Gets the next audio buffer from the MediaStream track.">GetBuffer()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a54bbc279f3440f49fbb9ad357ba4d224"></a><!-- doxytag: member="PPB_MediaStreamAudioTrack::GetId" ref="a54bbc279f3440f49fbb9ad357ba4d224" args=")(PP_Resource audio_track)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(* <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a54bbc279f3440f49fbb9ad357ba4d224">PPB_MediaStreamAudioTrack::GetId</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track)<code> [read]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the track ID of the underlying MediaStream audio track. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">audio_track</td><td>The <code>PP_Resource</code> to check.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code><a class="el" href="struct_p_p___var.html" title="The PP_VAR struct is a variant data type and can contain any value of one of the types named in the P...">PP_Var</a></code> containing the MediaStream track ID as a string. </dd></dl>
</div>
</div>
<a class="anchor" id="a21037392fc0a6fb893881fddb204002f"></a><!-- doxytag: member="PPB_MediaStreamAudioTrack::HasEnded" ref="a21037392fc0a6fb893881fddb204002f" args=")(PP_Resource audio_track)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a21037392fc0a6fb893881fddb204002f">PPB_MediaStreamAudioTrack::HasEnded</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Checks whether the underlying MediaStream track has ended. </p>
<p>Calls to GetBuffer while the track has ended are safe to make and will complete, but will fail.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">audio_track</td><td>The <code>PP_Resource</code> to check.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given MediaStream track has ended or <code>PP_FALSE</code> otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="a578685c385942e0f9e9e3b041dea4f17"></a><!-- doxytag: member="PPB_MediaStreamAudioTrack::IsMediaStreamAudioTrack" ref="a578685c385942e0f9e9e3b041dea4f17" args=")(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#a578685c385942e0f9e9e3b041dea4f17">PPB_MediaStreamAudioTrack::IsMediaStreamAudioTrack</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determines if a resource is a MediaStream audio track resource. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>The <code>PP_Resource</code> to test.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given resource is a Mediastream audio track resource or <code>PP_FALSE</code> otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="af43b8871ebeeed2466437fcb23ce994d"></a><!-- doxytag: member="PPB_MediaStreamAudioTrack::RecycleBuffer" ref="af43b8871ebeeed2466437fcb23ce994d" args=")(PP_Resource audio_track, PP_Resource buffer)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#af43b8871ebeeed2466437fcb23ce994d">PPB_MediaStreamAudioTrack::RecycleBuffer</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> audio_track, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> buffer)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Recycles a buffer returned by <code><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#af7941e0bcb6c2aac5bb2dc7397d22b96" title="Gets the next audio buffer from the MediaStream track.">GetBuffer()</a></code>, so the track can reuse the buffer. </p>
<p>And the buffer will become invalid. The caller should release all references it holds to <code>buffer</code> and not use it anymore.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">audio_track</td><td>A <code>PP_Resource</code> corresponding to an audio resource. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>A <code>PP_Resource</code> corresponding to an AudioBuffer resource returned by <code><a class="el" href="struct_p_p_b___media_stream_audio_track__0__1.html#af7941e0bcb6c2aac5bb2dc7397d22b96" title="Gets the next audio buffer from the MediaStream track.">GetBuffer()</a></code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__media__stream__audio__track_8h.html">ppb_media_stream_audio_track.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}