summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-12-15 14:33:13 -0800
committerRachad Alao <rachad@google.com>2014-12-16 01:38:34 +0000
commitd1f69b0b17acbd96987ecb2f3378abd394d05903 (patch)
treee3061c609dfaa2c217bb79a8d85e4571e8bd0d3d /services/audioflinger/Threads.h
parent8ddb02230d02968d471aa41b22433957c38827c0 (diff)
downloadframeworks_av-d1f69b0b17acbd96987ecb2f3378abd394d05903.zip
frameworks_av-d1f69b0b17acbd96987ecb2f3378abd394d05903.tar.gz
frameworks_av-d1f69b0b17acbd96987ecb2f3378abd394d05903.tar.bz2
audioflinger: implement pause/resume for direct outputs
Extend pause/resume support to direct output threads (was only for offload threads). If the HAL implements pause/resume, track pause/resume is forwarded to the HAL. Pause, flush, resume sequence is respected by executing the HAL calls in the playback thread (same as offload). Make sure the track flags on client side are consistent with the flags on server side. Bug: 17883772. Change-Id: I89b360d69818f7a9204bd36e3ec63a79e106ecf1
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r--services/audioflinger/Threads.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 119e495..f5d0e27 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -809,7 +809,9 @@ public:
protected:
// accessed by both binder threads and within threadLoop(), lock on mutex needed
unsigned mFastTrackAvailMask; // bit i set if fast track [i] is available
-
+ bool mHwSupportsPause;
+ bool mHwPaused;
+ bool mFlushPending;
private:
// timestamp latch:
// D input is written by threadLoop_write while mutex is unlocked, and read while locked
@@ -910,6 +912,8 @@ protected:
virtual mixer_state prepareTracks_l(Vector< sp<Track> > *tracksToRemove);
virtual void threadLoop_mix();
virtual void threadLoop_sleepTime();
+ virtual void threadLoop_exit();
+ virtual bool shouldStandby_l();
// volumes last sent to audio HAL with stream->set_volume()
float mLeftVolFloat;
@@ -940,12 +944,9 @@ protected:
virtual bool waitingAsyncCallback();
virtual bool waitingAsyncCallback_l();
- virtual bool shouldStandby_l();
virtual void onAddNewTrack_l();
private:
- bool mHwPaused;
- bool mFlushPending;
size_t mPausedWriteLength; // length in bytes of write interrupted by pause
size_t mPausedBytesRemaining; // bytes still waiting in mixbuffer after resume
wp<Track> mPreviousTrack; // used to detect track switch