summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/StagefrightRecorder.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-01-19 20:42:19 -0800
committerJames Dong <jdong@google.com>2011-01-20 06:58:16 -0800
commit7bd460110b27a979384dda351788eac95d8467f5 (patch)
treecd228aa4d17773047de7bcc1976892bcb979a229 /media/libmediaplayerservice/StagefrightRecorder.cpp
parent886c09ee81eb7b8878e487c7f801ea8ddb27c17c (diff)
downloadframeworks_av-7bd460110b27a979384dda351788eac95d8467f5.zip
frameworks_av-7bd460110b27a979384dda351788eac95d8467f5.tar.gz
frameworks_av-7bd460110b27a979384dda351788eac95d8467f5.tar.bz2
Eliminate recording sound by starting the video track before audio track.
Due to the variable delays in the system, the recording sound can still be heard if the audio track is started early. This happens even after we suppress a relative long period of initial audio for a recording session. By starting the video track before the audio track, we effectively play the recording sound earlier. bug - 3371141 Change-Id: I2cccf77eae953d96827fc080c618b1d962445c26
Diffstat (limited to 'media/libmediaplayerservice/StagefrightRecorder.cpp')
-rw-r--r--media/libmediaplayerservice/StagefrightRecorder.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 153b2a6..65df68c 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -1295,12 +1295,6 @@ status_t StagefrightRecorder::setupMPEG4Recording(
status_t err = OK;
sp<MediaWriter> writer = new MPEG4Writer(outputFd);
- // Add audio source first if it exists
- if (!mCaptureTimeLapse && (mAudioSource != AUDIO_SOURCE_LIST_END)) {
- err = setupAudioEncoder(writer);
- if (err != OK) return err;
- *totalBitRate += mAudioBitRate;
- }
if (mVideoSource == VIDEO_SOURCE_DEFAULT
|| mVideoSource == VIDEO_SOURCE_CAMERA) {
@@ -1332,6 +1326,15 @@ status_t StagefrightRecorder::setupMPEG4Recording(
*totalBitRate += videoBitRate;
}
+ // Audio source is added at the end if it exists.
+ // This help make sure that the "recoding" sound is suppressed for
+ // camcorder applications in the recorded files.
+ if (!mCaptureTimeLapse && (mAudioSource != AUDIO_SOURCE_LIST_END)) {
+ err = setupAudioEncoder(writer);
+ if (err != OK) return err;
+ *totalBitRate += mAudioBitRate;
+ }
+
if (mInterleaveDurationUs > 0) {
reinterpret_cast<MPEG4Writer *>(writer.get())->
setInterleaveDuration(mInterleaveDurationUs);