diff options
author | Eric Laurent <elaurent@google.com> | 2014-12-15 14:33:13 -0800 |
---|---|---|
committer | Rachad Alao <rachad@google.com> | 2014-12-16 01:38:34 +0000 |
commit | d1f69b0b17acbd96987ecb2f3378abd394d05903 (patch) | |
tree | e3061c609dfaa2c217bb79a8d85e4571e8bd0d3d /services/audioflinger/Tracks.cpp | |
parent | 8ddb02230d02968d471aa41b22433957c38827c0 (diff) | |
download | frameworks_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/Tracks.cpp')
-rw-r--r-- | services/audioflinger/Tracks.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp index fcbf8f8..e970036 100644 --- a/services/audioflinger/Tracks.cpp +++ b/services/audioflinger/Tracks.cpp @@ -823,12 +823,11 @@ void AudioFlinger::PlaybackThread::Track::flush() // this will be done by prepareTracks_l() when the track is stopped. // prepareTracks_l() will see mState == FLUSHED, then // remove from active track list, reset(), and trigger presentation complete + if (isDirect()) { + mFlushHwPending = true; + } if (playbackThread->mActiveTracks.indexOf(this) < 0) { reset(); - if (thread->type() == ThreadBase::DIRECT) { - DirectOutputThread *t = (DirectOutputThread *)playbackThread; - t->flushHw_l(); - } } } // Prevent flush being lost if the track is flushed and then resumed @@ -841,7 +840,7 @@ void AudioFlinger::PlaybackThread::Track::flush() // must be called with thread lock held void AudioFlinger::PlaybackThread::Track::flushAck() { - if (!isOffloaded()) + if (!isOffloaded() && !isDirect()) return; mFlushHwPending = false; |