summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-08-29 18:16:03 -0700
committerEino-Ville Talvala <etalvala@google.com>2011-08-30 10:49:15 -0700
commit728e08bc3fd99dc64f436270f53c22f3457204a8 (patch)
tree6e0efa9d9432a616777db0c3ddd7c06e646d706e /include/media
parent2db44c5838fb0bb35092a19f31ee887892a451a1 (diff)
downloadframeworks_base-728e08bc3fd99dc64f436270f53c22f3457204a8.zip
frameworks_base-728e08bc3fd99dc64f436270f53c22f3457204a8.tar.gz
frameworks_base-728e08bc3fd99dc64f436270f53c22f3457204a8.tar.bz2
Fix SurfaceMediaSource timestamp handling.
Was not basing timestamps on startTimeUs. Now synchronizes properly with audio. Bug: 4510826 Change-Id: I613db0aa91e51fc75d120e65540e742d8ab2ae43
Diffstat (limited to 'include/media')
-rw-r--r--include/media/stagefright/SurfaceMediaSource.h7
1 files changed, 7 insertions, 0 deletions
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;