diff options
author | Eric Laurent <elaurent@google.com> | 2013-07-26 17:16:50 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-11-22 09:09:51 -0800 |
commit | 6f59db12a64f4496866952a251122ccb77a36c6b (patch) | |
tree | 29fcb69aa1f491974ec2b2ea5a01155b53940be5 /libvideoeditor | |
parent | 23700debf767ef7fdfc30d96612771c3a03ad40d (diff) | |
download | frameworks_av-6f59db12a64f4496866952a251122ccb77a36c6b.zip frameworks_av-6f59db12a64f4496866952a251122ccb77a36c6b.tar.gz frameworks_av-6f59db12a64f4496866952a251122ccb77a36c6b.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 'libvideoeditor')
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorPlayer.cpp | 7 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorPlayer.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.cpp b/libvideoeditor/lvpp/VideoEditorPlayer.cpp index 5aeba4f..8d656c4 100755 --- a/libvideoeditor/lvpp/VideoEditorPlayer.cpp +++ b/libvideoeditor/lvpp/VideoEditorPlayer.cpp @@ -585,4 +585,11 @@ int VideoEditorPlayer::VeAudioOutput::getSessionId() const { return mSessionId; } +uint32_t VideoEditorPlayer::VeAudioOutput::getSampleRate() const { + if (mMsecsPerFrame == 0) { + return 0; + } + return (uint32_t)(1.e3 / mMsecsPerFrame); +} + } // namespace android diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.h b/libvideoeditor/lvpp/VideoEditorPlayer.h index 5862c08..b8c1254 100755 --- a/libvideoeditor/lvpp/VideoEditorPlayer.h +++ b/libvideoeditor/lvpp/VideoEditorPlayer.h @@ -48,6 +48,7 @@ class VideoEditorPlayer : public MediaPlayerInterface { virtual status_t getPosition(uint32_t *position) const; virtual status_t getFramesWritten(uint32_t*) const; virtual int getSessionId() const; + virtual uint32_t getSampleRate() const; virtual status_t open( uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask, |