From c22f84212a7ac2398069fa56b91e1d4d668e8c6e Mon Sep 17 00:00:00 2001 From: Praveen Chavan Date: Mon, 27 Jul 2015 20:01:35 -0700 Subject: Stagefright: Do not skip frames in time-lapse-source for high-speed Avoid the frame-skip logic in time-lapse source if capture-rate exceeds video-fps. Not doing so will drop frames and also cause retrograde timestamps and an assertion in CameraSource. Change-Id: I8420e44ab96484f0d6301c366a24eefc8efeaf0f --- media/libstagefright/CameraSourceTimeLapse.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'media/libstagefright/CameraSourceTimeLapse.cpp') diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp index 0acd9d0..873e473 100644 --- a/media/libstagefright/CameraSourceTimeLapse.cpp +++ b/media/libstagefright/CameraSourceTimeLapse.cpp @@ -279,7 +279,8 @@ bool CameraSourceTimeLapse::skipFrameAndModifyTimeStamp(int64_t *timestampUs) { // The first 2 output frames from the encoder are: decoder specific info and // the compressed video frame data for the first input video frame. if (mNumFramesEncoded >= 1 && *timestampUs < - (mLastTimeLapseFrameRealTimestampUs + mTimeBetweenFrameCaptureUs)) { + (mLastTimeLapseFrameRealTimestampUs + mTimeBetweenFrameCaptureUs) && + (mTimeBetweenFrameCaptureUs > mTimeBetweenTimeLapseVideoFramesUs + 1)) { // Skip all frames from last encoded frame until // sufficient time (mTimeBetweenFrameCaptureUs) has passed. // Tell the camera to release its recording frame and return. -- cgit v1.1