From 5e49afd05566820517747b9a8071c99ec0918328 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 26 Jul 2013 17:16:50 -0700 Subject: 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 --- libvideoeditor/lvpp/VideoEditorPlayer.cpp | 7 +++++++ libvideoeditor/lvpp/VideoEditorPlayer.h | 1 + 2 files changed, 8 insertions(+) (limited to 'libvideoeditor') 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, -- cgit v1.1