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 /libvideoeditor | |
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 '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, |