summaryrefslogtreecommitdiffstats
path: root/libvideoeditor
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2012-03-29 09:31:28 -0700
committerMarco Nelissen <marcone@google.com>2012-04-02 09:19:03 -0700
commit4110c101c3d0dd8dbc44c8d2d0edd3e2e7d6652f (patch)
tree7bb39d31afac7348bb91093cc0e1c2d9aa49cba2 /libvideoeditor
parenta1472d9883e35edd280201c8be3191695007dfd4 (diff)
downloadframeworks_av-4110c101c3d0dd8dbc44c8d2d0edd3e2e7d6652f.zip
frameworks_av-4110c101c3d0dd8dbc44c8d2d0edd3e2e7d6652f.tar.gz
frameworks_av-4110c101c3d0dd8dbc44c8d2d0edd3e2e7d6652f.tar.bz2
Add gapless playback support for NuPlayer
This makes NuPlayer use a SkipCutBuffer when needed, and adds a new AudioSink method to retrieve the number of frames written so far, so NuPlayerRenderer can calculate how much data it can write without blocking. Also make some more methods const. Change-Id: Id7d253ad8a7b85e9a84ca2baafbe32817b16c744
Diffstat (limited to 'libvideoeditor')
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorPlayer.cpp11
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorPlayer.h5
2 files changed, 12 insertions, 4 deletions
diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.cpp b/libvideoeditor/lvpp/VideoEditorPlayer.cpp
index 57cab08..1ba1f44 100755
--- a/libvideoeditor/lvpp/VideoEditorPlayer.cpp
+++ b/libvideoeditor/lvpp/VideoEditorPlayer.cpp
@@ -376,12 +376,19 @@ float VideoEditorPlayer::VeAudioOutput::msecsPerFrame() const
return mMsecsPerFrame;
}
-status_t VideoEditorPlayer::VeAudioOutput::getPosition(uint32_t *position) {
+status_t VideoEditorPlayer::VeAudioOutput::getPosition(uint32_t *position) const {
if (mTrack == 0) return NO_INIT;
return mTrack->getPosition(position);
}
+status_t VideoEditorPlayer::VeAudioOutput::getFramesWritten(uint32_t *written) const {
+
+ if (mTrack == 0) return NO_INIT;
+ *written = mNumFramesWritten;
+ return OK;
+}
+
status_t VideoEditorPlayer::VeAudioOutput::open(
uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask,
audio_format_t format, int bufferCount,
@@ -569,7 +576,7 @@ status_t VideoEditorPlayer::VeAudioOutput::dump(int fd, const Vector<String16>&
return NO_ERROR;
}
-int VideoEditorPlayer::VeAudioOutput::getSessionId() {
+int VideoEditorPlayer::VeAudioOutput::getSessionId() const {
return mSessionId;
}
diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.h b/libvideoeditor/lvpp/VideoEditorPlayer.h
index 6962501..350b384 100755
--- a/libvideoeditor/lvpp/VideoEditorPlayer.h
+++ b/libvideoeditor/lvpp/VideoEditorPlayer.h
@@ -45,8 +45,9 @@ class VideoEditorPlayer : public MediaPlayerInterface {
virtual ssize_t frameSize() const;
virtual uint32_t latency() const;
virtual float msecsPerFrame() const;
- virtual status_t getPosition(uint32_t *position);
- virtual int getSessionId();
+ virtual status_t getPosition(uint32_t *position) const;
+ virtual status_t getFramesWritten(uint32_t*) const;
+ virtual int getSessionId() const;
virtual status_t open(
uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask,