diff options
author | James Dong <jdong@google.com> | 2011-02-16 12:28:26 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-02-17 14:43:16 -0800 |
commit | a472613aec322e25891abf5c77bf3f7e3c244920 (patch) | |
tree | 2b8aa12e87fff0c143d50022f9f413305dc7882f /media/libstagefright/CameraSource.cpp | |
parent | f71eb135c28dd7b305b7030776ef0d44fac732c4 (diff) | |
download | frameworks_av-a472613aec322e25891abf5c77bf3f7e3c244920.zip frameworks_av-a472613aec322e25891abf5c77bf3f7e3c244920.tar.gz frameworks_av-a472613aec322e25891abf5c77bf3f7e3c244920.tar.bz2 |
A/V synchronization at the beginning of a recording session
o do not use edts/elst boxes since these optional boxes are ignored
o manipulate the first video/audio frame duration to make sure that the rest
of the audio/video is in sync (ideally, we should only manipulate
the vidoe frame duration, not the audio)
o reduce the initial audio mute/suppression period, which is used to
eliminate the "recording" sound.
bug - 3405882 and 3362703
Change-Id: Ib0acfb4f3843b365157288951dc122b006299c18
Diffstat (limited to 'media/libstagefright/CameraSource.cpp')
-rw-r--r-- | media/libstagefright/CameraSource.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index 66e0657..8a24bc4 100644 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -598,8 +598,7 @@ status_t CameraSource::stop() { } if (mNumGlitches > 0) { - LOGW("%d long delays between neighboring video frames during", - mNumGlitches); + LOGW("%d long delays between neighboring video frames", mNumGlitches); } CHECK_EQ(mNumFramesReceived, mNumFramesEncoded + mNumFramesDropped); @@ -696,10 +695,9 @@ void CameraSource::dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, const sp<IMemory> &data) { LOGV("dataCallbackTimestamp: timestamp %lld us", timestampUs); Mutex::Autolock autoLock(mLock); - if (!mStarted) { + if (!mStarted || (mNumFramesReceived == 0 && timestampUs < mStartTimeUs)) { + LOGV("Drop frame at %lld/%lld us", timestampUs, mStartTimeUs); releaseOneRecordingFrame(data); - ++mNumFramesReceived; - ++mNumFramesDropped; return; } |