From df4a59c61103e7e0e9332e167a0be67da5d82ff3 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Mon, 29 Aug 2011 18:16:03 -0700 Subject: Fix SurfaceMediaSource timestamp handling. Was not basing timestamps on startTimeUs. Now synchronizes properly with audio. Bug: 4510826 Change-Id: I613db0aa91e51fc75d120e65540e742d8ab2ae43 --- include/media/stagefright/SurfaceMediaSource.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/media/stagefright') diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h index 74d54d1..f7f0ed7 100644 --- a/include/media/stagefright/SurfaceMediaSource.h +++ b/include/media/stagefright/SurfaceMediaSource.h @@ -347,6 +347,13 @@ private: // encoder int mNumFramesEncoded; + // mFirstFrameTimestamp is the timestamp of the first received frame. + // It is used to offset the output timestamps so recording starts at time 0. + int64_t mFirstFrameTimestamp; + // mStartTimeNs is the start time passed into the source at start, used to + // offset timestamps. + int64_t mStartTimeNs; + // mFrameAvailableCondition condition used to indicate whether there // is a frame available for dequeuing Condition mFrameAvailableCondition; -- cgit v1.1