diff options
author | Don Turner <donturner@google.com> | 2018-07-04 18:35:02 +0100 |
---|---|---|
committer | Don Turner <dturner@users.noreply.github.com> | 2018-07-10 18:49:09 +0100 |
commit | ff649d0a40ef18ee18cafb002b2a334059c9f79a (patch) | |
tree | 33698ca9c1ccf694d0588d34da58a37171f2fd17 /include/oboe/AudioStream.h | |
parent | 94fe4853e85c403463922a702eb0c7a2dfac230c (diff) | |
download | oboe-ff649d0a40ef18ee18cafb002b2a334059c9f79a.tar.gz |
Refactor AudioStream methods to handle closed state
Diffstat (limited to 'include/oboe/AudioStream.h')
-rw-r--r-- | include/oboe/AudioStream.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/oboe/AudioStream.h b/include/oboe/AudioStream.h index 46a496e6..cb54a1c1 100644 --- a/include/oboe/AudioStream.h +++ b/include/oboe/AudioStream.h @@ -140,11 +140,16 @@ public: } /** + * @return true if XRun counts are supported on the stream + */ + virtual bool isXRunCountSupported() const = 0; + + /** * Query the number of frames that are read or written by the endpoint at one time. * * @return burst size */ - virtual int32_t getFramesPerBurst() const = 0; + virtual int32_t getFramesPerBurst() = 0; bool isPlaying(); @@ -156,9 +161,9 @@ public: * This monotonic counter will never get reset. * @return the number of frames written so far */ - virtual int64_t getFramesWritten() const { return mFramesWritten; } + virtual int64_t getFramesWritten() { return mFramesWritten; } - virtual int64_t getFramesRead() const { return mFramesRead; } + virtual int64_t getFramesRead() { return mFramesRead; } /** * Calculate the latency of a stream based on getTimestamp(). @@ -282,10 +287,12 @@ protected: // These do not change after open. AudioFormat mNativeFormat = AudioFormat::Invalid; -private: // TODO these should be atomic like in AAudio int64_t mFramesWritten = 0; int64_t mFramesRead = 0; + +private: + // TODO these should be atomic like in AAudio int mPreviousScheduler = -1; }; |