summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-07-26 17:16:50 -0700
committerEric Laurent <elaurent@google.com>2014-03-05 12:17:54 -0800
commitd0115d8c4db2f337030dea706bc0a434c4a03ed6 (patch)
tree239450c60bc4cb8519edeb8985dbc601fe51c652 /include
parent7e92abeafb184e8a34213d7149592e95a72601b0 (diff)
downloadframeworks_av-d0115d8c4db2f337030dea706bc0a434c4a03ed6.zip
frameworks_av-d0115d8c4db2f337030dea706bc0a434c4a03ed6.tar.gz
frameworks_av-d0115d8c4db2f337030dea706bc0a434c4a03ed6.tar.bz2
update offloaded audio track sampling rate
AudioPlayer must read the sampling rate from offloaded audio sinks whenever a new time position is computed as the decoder can update the sampling rate on the fly. Bug: 12823955. Change-Id: I997e5248cfd4017aeceb4e11689324ded2a5bc88
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioTrack.h2
-rw-r--r--include/media/MediaPlayerInterface.h1
-rw-r--r--include/media/stagefright/AudioPlayer.h2
3 files changed, 3 insertions, 2 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index f379ee5..f6646ab 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -661,7 +661,7 @@ protected:
sp<AudioTrackThread> mAudioTrackThread;
float mVolume[2];
float mSendLevel;
- uint32_t mSampleRate;
+ mutable uint32_t mSampleRate; // mutable because getSampleRate() can update it.
size_t mFrameCount; // corresponds to current IAudioTrack
size_t mReqFrameCount; // frame count to request the next time a new
// IAudioTrack is needed
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index cc244f0..26d8729 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -100,6 +100,7 @@ public:
virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0;
virtual int getSessionId() const = 0;
virtual audio_stream_type_t getAudioStreamType() const = 0;
+ virtual uint32_t getSampleRate() const = 0;
// If no callback is specified, use the "write" API below to submit
// audio data.
diff --git a/include/media/stagefright/AudioPlayer.h b/include/media/stagefright/AudioPlayer.h
index 912a43c..14afb85 100644
--- a/include/media/stagefright/AudioPlayer.h
+++ b/include/media/stagefright/AudioPlayer.h
@@ -129,7 +129,7 @@ private:
void reset();
uint32_t getNumFramesPendingPlayout() const;
- int64_t getOutputPlayPositionUs_l() const;
+ int64_t getOutputPlayPositionUs_l();
bool allowDeepBuffering() const { return (mCreateFlags & ALLOW_DEEP_BUFFERING) != 0; }
bool useOffload() const { return (mCreateFlags & USE_OFFLOAD) != 0; }