diff options
| author | Glenn Kasten <gkasten@google.com> | 2012-10-01 11:15:49 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-01 11:15:49 -0700 |
| commit | 5e18f179858e508bcf3bd551ead3322c3ff656b9 (patch) | |
| tree | b201e7f5f62783b558dc03f377393c33a69e18a4 /include | |
| parent | da68fae17aaa5b9852caf6a96222f327d5ee3779 (diff) | |
| parent | 558301cb1ecc3679997593905230bd3589e736a4 (diff) | |
| download | frameworks_av-5e18f179858e508bcf3bd551ead3322c3ff656b9.zip frameworks_av-5e18f179858e508bcf3bd551ead3322c3ff656b9.tar.gz frameworks_av-5e18f179858e508bcf3bd551ead3322c3ff656b9.tar.bz2 | |
am 558301cb: am d13df246: Merge "Enable write side of MonoPipe to be shutdown" into jb-mr1-dev
* commit '558301cb1ecc3679997593905230bd3589e736a4':
Enable write side of MonoPipe to be shutdown
Diffstat (limited to 'include')
| -rw-r--r-- | include/media/nbaio/MonoPipe.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/media/nbaio/MonoPipe.h b/include/media/nbaio/MonoPipe.h index c47bf6c..5fcfe9e 100644 --- a/include/media/nbaio/MonoPipe.h +++ b/include/media/nbaio/MonoPipe.h @@ -77,6 +77,17 @@ public: void setAvgFrames(size_t setpoint); size_t maxFrames() const { return mMaxFrames; } + // Set the shutdown state for the write side of a pipe. + // This may be called by an unrelated thread. When shutdown state is 'true', + // a write that would otherwise block instead returns a short transfer count. + // There is no guarantee how long it will take for the shutdown to be recognized, + // but it will not be an unbounded amount of time. + // The state can be restored to normal by calling shutdown(false). + void shutdown(bool newState = true); + + // Return true if the write side of a pipe is currently shutdown. + bool isShutdown(); + private: // A pair of methods and a helper variable which allows the reader and the // writer to update and observe the values of mFront and mNextRdPTS in an @@ -114,6 +125,8 @@ private: int64_t offsetTimestampByAudioFrames(int64_t ts, size_t audFrames); LinearTransform mSamplesToLocalTime; + + bool mIsShutdown; // whether shutdown(true) was called, no barriers are needed }; } // namespace android |
