summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-10-01 16:39:50 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-01 16:39:51 -0700
commit1ba73d32fab532facafa867a3466fbaa763972dd (patch)
tree871820d1c79c4f561b267ad6f8604b0535f25950 /media
parente9880de9032194500afe8383ef118d33468b5fbe (diff)
parent90689fda75c343ab9328ced63e58f45eabaa33cc (diff)
downloadframeworks_av-1ba73d32fab532facafa867a3466fbaa763972dd.zip
frameworks_av-1ba73d32fab532facafa867a3466fbaa763972dd.tar.gz
frameworks_av-1ba73d32fab532facafa867a3466fbaa763972dd.tar.bz2
Merge "Optionally have SurfaceMediaSource return absolute timestamps" into jb-mr1-dev
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/SurfaceMediaSource.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/media/libstagefright/SurfaceMediaSource.cpp b/media/libstagefright/SurfaceMediaSource.cpp
index 97f9c7c..3c002fc 100644
--- a/media/libstagefright/SurfaceMediaSource.cpp
+++ b/media/libstagefright/SurfaceMediaSource.cpp
@@ -46,8 +46,8 @@ SurfaceMediaSource::SurfaceMediaSource(uint32_t bufferWidth, uint32_t bufferHeig
mNumFramesReceived(0),
mNumFramesEncoded(0),
mFirstFrameTimestamp(0),
- mMaxAcquiredBufferCount(4) // XXX double-check the default
-{
+ mMaxAcquiredBufferCount(4), // XXX double-check the default
+ mUseAbsoluteTimestamps(false) {
ALOGV("SurfaceMediaSource");
if (bufferWidth == 0 || bufferHeight == 0) {
@@ -188,6 +188,13 @@ status_t SurfaceMediaSource::setMaxAcquiredBufferCount(size_t count) {
return OK;
}
+status_t SurfaceMediaSource::setUseAbsoluteTimestamps() {
+ ALOGV("setUseAbsoluteTimestamps");
+ Mutex::Autolock lock(mMutex);
+ mUseAbsoluteTimestamps = true;
+
+ return OK;
+}
status_t SurfaceMediaSource::stop()
{
@@ -298,7 +305,7 @@ status_t SurfaceMediaSource::read( MediaBuffer **buffer,
}
// check for the timing of this buffer
- if (mNumFramesReceived == 0) {
+ if (mNumFramesReceived == 0 && !mUseAbsoluteTimestamps) {
mFirstFrameTimestamp = item.mTimestamp;
// Initial delay
if (mStartTimeNs > 0) {