|
218 | 218 | <tr class="memitem:a0f06feb4d6ae7b2e8e961d6783efe238" id="r_a0f06feb4d6ae7b2e8e961d6783efe238"><td class="memItemLeft" align="right" valign="top"><a id="a0f06feb4d6ae7b2e8e961d6783efe238" name="a0f06feb4d6ae7b2e8e961d6783efe238"></a> |
219 | 219 | virtual oboe::Result </td><td class="memItemRight" valign="bottom"><b>setOffloadEndOfStream</b> ()</td></tr> |
220 | 220 | <tr class="separator:a0f06feb4d6ae7b2e8e961d6783efe238"><td class="memSeparator" colspan="2"> </td></tr> |
| 221 | +<tr class="memitem:af50cdb7f9459754d53e31e21be3682d9" id="r_af50cdb7f9459754d53e31e21be3682d9"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classoboe_1_1_result_with_value.html">ResultWithValue</a>< int64_t > </td><td class="memItemRight" valign="bottom"><a class="el" href="#af50cdb7f9459754d53e31e21be3682d9">flushFromFrame</a> (FlushFromAccuracy accuracy, int64_t positionInFrames)</td></tr> |
| 222 | +<tr class="separator:af50cdb7f9459754d53e31e21be3682d9"><td class="memSeparator" colspan="2"> </td></tr> |
221 | 223 | <tr class="inherit_header pub_methods_classoboe_1_1_audio_stream_base"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classoboe_1_1_audio_stream_base')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classoboe_1_1_audio_stream_base.html">oboe::AudioStreamBase</a></td></tr> |
222 | 224 | <tr class="memitem:aa6b103e1b0f808bbc4949d56f0829f98 inherit pub_methods_classoboe_1_1_audio_stream_base" id="r_aa6b103e1b0f808bbc4949d56f0829f98"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoboe_1_1_audio_stream_base.html#aa6b103e1b0f808bbc4949d56f0829f98">AudioStreamBase</a> (const <a class="el" href="classoboe_1_1_audio_stream_base.html">AudioStreamBase</a> &)=default</td></tr> |
223 | 225 | <tr class="separator:aa6b103e1b0f808bbc4949d56f0829f98 inherit pub_methods_classoboe_1_1_audio_stream_base"><td class="memSeparator" colspan="2"> </td></tr> |
@@ -703,6 +705,48 @@ <h2 class="memtitle"><span class="permalink"><a href="#a32c25c0333eab3d65ce02275 |
703 | 705 | </div><div class="memdoc"> |
704 | 706 | <p>Flush the stream. This will block until the stream has been flushed, an error occurs or <code>timeoutNanoseconds</code> has been reached. </p> |
705 | 707 |
|
| 708 | +</div> |
| 709 | +</div> |
| 710 | +<a id="af50cdb7f9459754d53e31e21be3682d9" name="af50cdb7f9459754d53e31e21be3682d9"></a> |
| 711 | +<h2 class="memtitle"><span class="permalink"><a href="#af50cdb7f9459754d53e31e21be3682d9">◆ </a></span>flushFromFrame()</h2> |
| 712 | + |
| 713 | +<div class="memitem"> |
| 714 | +<div class="memproto"> |
| 715 | +<table class="mlabels"> |
| 716 | + <tr> |
| 717 | + <td class="mlabels-left"> |
| 718 | + <table class="memname"> |
| 719 | + <tr> |
| 720 | + <td class="memname">virtual <a class="el" href="classoboe_1_1_result_with_value.html">ResultWithValue</a>< int64_t > oboe::AudioStream::flushFromFrame </td> |
| 721 | + <td>(</td> |
| 722 | + <td class="paramtype">FlushFromAccuracy</td> <td class="paramname"><span class="paramname"><em>accuracy</em></span>, </td> |
| 723 | + </tr> |
| 724 | + <tr> |
| 725 | + <td class="paramkey"></td> |
| 726 | + <td></td> |
| 727 | + <td class="paramtype">int64_t</td> <td class="paramname"><span class="paramname"><em>positionInFrames</em></span> )</td> |
| 728 | + </tr> |
| 729 | + </table> |
| 730 | + </td> |
| 731 | + <td class="mlabels-right"> |
| 732 | +<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> |
| 733 | + </tr> |
| 734 | +</table> |
| 735 | +</div><div class="memdoc"> |
| 736 | +<p>Flush all data from given position. If this operation returns successfully, the following data will be written from the returned position.</p> |
| 737 | +<p>This method will only available when the performance mode is PerformanceMode::PowerSavingOffloaded.</p> |
| 738 | +<p>The requested position must not be negative or greater than the written frames. The current written position can be known by querying <a class="el" href="#ab43dd4074e1de57bac1c3fd111430341">getFramesWritten()</a>.</p> |
| 739 | +<p>When clients request to flush from a certain position, the audio system will return the actual flushed position based on the requested position, playback latency, etc. The written position will be updated as the actual flush position. All data after actual flush position flushed. The client can provide data from actual flush position at next write operation or data callback request. When the stream is flushed, the stream end will be reset. The client must not write any data before this function returns. Otherwise, the data will be corrupted. When the method returns successfully and the stream is active, the client must write data immediately if little audio data remains. Otherwise, the stream will underrun.</p> |
| 740 | +<p>This was introduced in Android API Level 37.</p> |
| 741 | +<dl class="params"><dt>Parameters</dt><dd> |
| 742 | + <table class="params"> |
| 743 | + <tr><td class="paramname">accuracy</td><td>the accuracy requirement when flushing. The value must be one of the valid FlushFromAccuracy value. </td></tr> |
| 744 | + <tr><td class="paramname">position</td><td>the start point in frames to flush the stream. </td></tr> |
| 745 | + </table> |
| 746 | + </dd> |
| 747 | +</dl> |
| 748 | +<dl class="section return"><dt>Returns</dt><dd>a result which the error code indicates if the stream is successfully flush or not and value as the successfully flushed position or suggested flushed position. Result::OK if the stream is successfully flushed. The value is the actual flushed position. Result::ErrorUnimplemented if it is not supported by the device. The value is the requested position. Result::ErrorIllegalArgument if the stream is not an output offload stream or the accuracy is not one of valid FlushFromAccuracy values. The value is the requested position. Result::ErrorOutOfRange if the provided position is negative or is greater than the frames written or the stream cannot flush from the requested position and FlushFromAccuracy::Accurate is requested. The value is suggested flushed position. Result::ErrorDisconnected if the stream is disconnected. The value is the requested position. Result::ErrorClosed if the stream is closed. The value is the requested position. </dd></dl> |
| 749 | + |
706 | 750 | </div> |
707 | 751 | </div> |
708 | 752 | <a id="a2b7a3cee7444114843dbdd1fc705f6bb" name="a2b7a3cee7444114843dbdd1fc705f6bb"></a> |
|
0 commit comments