summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-06-13 00:22:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-13 00:22:56 +0000
commit95ca9aa2e1a5b42695113a1260a5e2fd81e4a80f (patch)
tree3a8073f158801b80428242fc550123278d7ee188 /media
parent2b63384b6d338f2c3320818a698c3f9d6221fe5d (diff)
parentc8edf5af010ac24a99b302a18e7b84e8b4b2b783 (diff)
downloadframeworks_av-95ca9aa2e1a5b42695113a1260a5e2fd81e4a80f.zip
frameworks_av-95ca9aa2e1a5b42695113a1260a5e2fd81e4a80f.tar.gz
frameworks_av-95ca9aa2e1a5b42695113a1260a5e2fd81e4a80f.tar.bz2
Merge "stagefright: use media timestamp for default render timestamp" into mnc-dev
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/ACodec.cpp9
-rw-r--r--media/libstagefright/MediaCodec.cpp14
2 files changed, 6 insertions, 17 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index cf37eba..f7d89e4 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -5202,16 +5202,11 @@ void ACodec::BaseState::onOutputBufferDrained(const sp<AMessage> &msg) {
int64_t timestampNs = 0;
if (!msg->findInt64("timestampNs", &timestampNs)) {
- // TODO: it seems like we should use the timestamp
- // in the (media)buffer as it potentially came from
- // an input surface, but we did not propagate it prior to
- // API 20. Perhaps check for target SDK version.
-#if 0
+ // use media timestamp if client did not request a specific render timestamp
if (info->mData->meta()->findInt64("timeUs", &timestampNs)) {
- ALOGV("using buffer PTS of %" PRId64, timestampNs);
+ ALOGV("using buffer PTS of %lld", (long long)timestampNs);
timestampNs *= 1000;
}
-#endif
}
status_t err;
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index 7ee84a8..e5b7202 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -2452,18 +2452,12 @@ status_t MediaCodec::onReleaseOutputBuffer(const sp<AMessage> &msg) {
info->mData->meta()->findInt64("timeUs", &mediaTimeUs);
int64_t renderTimeNs = 0;
- if (msg->findInt64("timestampNs", &renderTimeNs)) {
- info->mNotify->setInt64("timestampNs", renderTimeNs);
- } else {
- // TODO: it seems like we should use the timestamp
- // in the (media)buffer as it potentially came from
- // an input surface, but we did not propagate it prior to
- // API 20. Perhaps check for target SDK version.
-#if 0
- ALOGV("using buffer PTS of %" PRId64, timestampNs);
+ if (!msg->findInt64("timestampNs", &renderTimeNs)) {
+ // use media timestamp if client did not request a specific render timestamp
+ ALOGV("using buffer PTS of %lld", (long long)mediaTimeUs);
renderTimeNs = mediaTimeUs * 1000;
-#endif
}
+ info->mNotify->setInt64("timestampNs", renderTimeNs);
if (mSoftRenderer != NULL) {
std::list<FrameRenderTracker::Info> doneFrames = mSoftRenderer->render(