summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AudioSource.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-12-11 10:43:41 -0800
committerJames Dong <jdong@google.com>2010-12-11 10:57:03 -0800
commit79e23b41fad961008bfde6e26b3c6f86878ca69d (patch)
tree590d806e7ff9da6341c5185a4d7291d1de428e43 /media/libstagefright/AudioSource.cpp
parent8d45a37ff076814db39471f15d309567605b3416 (diff)
downloadframeworks_av-79e23b41fad961008bfde6e26b3c6f86878ca69d.zip
frameworks_av-79e23b41fad961008bfde6e26b3c6f86878ca69d.tar.gz
frameworks_av-79e23b41fad961008bfde6e26b3c6f86878ca69d.tar.bz2
Revert "Allows the authoring engine to skip frame."
o Skipping frames could lead to a lot of issues such as I frames is lost etc. It is not being used anyway. This reverts commit 53d4e0d58e2d5c18f6e026c705af833b9bdd7aba. Conflicts: media/libstagefright/AudioSource.cpp media/libstagefright/CameraSource.cpp Change-Id: I3abba1647de48db25bdc369066eb2a7ae4dedec2
Diffstat (limited to 'media/libstagefright/AudioSource.cpp')
-rw-r--r--media/libstagefright/AudioSource.cpp46
1 files changed, 1 insertions, 45 deletions
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp
index 29f16d8..235d752 100644
--- a/media/libstagefright/AudioSource.cpp
+++ b/media/libstagefright/AudioSource.cpp
@@ -140,38 +140,6 @@ sp<MetaData> AudioSource::getFormat() {
return meta;
}
-/*
- * Returns -1 if frame skipping request is too long.
- * Returns 0 if there is no need to skip frames.
- * Returns 1 if we need to skip frames.
- */
-static int skipFrame(int64_t timestampUs,
- const MediaSource::ReadOptions *options) {
-
- int64_t skipFrameUs;
- if (!options || !options->getSkipFrame(&skipFrameUs)) {
- return 0;
- }
-
- if (skipFrameUs <= timestampUs) {
- return 0;
- }
-
- // Safe guard against the abuse of the kSkipFrame_Option.
- if (skipFrameUs - timestampUs >= 1E6) {
- LOGE("Frame skipping requested is way too long: %lld us",
- skipFrameUs - timestampUs);
-
- return -1;
- }
-
- LOGV("skipFrame: %lld us > timestamp: %lld us",
- skipFrameUs, timestampUs);
-
- return 1;
-
-}
-
void AudioSource::rampVolume(
int32_t startFrame, int32_t rampDurationFrames,
uint8_t *data, size_t bytes) {
@@ -218,7 +186,7 @@ status_t AudioSource::read(
CHECK_EQ(mGroup->acquire_buffer(&buffer), OK);
int err = 0;
- while (mStarted) {
+ if (mStarted) {
uint32_t numFramesRecorded;
mRecord->getPosition(&numFramesRecorded);
@@ -268,12 +236,6 @@ status_t AudioSource::read(
if (mCollectStats) {
mTotalLostFrames += (numLostBytes >> 1);
}
- if ((err = skipFrame(timestampUs, options)) == -1) {
- buffer->release();
- return UNKNOWN_ERROR;
- } else if (err != 0) {
- continue;
- }
memset(buffer->data(), 0, numLostBytes);
buffer->set_range(0, numLostBytes);
if (numFramesRecorded == 0) {
@@ -294,12 +256,6 @@ status_t AudioSource::read(
int64_t recordDurationUs = (1000000LL * n >> 1) / sampleRate;
timestampUs += recordDurationUs;
- if ((err = skipFrame(timestampUs, options)) == -1) {
- buffer->release();
- return UNKNOWN_ERROR;
- } else if (err != 0) {
- continue;
- }
if (mPrevSampleTimeUs - mStartTimeUs < kAutoRampStartUs) {
// Mute the initial video recording signal