diff options
author | Glenn Kasten <gkasten@google.com> | 2012-02-28 10:39:56 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-04-22 14:50:01 -0700 |
commit | 3acbd053c842e76e1a40fc8a0bf62de87eebf00f (patch) | |
tree | 1d6dcc01039a1af770131c6b427efa27a2e5755f /include/media/AudioTrack.h | |
parent | f853499c6a088ef8506cacbb3ccdffa87e0cec3e (diff) | |
download | frameworks_av-3acbd053c842e76e1a40fc8a0bf62de87eebf00f.zip frameworks_av-3acbd053c842e76e1a40fc8a0bf62de87eebf00f.tar.gz frameworks_av-3acbd053c842e76e1a40fc8a0bf62de87eebf00f.tar.bz2 |
Configure policy of mediaserver threads
Change-Id: Ifd825590ba36996064a458f64453a94b84722cb0
Diffstat (limited to 'include/media/AudioTrack.h')
-rw-r--r-- | include/media/AudioTrack.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 4906bd3..98b1f3e 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -138,7 +138,7 @@ public: * frameCount: Minimum size of track PCM buffer in frames. This defines the * latency of the track. The actual size selected by the AudioTrack could be * larger if the requested size is not compatible with current audio HAL - * latency. + * latency. Zero means to use a default value. * flags: See comments on audio_output_flags_t in <system/audio.h>. * cbf: Callback function. If not null, this function is called periodically * to request new PCM data. @@ -460,12 +460,24 @@ protected: { public: AudioTrackThread(AudioTrack& receiver, bool bCanCallJava = false); + + // Do not call Thread::requestExitAndWait() without first calling requestExit(). + // Thread::requestExitAndWait() is not virtual, and the implementation doesn't do enough. + virtual void requestExit(); + + void pause(); // suspend thread from execution at next loop boundary + void resume(); // allow thread to execute, if not requested to exit + private: friend class AudioTrack; virtual bool threadLoop(); virtual status_t readyToRun(); virtual void onFirstRef(); AudioTrack& mReceiver; + ~AudioTrackThread(); + Mutex mMyLock; // Thread::mLock is private + Condition mMyCond; // Thread::mThreadExitedCondition is private + bool mPaused; // whether thread is currently paused }; // body of AudioTrackThread::threadLoop() |