1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 5<meta http-equiv="X-UA-Compatible" content="IE=9"/> 6<meta name="generator" content="Doxygen 1.8.15"/> 7<meta name="viewport" content="width=device-width, initial-scale=1"/> 8<title>Oboe: include/oboe/AudioStream.h Source File</title> 9<link href="tabs.css" rel="stylesheet" type="text/css"/> 10<script type="text/javascript" src="jquery.js"></script> 11<script type="text/javascript" src="dynsections.js"></script> 12<link href="search/search.css" rel="stylesheet" type="text/css"/> 13<script type="text/javascript" src="search/searchdata.js"></script> 14<script type="text/javascript" src="search/search.js"></script> 15<link href="doxygen.css" rel="stylesheet" type="text/css" /> 16</head> 17<body> 18<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 19<div id="titlearea"> 20<table cellspacing="0" cellpadding="0"> 21 <tbody> 22 <tr style="height: 56px;"> 23 <td id="projectalign" style="padding-left: 0.5em;"> 24 <div id="projectname">Oboe 25  <span id="projectnumber">1.5</span> 26 </div> 27 <div id="projectbrief">A library for creating real-time audio apps on Android</div> 28 </td> 29 </tr> 30 </tbody> 31</table> 32</div> 33<!-- end header part --> 34<!-- Generated by Doxygen 1.8.15 --> 35<script type="text/javascript"> 36/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 37var searchBox = new SearchBox("searchBox", "search",false,'Search'); 38/* @license-end */ 39</script> 40<script type="text/javascript" src="menudata.js"></script> 41<script type="text/javascript" src="menu.js"></script> 42<script type="text/javascript"> 43/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 44$(function() { 45 initMenu('',true,false,'search.php','Search'); 46 $(document).ready(function() { init_search(); }); 47}); 48/* @license-end */</script> 49<div id="main-nav"></div> 50<!-- window showing the filter options --> 51<div id="MSearchSelectWindow" 52 onmouseover="return searchBox.OnSearchSelectShow()" 53 onmouseout="return searchBox.OnSearchSelectHide()" 54 onkeydown="return searchBox.OnSearchSelectKey(event)"> 55</div> 56 57<!-- iframe showing the search results (closed by default) --> 58<div id="MSearchResultsWindow"> 59<iframe src="javascript:void(0)" frameborder="0" 60 name="MSearchResults" id="MSearchResults"> 61</iframe> 62</div> 63 64<div id="nav-path" class="navpath"> 65 <ul> 66<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_768f6301d9838e45d679001914ab2803.html">oboe</a></li> </ul> 67</div> 68</div><!-- top --> 69<div class="header"> 70 <div class="headertitle"> 71<div class="title">AudioStream.h</div> </div> 72</div><!--header--> 73<div class="contents"> 74<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright 2016 The Android Open Source Project</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> */</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#ifndef OBOE_STREAM_H_</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#define OBOE_STREAM_H_</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <atomic></span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <cstdint></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <ctime></span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include <mutex></span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "oboe/Definitions.h"</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "oboe/ResultWithValue.h"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "oboe/AudioStreamBuilder.h"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "oboe/AudioStreamBase.h"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="namespaceoboe.html"> 31</a></span> <span class="keyword">namespace </span><a class="code" href="namespaceoboe.html">oboe</a> {</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="namespaceoboe.html#aab8f5f081a8b2147e16ec920347c1b5c"> 39</a></span> constexpr int64_t <a class="code" href="namespaceoboe.html#aab8f5f081a8b2147e16ec920347c1b5c">kDefaultTimeoutNanos</a> = (2000 * <a class="code" href="namespaceoboe.html#a831e887150474c087170679eaca8672b">kNanosPerMillisecond</a>);</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html"> 44</a></span> <span class="keyword">class </span><a class="code" href="classoboe_1_1_audio_stream.html">AudioStream</a> : <span class="keyword">public</span> <a class="code" href="classoboe_1_1_audio_stream_base.html">AudioStreamBase</a> {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoboe_1_1_audio_stream_builder.html">AudioStreamBuilder</a>; <span class="comment">// allow access to setWeakThis() and lockWeakThis()</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="classoboe_1_1_audio_stream.html">AudioStream</a>() {}</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keyword">explicit</span> <a class="code" href="classoboe_1_1_audio_stream.html">AudioStream</a>(<span class="keyword">const</span> <a class="code" href="classoboe_1_1_audio_stream_builder.html">AudioStreamBuilder</a> &builder);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> </div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keyword">virtual</span> ~<a class="code" href="classoboe_1_1_audio_stream.html">AudioStream</a>() = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a686c6ce8a29051c858fd1de386805dc6"> 67</a></span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a686c6ce8a29051c858fd1de386805dc6">open</a>() {</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="keywordflow">return</span> Result::OK; <span class="comment">// Called by subclasses. Might do more in the future.</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  }</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a9c8ea30e30e513766d5e996c370eb8d8">close</a>();</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#af04f03eb6b64b564f1c4401688987d21">start</a>(int64_t timeoutNanoseconds = <a class="code" href="namespaceoboe.html#aab8f5f081a8b2147e16ec920347c1b5c">kDefaultTimeoutNanos</a>);</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a04f29836748a8e5842aef2be200022ad">pause</a>(int64_t timeoutNanoseconds = <a class="code" href="namespaceoboe.html#aab8f5f081a8b2147e16ec920347c1b5c">kDefaultTimeoutNanos</a>);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a32c25c0333eab3d65ce02275ad4acb3d">flush</a>(int64_t timeoutNanoseconds = <a class="code" href="namespaceoboe.html#aab8f5f081a8b2147e16ec920347c1b5c">kDefaultTimeoutNanos</a>);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#aec093859d42f0470c884edd1e976d9f3">stop</a>(int64_t timeoutNanoseconds = <a class="code" href="namespaceoboe.html#aab8f5f081a8b2147e16ec920347c1b5c">kDefaultTimeoutNanos</a>);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">/* Asynchronous requests.</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment"> * Use waitForStateChange() if you need to wait for completion.</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="comment"> */</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a3c484e314dee8dfed1d419f487b5d601">requestStart</a>() = 0;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a7f18bb3cc5490fd7fbc1f6da63c730f6">requestPause</a>() = 0;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a6bd5d633ff999e4da1faf3cd949aa602">requestFlush</a>() = 0;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a820e634f741e6b5efdcef8104cecb919">requestStop</a>() = 0;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span> </div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a89fa2ce046723764618c29db737917f6">StreamState</a> <a class="code" href="classoboe_1_1_audio_stream.html#a9d37cc6513823c685ae892626ff83ea8">getState</a>() <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a0c865a5501f369d959c39d8ab8b46a07">waitForStateChange</a>(<a class="code" href="namespaceoboe.html#a89fa2ce046723764618c29db737917f6">StreamState</a> inputState,</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <a class="code" href="namespaceoboe.html#a89fa2ce046723764618c29db737917f6">StreamState</a> *nextState,</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  int64_t timeoutNanoseconds) = 0;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span> </div><div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a06e3f9e133b3a75515e7793939d1cd03"> 178</a></span>  <span class="keyword">virtual</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<int32_t></a> <a class="code" href="classoboe_1_1_audio_stream.html#a06e3f9e133b3a75515e7793939d1cd03">setBufferSizeInFrames</a>(int32_t <span class="comment">/* requestedFrames */</span>) {</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">return</span> Result::ErrorUnimplemented;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  }</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#ad1a1d3bbf3b348ed92b7ed18ce9cc261"> 194</a></span>  <span class="keyword">virtual</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<int32_t></a> <a class="code" href="classoboe_1_1_audio_stream.html#ad1a1d3bbf3b348ed92b7ed18ce9cc261">getXRunCount</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keywordflow">return</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<int32_t></a>(Result::ErrorUnimplemented);</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  }</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> </div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classoboe_1_1_audio_stream.html#a43d8a098440cde28f4ee8bedd6d107c4">isXRunCountSupported</a>() <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> </div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keyword">virtual</span> int32_t <a class="code" href="classoboe_1_1_audio_stream.html#ac160acb656515814fa6fdd157c131a0a">getFramesPerBurst</a>() = 0;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span> </div><div class="line"><a name="l00217"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a5c01907a59d5f89a5e4b819fe66b08bc"> 217</a></span>  int32_t <a class="code" href="classoboe_1_1_audio_stream.html#a5c01907a59d5f89a5e4b819fe66b08bc">getBytesPerFrame</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classoboe_1_1_audio_stream_base.html#a5ff460bac9d14dfeac4eeddfcbb6e206">mChannelCount</a> * <a class="code" href="classoboe_1_1_audio_stream.html#a44dda61e6e948e49b68f87172f084d62">getBytesPerSample</a>(); }</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> </div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  int32_t <a class="code" href="classoboe_1_1_audio_stream.html#a44dda61e6e948e49b68f87172f084d62">getBytesPerSample</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span> </div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keyword">virtual</span> int64_t <a class="code" href="classoboe_1_1_audio_stream.html#ab43dd4074e1de57bac1c3fd111430341">getFramesWritten</a>();</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span> </div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="keyword">virtual</span> int64_t <a class="code" href="classoboe_1_1_audio_stream.html#aeebfc59abd978cd6dff07c16cfe266df">getFramesRead</a>();</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span> </div><div class="line"><a name="l00266"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#ae023cb001f3261d064f423101798d6be"> 266</a></span>  <span class="keyword">virtual</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<double></a> <a class="code" href="classoboe_1_1_audio_stream.html#ae023cb001f3261d064f423101798d6be">calculateLatencyMillis</a>() {</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="keywordflow">return</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<double></a>(Result::ErrorUnimplemented);</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  }</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span> </div><div class="line"><a name="l00287"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#acb8edbc17ff79993a8ed996d216fe6f3"> 287</a></span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#acb8edbc17ff79993a8ed996d216fe6f3">getTimestamp</a>(clockid_t <span class="comment">/* clockId */</span>,</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  int64_t* <span class="comment">/* framePosition */</span>,</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  int64_t* <span class="comment">/* timeNanoseconds */</span>) {</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="keywordflow">return</span> Result::ErrorUnimplemented;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  }</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keyword">virtual</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<FrameTimestamp></a> <a class="code" href="classoboe_1_1_audio_stream.html#acb8edbc17ff79993a8ed996d216fe6f3">getTimestamp</a>(clockid_t <span class="comment">/* clockId */</span>);</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span> </div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="comment">// ============== I/O ===========================</span></div><div class="line"><a name="l00323"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a3612c05ed6b01a213dde67d913c07e11"> 323</a></span> <span class="comment"></span> <span class="keyword">virtual</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<int32_t></a> <a class="code" href="classoboe_1_1_audio_stream.html#a3612c05ed6b01a213dde67d913c07e11">write</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* <span class="comment">/* buffer */</span>,</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  int32_t <span class="comment">/* numFrames */</span>,</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  int64_t <span class="comment">/* timeoutNanoseconds */</span> ) {</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keywordflow">return</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<int32_t></a>(Result::ErrorUnimplemented);</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  }</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span> </div><div class="line"><a name="l00341"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a8089f0a0cb68d4039cf33e6584129978"> 341</a></span>  <span class="keyword">virtual</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<int32_t></a> <a class="code" href="classoboe_1_1_audio_stream.html#a8089f0a0cb68d4039cf33e6584129978">read</a>(<span class="keywordtype">void</span>* <span class="comment">/* buffer */</span>,</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  int32_t <span class="comment">/* numFrames */</span>,</div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  int64_t <span class="comment">/* timeoutNanoseconds */</span>) {</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="keywordflow">return</span> <a class="code" href="classoboe_1_1_result_with_value.html">ResultWithValue<int32_t></a>(Result::ErrorUnimplemented);</div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  }</div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span> </div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a92972414867c81d5974cb2ed7abefbf6">AudioApi</a> <a class="code" href="classoboe_1_1_audio_stream.html#a2b7a3cee7444114843dbdd1fc705f6bb">getAudioApi</a>() <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span> </div><div class="line"><a name="l00359"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a15cdaaaa4c1e8da322d6da33334c8147"> 359</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classoboe_1_1_audio_stream.html#a15cdaaaa4c1e8da322d6da33334c8147">usesAAudio</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="keywordflow">return</span> <a class="code" href="classoboe_1_1_audio_stream.html#a2b7a3cee7444114843dbdd1fc705f6bb">getAudioApi</a>() == <a class="code" href="namespaceoboe.html#a92972414867c81d5974cb2ed7abefbf6a99780b1e8d754eb42abed0ca5253e55b">AudioApi::AAudio</a>;</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  }</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span> </div><div class="line"><a name="l00371"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a5458d7130415eb4defe3dbc11d479e2f"> 371</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> *<a class="code" href="classoboe_1_1_audio_stream.html#a5458d7130415eb4defe3dbc11d479e2f">getUnderlyingStream</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  }</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span> </div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  <span class="keywordtype">void</span> <a class="code" href="classoboe_1_1_audio_stream.html#aa5f4801cca6877eeaa4735b93933269d">launchStopThread</a>();</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span> </div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classoboe_1_1_audio_stream.html#a64ad978c5f70ced17ef5a96605496515">updateFramesWritten</a>() = 0;</div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span> </div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classoboe_1_1_audio_stream.html#a462358ddab709c79d1a7968d6d55b727">updateFramesRead</a>() = 0;</div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span> </div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="comment">/*</span></div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span> <span class="comment"> * Swap old callback for new callback.</span></div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span> <span class="comment"> * This not atomic.</span></div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span> <span class="comment"> * This should only be used internally.</span></div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span> <span class="comment"> * @param dataCallback</span></div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span> <span class="comment"> * @return previous dataCallback</span></div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span> <span class="comment"> */</span></div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <a class="code" href="classoboe_1_1_audio_stream_data_callback.html">AudioStreamDataCallback</a> *swapDataCallback(<a class="code" href="classoboe_1_1_audio_stream_data_callback.html">AudioStreamDataCallback</a> *dataCallback) {</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <a class="code" href="classoboe_1_1_audio_stream_data_callback.html">AudioStreamDataCallback</a> *previousCallback = <a class="code" href="classoboe_1_1_audio_stream_base.html#a6d8493f66a945cb426506c70f0358e5f">mDataCallback</a>;</div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <a class="code" href="classoboe_1_1_audio_stream_base.html#a6d8493f66a945cb426506c70f0358e5f">mDataCallback</a> = dataCallback;</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  <span class="keywordflow">return</span> previousCallback;</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  }</div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span> </div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="comment">/*</span></div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span> <span class="comment"> * Swap old callback for new callback.</span></div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span> <span class="comment"> * This not atomic.</span></div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span> <span class="comment"> * This should only be used internally.</span></div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span> <span class="comment"> * @param errorCallback</span></div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span> <span class="comment"> * @return previous errorCallback</span></div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span> <span class="comment"> */</span></div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  AudioStreamErrorCallback *swapErrorCallback(AudioStreamErrorCallback *errorCallback) {</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  AudioStreamErrorCallback *previousCallback = <a class="code" href="classoboe_1_1_audio_stream_base.html#adc0c8cc54adb6d3350c62b8a74b9c57b">mErrorCallback</a>;</div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <a class="code" href="classoboe_1_1_audio_stream_base.html#adc0c8cc54adb6d3350c62b8a74b9c57b">mErrorCallback</a> = errorCallback;</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  <span class="keywordflow">return</span> previousCallback;</div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  }</div><div class="line"><a name="l00417"></a><span class="lineno"> 417</span> </div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  ResultWithValue<int32_t> <a class="code" href="classoboe_1_1_audio_stream.html#afa35ee4b8629fbffe26b9be7c7ed55d2">getAvailableFrames</a>();</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span> </div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  ResultWithValue<int32_t> <a class="code" href="classoboe_1_1_audio_stream.html#afddb0962863ccf9ec6672a042fe15941">waitForAvailableFrames</a>(int32_t numFrames,</div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  int64_t timeoutNanoseconds);</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span> </div><div class="line"><a name="l00438"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a8fe8afdf164a1fe835c514f709743d75"> 438</a></span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">oboe::Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a8fe8afdf164a1fe835c514f709743d75">getLastErrorCallbackResult</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  <span class="keywordflow">return</span> mErrorCallbackResult;</div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  }</div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span> </div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span> <span class="keyword">protected</span>:</div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span> </div><div class="line"><a name="l00453"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#aa48da7bf28026b7cccee73e6b054af28"> 453</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classoboe_1_1_audio_stream.html#aa48da7bf28026b7cccee73e6b054af28">wasErrorCallbackCalled</a>() {</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  <span class="keywordflow">return</span> mErrorCallbackCalled.exchange(<span class="keyword">true</span>);</div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  }</div><div class="line"><a name="l00456"></a><span class="lineno"> 456</span> </div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">Result</a> <a class="code" href="classoboe_1_1_audio_stream.html#a8adbacd6a55a94a532916ab037fba1d6">waitForStateTransition</a>(<a class="code" href="namespaceoboe.html#a89fa2ce046723764618c29db737917f6">StreamState</a> startingState,</div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  <a class="code" href="namespaceoboe.html#a89fa2ce046723764618c29db737917f6">StreamState</a> endingState,</div><div class="line"><a name="l00465"></a><span class="lineno"> 465</span>  int64_t timeoutNanoseconds);</div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span> </div><div class="line"><a name="l00474"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a0ea79e60f5a3d29fc5a1a116aba11dfe"> 474</a></span>  <span class="keyword">virtual</span> <a class="code" href="namespaceoboe.html#af85fc9910a287df6c5df0ed396bb75cd">DataCallbackResult</a> <a class="code" href="classoboe_1_1_audio_stream.html#a0ea79e60f5a3d29fc5a1a116aba11dfe">onDefaultCallback</a>(<span class="keywordtype">void</span>* <span class="comment">/* audioData */</span>, <span class="keywordtype">int</span> <span class="comment">/* numFrames */</span>) {</div><div class="line"><a name="l00475"></a><span class="lineno"> 475</span>  <span class="keywordflow">return</span> DataCallbackResult::Stop;</div><div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  }</div><div class="line"><a name="l00477"></a><span class="lineno"> 477</span> </div><div class="line"><a name="l00486"></a><span class="lineno"> 486</span>  <a class="code" href="namespaceoboe.html#af85fc9910a287df6c5df0ed396bb75cd">DataCallbackResult</a> <a class="code" href="classoboe_1_1_audio_stream.html#ab7a8cfe5d6039386bc5850fd5ee9bd62">fireDataCallback</a>(<span class="keywordtype">void</span> *audioData, <span class="keywordtype">int</span> numFrames);</div><div class="line"><a name="l00487"></a><span class="lineno"> 487</span> </div><div class="line"><a name="l00491"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#add85011ba825f74931deeb92c5edf831"> 491</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classoboe_1_1_audio_stream.html#add85011ba825f74931deeb92c5edf831">isDataCallbackEnabled</a>() {</div><div class="line"><a name="l00492"></a><span class="lineno"> 492</span>  <span class="keywordflow">return</span> mDataCallbackEnabled;</div><div class="line"><a name="l00493"></a><span class="lineno"> 493</span>  }</div><div class="line"><a name="l00494"></a><span class="lineno"> 494</span> </div><div class="line"><a name="l00499"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a0faa6d3a6fd4f367e6f80d5a29e6dcba"> 499</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoboe_1_1_audio_stream.html#a0faa6d3a6fd4f367e6f80d5a29e6dcba">setDataCallbackEnabled</a>(<span class="keywordtype">bool</span> enabled) {</div><div class="line"><a name="l00500"></a><span class="lineno"> 500</span>  mDataCallbackEnabled = enabled;</div><div class="line"><a name="l00501"></a><span class="lineno"> 501</span>  }</div><div class="line"><a name="l00502"></a><span class="lineno"> 502</span> </div><div class="line"><a name="l00503"></a><span class="lineno"> 503</span>  <span class="comment">/*</span></div><div class="line"><a name="l00504"></a><span class="lineno"> 504</span> <span class="comment"> * Set a weak_ptr to this stream from the shared_ptr so that we can</span></div><div class="line"><a name="l00505"></a><span class="lineno"> 505</span> <span class="comment"> * later use a shared_ptr in the error callback.</span></div><div class="line"><a name="l00506"></a><span class="lineno"> 506</span> <span class="comment"> */</span></div><div class="line"><a name="l00507"></a><span class="lineno"> 507</span>  <span class="keywordtype">void</span> setWeakThis(std::shared_ptr<oboe::AudioStream> &sharedStream) {</div><div class="line"><a name="l00508"></a><span class="lineno"> 508</span>  mWeakThis = sharedStream;</div><div class="line"><a name="l00509"></a><span class="lineno"> 509</span>  }</div><div class="line"><a name="l00510"></a><span class="lineno"> 510</span> </div><div class="line"><a name="l00511"></a><span class="lineno"> 511</span>  <span class="comment">/*</span></div><div class="line"><a name="l00512"></a><span class="lineno"> 512</span> <span class="comment"> * Make a shared_ptr that will prevent this stream from being deleted.</span></div><div class="line"><a name="l00513"></a><span class="lineno"> 513</span> <span class="comment"> */</span></div><div class="line"><a name="l00514"></a><span class="lineno"> 514</span>  std::shared_ptr<oboe::AudioStream> lockWeakThis() {</div><div class="line"><a name="l00515"></a><span class="lineno"> 515</span>  <span class="keywordflow">return</span> mWeakThis.lock();</div><div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  }</div><div class="line"><a name="l00517"></a><span class="lineno"> 517</span> </div><div class="line"><a name="l00518"></a><span class="lineno"> 518</span>  std::weak_ptr<AudioStream> mWeakThis; <span class="comment">// weak pointer to this object</span></div><div class="line"><a name="l00519"></a><span class="lineno"> 519</span> </div><div class="line"><a name="l00526"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a88a63317b7c58815bac074976b00aa23"> 526</a></span>  std::atomic<int64_t> <a class="code" href="classoboe_1_1_audio_stream.html#a88a63317b7c58815bac074976b00aa23">mFramesWritten</a>{};</div><div class="line"><a name="l00527"></a><span class="lineno"> 527</span> </div><div class="line"><a name="l00534"></a><span class="lineno"><a class="line" href="classoboe_1_1_audio_stream.html#a07e82f9b9e2e4800f23ae9a7193c3b58"> 534</a></span>  std::atomic<int64_t> <a class="code" href="classoboe_1_1_audio_stream.html#a07e82f9b9e2e4800f23ae9a7193c3b58">mFramesRead</a>{};</div><div class="line"><a name="l00535"></a><span class="lineno"> 535</span> </div><div class="line"><a name="l00536"></a><span class="lineno"> 536</span>  std::mutex mLock; <span class="comment">// for synchronizing start/stop/close</span></div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span> </div><div class="line"><a name="l00538"></a><span class="lineno"> 538</span>  <a class="code" href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">oboe::Result</a> mErrorCallbackResult = oboe::Result::OK;</div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span> </div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span> <span class="keyword">private</span>:</div><div class="line"><a name="l00541"></a><span class="lineno"> 541</span> </div><div class="line"><a name="l00542"></a><span class="lineno"> 542</span>  <span class="comment">// Log the scheduler if it changes.</span></div><div class="line"><a name="l00543"></a><span class="lineno"> 543</span>  <span class="keywordtype">void</span> checkScheduler();</div><div class="line"><a name="l00544"></a><span class="lineno"> 544</span>  <span class="keywordtype">int</span> mPreviousScheduler = -1;</div><div class="line"><a name="l00545"></a><span class="lineno"> 545</span> </div><div class="line"><a name="l00546"></a><span class="lineno"> 546</span>  std::atomic<bool> mDataCallbackEnabled{<span class="keyword">false</span>};</div><div class="line"><a name="l00547"></a><span class="lineno"> 547</span>  std::atomic<bool> mErrorCallbackCalled{<span class="keyword">false</span>};</div><div class="line"><a name="l00548"></a><span class="lineno"> 548</span> </div><div class="line"><a name="l00549"></a><span class="lineno"> 549</span> };</div><div class="line"><a name="l00550"></a><span class="lineno"> 550</span> </div><div class="line"><a name="l00555"></a><span class="lineno"><a class="line" href="structoboe_1_1_stream_deleter_functor.html"> 555</a></span>  <span class="keyword">struct </span><a class="code" href="structoboe_1_1_stream_deleter_functor.html">StreamDeleterFunctor</a> {</div><div class="line"><a name="l00556"></a><span class="lineno"> 556</span>  <span class="keywordtype">void</span> operator()(<a class="code" href="classoboe_1_1_audio_stream.html">AudioStream</a> *audioStream) {</div><div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  <span class="keywordflow">if</span> (audioStream) {</div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span>  audioStream-><a class="code" href="classoboe_1_1_audio_stream.html#a9c8ea30e30e513766d5e996c370eb8d8">close</a>();</div><div class="line"><a name="l00559"></a><span class="lineno"> 559</span>  }</div><div class="line"><a name="l00560"></a><span class="lineno"> 560</span>  <span class="keyword">delete</span> audioStream;</div><div class="line"><a name="l00561"></a><span class="lineno"> 561</span>  }</div><div class="line"><a name="l00562"></a><span class="lineno"> 562</span>  };</div><div class="line"><a name="l00563"></a><span class="lineno"> 563</span> } <span class="comment">// namespace oboe</span></div><div class="line"><a name="l00564"></a><span class="lineno"> 564</span> </div><div class="line"><a name="l00565"></a><span class="lineno"> 565</span> <span class="preprocessor">#endif </span><span class="comment">/* OBOE_STREAM_H_ */</span><span class="preprocessor"></span></div><div class="ttc" id="classoboe_1_1_audio_stream_html_a0ea79e60f5a3d29fc5a1a116aba11dfe"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a0ea79e60f5a3d29fc5a1a116aba11dfe">oboe::AudioStream::onDefaultCallback</a></div><div class="ttdeci">virtual DataCallbackResult onDefaultCallback(void *, int)</div><div class="ttdef"><b>Definition:</b> AudioStream.h:474</div></div> 75<div class="ttc" id="classoboe_1_1_audio_stream_html_aec093859d42f0470c884edd1e976d9f3"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#aec093859d42f0470c884edd1e976d9f3">oboe::AudioStream::stop</a></div><div class="ttdeci">virtual Result stop(int64_t timeoutNanoseconds=kDefaultTimeoutNanos)</div></div> 76<div class="ttc" id="namespaceoboe_html_a92972414867c81d5974cb2ed7abefbf6a99780b1e8d754eb42abed0ca5253e55b"><div class="ttname"><a href="namespaceoboe.html#a92972414867c81d5974cb2ed7abefbf6a99780b1e8d754eb42abed0ca5253e55b">oboe::AudioApi::AAudio</a></div></div> 77<div class="ttc" id="classoboe_1_1_audio_stream_builder_html"><div class="ttname"><a href="classoboe_1_1_audio_stream_builder.html">oboe::AudioStreamBuilder</a></div><div class="ttdef"><b>Definition:</b> AudioStreamBuilder.h:33</div></div> 78<div class="ttc" id="classoboe_1_1_audio_stream_html_afa35ee4b8629fbffe26b9be7c7ed55d2"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#afa35ee4b8629fbffe26b9be7c7ed55d2">oboe::AudioStream::getAvailableFrames</a></div><div class="ttdeci">ResultWithValue< int32_t > getAvailableFrames()</div></div> 79<div class="ttc" id="classoboe_1_1_audio_stream_html_a0faa6d3a6fd4f367e6f80d5a29e6dcba"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a0faa6d3a6fd4f367e6f80d5a29e6dcba">oboe::AudioStream::setDataCallbackEnabled</a></div><div class="ttdeci">void setDataCallbackEnabled(bool enabled)</div><div class="ttdef"><b>Definition:</b> AudioStream.h:499</div></div> 80<div class="ttc" id="classoboe_1_1_audio_stream_html_a15cdaaaa4c1e8da322d6da33334c8147"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a15cdaaaa4c1e8da322d6da33334c8147">oboe::AudioStream::usesAAudio</a></div><div class="ttdeci">bool usesAAudio() const</div><div class="ttdef"><b>Definition:</b> AudioStream.h:359</div></div> 81<div class="ttc" id="classoboe_1_1_audio_stream_html_a32c25c0333eab3d65ce02275ad4acb3d"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a32c25c0333eab3d65ce02275ad4acb3d">oboe::AudioStream::flush</a></div><div class="ttdeci">virtual Result flush(int64_t timeoutNanoseconds=kDefaultTimeoutNanos)</div></div> 82<div class="ttc" id="classoboe_1_1_audio_stream_base_html_a6d8493f66a945cb426506c70f0358e5f"><div class="ttname"><a href="classoboe_1_1_audio_stream_base.html#a6d8493f66a945cb426506c70f0358e5f">oboe::AudioStreamBase::mDataCallback</a></div><div class="ttdeci">AudioStreamDataCallback * mDataCallback</div><div class="ttdef"><b>Definition:</b> AudioStreamBase.h:182</div></div> 83<div class="ttc" id="classoboe_1_1_audio_stream_html_a5c01907a59d5f89a5e4b819fe66b08bc"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a5c01907a59d5f89a5e4b819fe66b08bc">oboe::AudioStream::getBytesPerFrame</a></div><div class="ttdeci">int32_t getBytesPerFrame() const</div><div class="ttdef"><b>Definition:</b> AudioStream.h:217</div></div> 84<div class="ttc" id="classoboe_1_1_audio_stream_html_af04f03eb6b64b564f1c4401688987d21"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#af04f03eb6b64b564f1c4401688987d21">oboe::AudioStream::start</a></div><div class="ttdeci">virtual Result start(int64_t timeoutNanoseconds=kDefaultTimeoutNanos)</div></div> 85<div class="ttc" id="namespaceoboe_html_aab8f5f081a8b2147e16ec920347c1b5c"><div class="ttname"><a href="namespaceoboe.html#aab8f5f081a8b2147e16ec920347c1b5c">oboe::kDefaultTimeoutNanos</a></div><div class="ttdeci">constexpr int64_t kDefaultTimeoutNanos</div><div class="ttdef"><b>Definition:</b> AudioStream.h:39</div></div> 86<div class="ttc" id="classoboe_1_1_audio_stream_html_ad1a1d3bbf3b348ed92b7ed18ce9cc261"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#ad1a1d3bbf3b348ed92b7ed18ce9cc261">oboe::AudioStream::getXRunCount</a></div><div class="ttdeci">virtual ResultWithValue< int32_t > getXRunCount() const</div><div class="ttdef"><b>Definition:</b> AudioStream.h:194</div></div> 87<div class="ttc" id="classoboe_1_1_audio_stream_html_a88a63317b7c58815bac074976b00aa23"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a88a63317b7c58815bac074976b00aa23">oboe::AudioStream::mFramesWritten</a></div><div class="ttdeci">std::atomic< int64_t > mFramesWritten</div><div class="ttdef"><b>Definition:</b> AudioStream.h:526</div></div> 88<div class="ttc" id="classoboe_1_1_audio_stream_html_ab7a8cfe5d6039386bc5850fd5ee9bd62"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#ab7a8cfe5d6039386bc5850fd5ee9bd62">oboe::AudioStream::fireDataCallback</a></div><div class="ttdeci">DataCallbackResult fireDataCallback(void *audioData, int numFrames)</div></div> 89<div class="ttc" id="classoboe_1_1_audio_stream_html_a5458d7130415eb4defe3dbc11d479e2f"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a5458d7130415eb4defe3dbc11d479e2f">oboe::AudioStream::getUnderlyingStream</a></div><div class="ttdeci">virtual void * getUnderlyingStream() const</div><div class="ttdef"><b>Definition:</b> AudioStream.h:371</div></div> 90<div class="ttc" id="classoboe_1_1_audio_stream_html_a64ad978c5f70ced17ef5a96605496515"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a64ad978c5f70ced17ef5a96605496515">oboe::AudioStream::updateFramesWritten</a></div><div class="ttdeci">virtual void updateFramesWritten()=0</div></div> 91<div class="ttc" id="classoboe_1_1_audio_stream_html_ab43dd4074e1de57bac1c3fd111430341"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#ab43dd4074e1de57bac1c3fd111430341">oboe::AudioStream::getFramesWritten</a></div><div class="ttdeci">virtual int64_t getFramesWritten()</div></div> 92<div class="ttc" id="classoboe_1_1_audio_stream_html_afddb0962863ccf9ec6672a042fe15941"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#afddb0962863ccf9ec6672a042fe15941">oboe::AudioStream::waitForAvailableFrames</a></div><div class="ttdeci">ResultWithValue< int32_t > waitForAvailableFrames(int32_t numFrames, int64_t timeoutNanoseconds)</div></div> 93<div class="ttc" id="classoboe_1_1_audio_stream_data_callback_html"><div class="ttname"><a href="classoboe_1_1_audio_stream_data_callback.html">oboe::AudioStreamDataCallback</a></div><div class="ttdef"><b>Definition:</b> AudioStreamCallback.h:34</div></div> 94<div class="ttc" id="classoboe_1_1_audio_stream_base_html_a5ff460bac9d14dfeac4eeddfcbb6e206"><div class="ttname"><a href="classoboe_1_1_audio_stream_base.html#a5ff460bac9d14dfeac4eeddfcbb6e206">oboe::AudioStreamBase::mChannelCount</a></div><div class="ttdeci">int32_t mChannelCount</div><div class="ttdef"><b>Definition:</b> AudioStreamBase.h:190</div></div> 95<div class="ttc" id="namespaceoboe_html_af85fc9910a287df6c5df0ed396bb75cd"><div class="ttname"><a href="namespaceoboe.html#af85fc9910a287df6c5df0ed396bb75cd">oboe::DataCallbackResult</a></div><div class="ttdeci">DataCallbackResult</div><div class="ttdef"><b>Definition:</b> Definitions.h:119</div></div> 96<div class="ttc" id="namespaceoboe_html_a92972414867c81d5974cb2ed7abefbf6"><div class="ttname"><a href="namespaceoboe.html#a92972414867c81d5974cb2ed7abefbf6">oboe::AudioApi</a></div><div class="ttdeci">AudioApi</div><div class="ttdef"><b>Definition:</b> Definitions.h:213</div></div> 97<div class="ttc" id="classoboe_1_1_audio_stream_html_a8adbacd6a55a94a532916ab037fba1d6"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a8adbacd6a55a94a532916ab037fba1d6">oboe::AudioStream::waitForStateTransition</a></div><div class="ttdeci">virtual Result waitForStateTransition(StreamState startingState, StreamState endingState, int64_t timeoutNanoseconds)</div></div> 98<div class="ttc" id="classoboe_1_1_audio_stream_html_ac160acb656515814fa6fdd157c131a0a"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#ac160acb656515814fa6fdd157c131a0a">oboe::AudioStream::getFramesPerBurst</a></div><div class="ttdeci">virtual int32_t getFramesPerBurst()=0</div></div> 99<div class="ttc" id="classoboe_1_1_audio_stream_html_a9c8ea30e30e513766d5e996c370eb8d8"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a9c8ea30e30e513766d5e996c370eb8d8">oboe::AudioStream::close</a></div><div class="ttdeci">virtual Result close()</div></div> 100<div class="ttc" id="classoboe_1_1_audio_stream_html_a06e3f9e133b3a75515e7793939d1cd03"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a06e3f9e133b3a75515e7793939d1cd03">oboe::AudioStream::setBufferSizeInFrames</a></div><div class="ttdeci">virtual ResultWithValue< int32_t > setBufferSizeInFrames(int32_t)</div><div class="ttdef"><b>Definition:</b> AudioStream.h:178</div></div> 101<div class="ttc" id="classoboe_1_1_audio_stream_html_ae023cb001f3261d064f423101798d6be"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#ae023cb001f3261d064f423101798d6be">oboe::AudioStream::calculateLatencyMillis</a></div><div class="ttdeci">virtual ResultWithValue< double > calculateLatencyMillis()</div><div class="ttdef"><b>Definition:</b> AudioStream.h:266</div></div> 102<div class="ttc" id="classoboe_1_1_audio_stream_html_acb8edbc17ff79993a8ed996d216fe6f3"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#acb8edbc17ff79993a8ed996d216fe6f3">oboe::AudioStream::getTimestamp</a></div><div class="ttdeci">virtual Result getTimestamp(clockid_t, int64_t *, int64_t *)</div><div class="ttdef"><b>Definition:</b> AudioStream.h:287</div></div> 103<div class="ttc" id="classoboe_1_1_audio_stream_html_a686c6ce8a29051c858fd1de386805dc6"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a686c6ce8a29051c858fd1de386805dc6">oboe::AudioStream::open</a></div><div class="ttdeci">virtual Result open()</div><div class="ttdef"><b>Definition:</b> AudioStream.h:67</div></div> 104<div class="ttc" id="classoboe_1_1_audio_stream_html_aeebfc59abd978cd6dff07c16cfe266df"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#aeebfc59abd978cd6dff07c16cfe266df">oboe::AudioStream::getFramesRead</a></div><div class="ttdeci">virtual int64_t getFramesRead()</div></div> 105<div class="ttc" id="classoboe_1_1_audio_stream_html"><div class="ttname"><a href="classoboe_1_1_audio_stream.html">oboe::AudioStream</a></div><div class="ttdef"><b>Definition:</b> AudioStream.h:44</div></div> 106<div class="ttc" id="classoboe_1_1_audio_stream_html_add85011ba825f74931deeb92c5edf831"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#add85011ba825f74931deeb92c5edf831">oboe::AudioStream::isDataCallbackEnabled</a></div><div class="ttdeci">bool isDataCallbackEnabled()</div><div class="ttdef"><b>Definition:</b> AudioStream.h:491</div></div> 107<div class="ttc" id="classoboe_1_1_audio_stream_html_a8089f0a0cb68d4039cf33e6584129978"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a8089f0a0cb68d4039cf33e6584129978">oboe::AudioStream::read</a></div><div class="ttdeci">virtual ResultWithValue< int32_t > read(void *, int32_t, int64_t)</div><div class="ttdef"><b>Definition:</b> AudioStream.h:341</div></div> 108<div class="ttc" id="classoboe_1_1_audio_stream_html_a7f18bb3cc5490fd7fbc1f6da63c730f6"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a7f18bb3cc5490fd7fbc1f6da63c730f6">oboe::AudioStream::requestPause</a></div><div class="ttdeci">virtual Result requestPause()=0</div></div> 109<div class="ttc" id="classoboe_1_1_audio_stream_html_a3612c05ed6b01a213dde67d913c07e11"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a3612c05ed6b01a213dde67d913c07e11">oboe::AudioStream::write</a></div><div class="ttdeci">virtual ResultWithValue< int32_t > write(const void *, int32_t, int64_t)</div><div class="ttdef"><b>Definition:</b> AudioStream.h:323</div></div> 110<div class="ttc" id="classoboe_1_1_audio_stream_html_a07e82f9b9e2e4800f23ae9a7193c3b58"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a07e82f9b9e2e4800f23ae9a7193c3b58">oboe::AudioStream::mFramesRead</a></div><div class="ttdeci">std::atomic< int64_t > mFramesRead</div><div class="ttdef"><b>Definition:</b> AudioStream.h:534</div></div> 111<div class="ttc" id="classoboe_1_1_audio_stream_base_html"><div class="ttname"><a href="classoboe_1_1_audio_stream_base.html">oboe::AudioStreamBase</a></div><div class="ttdef"><b>Definition:</b> AudioStreamBase.h:29</div></div> 112<div class="ttc" id="namespaceoboe_html_a831e887150474c087170679eaca8672b"><div class="ttname"><a href="namespaceoboe.html#a831e887150474c087170679eaca8672b">oboe::kNanosPerMillisecond</a></div><div class="ttdeci">constexpr int64_t kNanosPerMillisecond</div><div class="ttdef"><b>Definition:</b> Definitions.h:43</div></div> 113<div class="ttc" id="classoboe_1_1_audio_stream_html_a820e634f741e6b5efdcef8104cecb919"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a820e634f741e6b5efdcef8104cecb919">oboe::AudioStream::requestStop</a></div><div class="ttdeci">virtual Result requestStop()=0</div></div> 114<div class="ttc" id="classoboe_1_1_audio_stream_html_a2b7a3cee7444114843dbdd1fc705f6bb"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a2b7a3cee7444114843dbdd1fc705f6bb">oboe::AudioStream::getAudioApi</a></div><div class="ttdeci">virtual AudioApi getAudioApi() const =0</div></div> 115<div class="ttc" id="classoboe_1_1_audio_stream_html_aa5f4801cca6877eeaa4735b93933269d"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#aa5f4801cca6877eeaa4735b93933269d">oboe::AudioStream::launchStopThread</a></div><div class="ttdeci">void launchStopThread()</div></div> 116<div class="ttc" id="classoboe_1_1_audio_stream_html_a0c865a5501f369d959c39d8ab8b46a07"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a0c865a5501f369d959c39d8ab8b46a07">oboe::AudioStream::waitForStateChange</a></div><div class="ttdeci">virtual Result waitForStateChange(StreamState inputState, StreamState *nextState, int64_t timeoutNanoseconds)=0</div></div> 117<div class="ttc" id="namespaceoboe_html_a486512e787b609c80ba4436f23929af1"><div class="ttname"><a href="namespaceoboe.html#a486512e787b609c80ba4436f23929af1">oboe::Result</a></div><div class="ttdeci">Result</div><div class="ttdef"><b>Definition:</b> Definitions.h:131</div></div> 118<div class="ttc" id="structoboe_1_1_stream_deleter_functor_html"><div class="ttname"><a href="structoboe_1_1_stream_deleter_functor.html">oboe::StreamDeleterFunctor</a></div><div class="ttdef"><b>Definition:</b> AudioStream.h:555</div></div> 119<div class="ttc" id="namespaceoboe_html"><div class="ttname"><a href="namespaceoboe.html">oboe</a></div><div class="ttdef"><b>Definition:</b> AudioStream.h:31</div></div> 120<div class="ttc" id="classoboe_1_1_audio_stream_html_aa48da7bf28026b7cccee73e6b054af28"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#aa48da7bf28026b7cccee73e6b054af28">oboe::AudioStream::wasErrorCallbackCalled</a></div><div class="ttdeci">bool wasErrorCallbackCalled()</div><div class="ttdef"><b>Definition:</b> AudioStream.h:453</div></div> 121<div class="ttc" id="classoboe_1_1_audio_stream_html_a43d8a098440cde28f4ee8bedd6d107c4"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a43d8a098440cde28f4ee8bedd6d107c4">oboe::AudioStream::isXRunCountSupported</a></div><div class="ttdeci">virtual bool isXRunCountSupported() const =0</div></div> 122<div class="ttc" id="classoboe_1_1_audio_stream_html_a3c484e314dee8dfed1d419f487b5d601"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a3c484e314dee8dfed1d419f487b5d601">oboe::AudioStream::requestStart</a></div><div class="ttdeci">virtual Result requestStart()=0</div></div> 123<div class="ttc" id="classoboe_1_1_audio_stream_html_a8fe8afdf164a1fe835c514f709743d75"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a8fe8afdf164a1fe835c514f709743d75">oboe::AudioStream::getLastErrorCallbackResult</a></div><div class="ttdeci">virtual oboe::Result getLastErrorCallbackResult() const</div><div class="ttdef"><b>Definition:</b> AudioStream.h:438</div></div> 124<div class="ttc" id="namespaceoboe_html_a89fa2ce046723764618c29db737917f6"><div class="ttname"><a href="namespaceoboe.html#a89fa2ce046723764618c29db737917f6">oboe::StreamState</a></div><div class="ttdeci">StreamState</div><div class="ttdef"><b>Definition:</b> Definitions.h:58</div></div> 125<div class="ttc" id="classoboe_1_1_audio_stream_html_a9d37cc6513823c685ae892626ff83ea8"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a9d37cc6513823c685ae892626ff83ea8">oboe::AudioStream::getState</a></div><div class="ttdeci">virtual StreamState getState() const =0</div></div> 126<div class="ttc" id="classoboe_1_1_audio_stream_html_a04f29836748a8e5842aef2be200022ad"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a04f29836748a8e5842aef2be200022ad">oboe::AudioStream::pause</a></div><div class="ttdeci">virtual Result pause(int64_t timeoutNanoseconds=kDefaultTimeoutNanos)</div></div> 127<div class="ttc" id="classoboe_1_1_audio_stream_html_a6bd5d633ff999e4da1faf3cd949aa602"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a6bd5d633ff999e4da1faf3cd949aa602">oboe::AudioStream::requestFlush</a></div><div class="ttdeci">virtual Result requestFlush()=0</div></div> 128<div class="ttc" id="classoboe_1_1_audio_stream_html_a462358ddab709c79d1a7968d6d55b727"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a462358ddab709c79d1a7968d6d55b727">oboe::AudioStream::updateFramesRead</a></div><div class="ttdeci">virtual void updateFramesRead()=0</div></div> 129<div class="ttc" id="classoboe_1_1_audio_stream_base_html_adc0c8cc54adb6d3350c62b8a74b9c57b"><div class="ttname"><a href="classoboe_1_1_audio_stream_base.html#adc0c8cc54adb6d3350c62b8a74b9c57b">oboe::AudioStreamBase::mErrorCallback</a></div><div class="ttdeci">AudioStreamErrorCallback * mErrorCallback</div><div class="ttdef"><b>Definition:</b> AudioStreamBase.h:185</div></div> 130<div class="ttc" id="classoboe_1_1_audio_stream_html_a44dda61e6e948e49b68f87172f084d62"><div class="ttname"><a href="classoboe_1_1_audio_stream.html#a44dda61e6e948e49b68f87172f084d62">oboe::AudioStream::getBytesPerSample</a></div><div class="ttdeci">int32_t getBytesPerSample() const</div></div> 131<div class="ttc" id="classoboe_1_1_result_with_value_html"><div class="ttname"><a href="classoboe_1_1_result_with_value.html">oboe::ResultWithValue</a></div><div class="ttdef"><b>Definition:</b> ResultWithValue.h:47</div></div> 132</div><!-- fragment --></div><!-- contents --> 133<!-- start footer part --> 134<hr class="footer"/><address class="footer"><small> 135Generated by  <a href="http://www.doxygen.org/index.html"> 136<img class="footer" src="doxygen.png" alt="doxygen"/> 137</a> 1.8.15 138</small></address> 139</body> 140</html> 141