summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-08-23 10:54:07 -0700
committerGlenn Kasten <gkasten@google.com>2013-09-03 15:12:11 -0700
commit6466c9e6e6278c740aed77f695f679be9f5db478 (patch)
treecd987ec819ddecba0665cd692285069c083fb19b /services/audioflinger
parent894d6be4f9b4721c77a01919ecf03b27cec90cc9 (diff)
downloadframeworks_av-6466c9e6e6278c740aed77f695f679be9f5db478.zip
frameworks_av-6466c9e6e6278c740aed77f695f679be9f5db478.tar.gz
frameworks_av-6466c9e6e6278c740aed77f695f679be9f5db478.tar.bz2
Add ExtendedAudioBufferProvider::framesReleased and onTimestamp
and implement them in SourceAudioBufferProvider using the associated NBAIO_Source, and in Track using the associated AudioTrackServerProxy. Change-Id: I60dc4adba63fc1dc452ff16caf347e4a7c8242c2
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/PlaybackTracks.h2
-rw-r--r--services/audioflinger/Tracks.cpp9
2 files changed, 11 insertions, 0 deletions
diff --git a/services/audioflinger/PlaybackTracks.h b/services/audioflinger/PlaybackTracks.h
index d34833f..0308b99 100644
--- a/services/audioflinger/PlaybackTracks.h
+++ b/services/audioflinger/PlaybackTracks.h
@@ -81,7 +81,9 @@ protected:
int64_t pts = kInvalidPTS);
// releaseBuffer() not overridden
+ // ExtendedAudioBufferProvider interface
virtual size_t framesReady() const;
+ virtual size_t framesReleased() const;
bool isPausing() const { return mState == PAUSING; }
bool isPaused() const { return mState == PAUSED; }
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 9622709..db67be6 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -498,6 +498,10 @@ status_t AudioFlinger::PlaybackThread::Track::getNextBuffer(
return status;
}
+// releaseBuffer() is not overridden
+
+// ExtendedAudioBufferProvider interface
+
// Note that framesReady() takes a mutex on the control block using tryLock().
// This could result in priority inversion if framesReady() is called by the normal mixer,
// as the normal mixer thread runs at lower
@@ -510,6 +514,11 @@ size_t AudioFlinger::PlaybackThread::Track::framesReady() const {
return mAudioTrackServerProxy->framesReady();
}
+size_t AudioFlinger::PlaybackThread::Track::framesReleased() const
+{
+ return mAudioTrackServerProxy->framesReleased();
+}
+
// Don't call for fast tracks; the framesReady() could result in priority inversion
bool AudioFlinger::PlaybackThread::Track::isReady() const {
if (mFillingUpStatus != FS_FILLING || isStopped() || isPausing()) {