summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-09-27 18:48:26 -0700
committerEric Laurent <elaurent@google.com>2013-09-30 12:05:38 -0700
commit59fe010bcc072597852454a2ec53d7b0a2002a3b (patch)
treeb6b42e04a89ead77c9ecd9635a328686a8bb9863 /services/audioflinger/Tracks.cpp
parent5d6d86a4d102704f49b9235eaf282c428d7100b6 (diff)
downloadframeworks_av-59fe010bcc072597852454a2ec53d7b0a2002a3b.zip
frameworks_av-59fe010bcc072597852454a2ec53d7b0a2002a3b.tar.gz
frameworks_av-59fe010bcc072597852454a2ec53d7b0a2002a3b.tar.bz2
fix volume and effect enable delay on offloaded tracks
Volume: add a method to wake up the mediaserver playback thread when a volume command is received on an offloaded track. Effects: call effect chain process on offloaded playback threads asynchronously from writes to allow effect state updates while waiting for async write callback. Bug: 10796540. Change-Id: Id2747ae88783575d1d7ffd6fc86fbd054ab2c739
Diffstat (limited to 'services/audioflinger/Tracks.cpp')
-rw-r--r--services/audioflinger/Tracks.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index d8d325d..9c6e724 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -288,6 +288,12 @@ status_t AudioFlinger::TrackHandle::getTimestamp(AudioTimestamp& timestamp)
return mTrack->getTimestamp(timestamp);
}
+
+void AudioFlinger::TrackHandle::signal()
+{
+ return mTrack->signal();
+}
+
status_t AudioFlinger::TrackHandle::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
@@ -926,6 +932,16 @@ void AudioFlinger::PlaybackThread::Track::invalidate()
mIsInvalid = true;
}
+void AudioFlinger::PlaybackThread::Track::signal()
+{
+ sp<ThreadBase> thread = mThread.promote();
+ if (thread != 0) {
+ PlaybackThread *t = (PlaybackThread *)thread.get();
+ Mutex::Autolock _l(t->mLock);
+ t->broadcast_l();
+ }
+}
+
// ----------------------------------------------------------------------------
sp<AudioFlinger::PlaybackThread::TimedTrack>