From 2dbef65fea1115c53edda5bd4b40c4f49c0d06dd Mon Sep 17 00:00:00 2001 From: James Dong Date: Mon, 2 May 2011 18:12:22 -0700 Subject: Cleaned up dummy audio and video sources o remove unused member variables o replace a full loop with a memset Change-Id: Ib482525a321c2a17dd188fba47b642c63ab811c3 --- libvideoeditor/lvpp/DummyAudioSource.cpp | 10 ++-------- libvideoeditor/lvpp/DummyAudioSource.h | 1 - libvideoeditor/lvpp/DummyVideoSource.h | 3 --- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/libvideoeditor/lvpp/DummyAudioSource.cpp b/libvideoeditor/lvpp/DummyAudioSource.cpp index 4eca3aa..8273a40 100755 --- a/libvideoeditor/lvpp/DummyAudioSource.cpp +++ b/libvideoeditor/lvpp/DummyAudioSource.cpp @@ -158,7 +158,6 @@ status_t DummyAudioSource::read( MediaBuffer **out, const MediaSource::ReadOptio status_t err = OK; //LOG2("DummyAudioSource::read START"); MediaBuffer *buffer; - int32_t byteCount; int64_t seekTimeUs; ReadOptions::SeekMode mode; @@ -180,13 +179,8 @@ status_t DummyAudioSource::read( MediaBuffer **out, const MediaSource::ReadOptio return err; } - uint8_t *inputPtr = - ( uint8_t *)buffer->data() + buffer->range_offset(); - - //TODO: replace with memset - for (byteCount = 0; byteCount < (mNumberOfSamplePerFrame << 1); byteCount++) { - inputPtr[byteCount] = 0; - } + memset((uint8_t *) buffer->data() + buffer->range_offset(), + 0, mNumberOfSamplePerFrame << 1); buffer->set_range(buffer->range_offset(), (mNumberOfSamplePerFrame << 1)); diff --git a/libvideoeditor/lvpp/DummyAudioSource.h b/libvideoeditor/lvpp/DummyAudioSource.h index 6e6ead4..bb3f4a2 100755 --- a/libvideoeditor/lvpp/DummyAudioSource.h +++ b/libvideoeditor/lvpp/DummyAudioSource.h @@ -63,7 +63,6 @@ private: int32_t mNumberOfSamplePerFrame; int64_t mAudioDurationUs; int64_t mTimeStampUs; - int32_t mNbBuffer; Mutex mLock; MediaBufferGroup *mBufferGroup; diff --git a/libvideoeditor/lvpp/DummyVideoSource.h b/libvideoeditor/lvpp/DummyVideoSource.h index 6fcc0a9..686e637 100755 --- a/libvideoeditor/lvpp/DummyVideoSource.h +++ b/libvideoeditor/lvpp/DummyVideoSource.h @@ -21,7 +21,6 @@ #include #include -#include #include #include #include "OMX_IVCommon.h" @@ -36,7 +35,6 @@ namespace android { class MediaBuffer; class MetaData; -struct MediaBufferGroup; struct DummyVideoSource : public MediaSource { @@ -63,7 +61,6 @@ private: uint64_t mImageClipDuration; const char *mUri; int64_t mFrameTimeUs; - MediaBufferGroup *mBufferGroup; bool mIsFirstImageFrame; void *mImageBuffer; M4OSA_Time mImagePlayStartTime; -- cgit v1.1