diff options
author | Eric Laurent <elaurent@google.com> | 2013-07-26 17:16:50 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-12-17 13:41:37 -0800 |
commit | 5e49afd05566820517747b9a8071c99ec0918328 (patch) | |
tree | 0dd9697822c0bd70f03bb776bc78e2da60f28991 /include | |
parent | a67c76538fff102cd44b2f38dd073df5f2a33605 (diff) | |
download | frameworks_av-5e49afd05566820517747b9a8071c99ec0918328.zip frameworks_av-5e49afd05566820517747b9a8071c99ec0918328.tar.gz frameworks_av-5e49afd05566820517747b9a8071c99ec0918328.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.
Change-Id: I997e5248cfd4017aeceb4e11689324ded2a5bc88
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioTrack.h | 2 | ||||
-rw-r--r-- | include/media/MediaPlayerInterface.h | 1 | ||||
-rw-r--r-- | include/media/stagefright/AudioPlayer.h | 2 |
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; } |