summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-09-08 17:51:59 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-08 17:51:59 -0700
commitd353c840ad5bf1b4e6bfba0e10bcdc79223bcdf7 (patch)
tree63e02f1e03b8bea17ad4dd2b5d255b61052d080c /media
parent46b84d5b4a44dbab8e0f6ee11f3ab42e11ce97bb (diff)
parentd015ccf62b4e87756e2f7785af92338d35a21c15 (diff)
downloadframeworks_base-d353c840ad5bf1b4e6bfba0e10bcdc79223bcdf7.zip
frameworks_base-d353c840ad5bf1b4e6bfba0e10bcdc79223bcdf7.tar.gz
frameworks_base-d353c840ad5bf1b4e6bfba0e10bcdc79223bcdf7.tar.bz2
Merge "HW audio encoder expects timestamp via kKeyTime from each input buffer" into gingerbread
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/AudioSource.cpp4
-rw-r--r--media/libstagefright/codecs/aacenc/AACEncoder.cpp2
-rw-r--r--media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp2
-rw-r--r--media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp2
4 files changed, 6 insertions, 4 deletions
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp
index c2f79e8..8d7ada3 100644
--- a/media/libstagefright/AudioSource.cpp
+++ b/media/libstagefright/AudioSource.cpp
@@ -316,8 +316,10 @@ status_t AudioSource::read(
}
if (numFramesRecorded == 0) {
- buffer->meta_data()->setInt64(kKeyTime, mStartTimeUs);
+ buffer->meta_data()->setInt64(kKeyAnchorTime, mStartTimeUs);
}
+
+ buffer->meta_data()->setInt64(kKeyTime, mStartTimeUs + mPrevSampleTimeUs);
buffer->meta_data()->setInt64(kKeyDriftTime, readTimeUs - mInitialReadTimeUs);
CHECK(timestampUs > mPrevSampleTimeUs);
mPrevSampleTimeUs = timestampUs;
diff --git a/media/libstagefright/codecs/aacenc/AACEncoder.cpp b/media/libstagefright/codecs/aacenc/AACEncoder.cpp
index e391c72..df9f107 100644
--- a/media/libstagefright/codecs/aacenc/AACEncoder.cpp
+++ b/media/libstagefright/codecs/aacenc/AACEncoder.cpp
@@ -243,7 +243,7 @@ status_t AACEncoder::read(
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
wallClockTimeUs = timeUs;
}
- if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) {
+ if (mInputBuffer->meta_data()->findInt64(kKeyAnchorTime, &timeUs)) {
mAnchorTimeUs = timeUs;
}
readFromSource = true;
diff --git a/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp b/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp
index 858e6d0..94a79ab 100644
--- a/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp
+++ b/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp
@@ -174,7 +174,7 @@ status_t AMRNBEncoder::read(
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
wallClockTimeUs = timeUs;
}
- if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) {
+ if (mInputBuffer->meta_data()->findInt64(kKeyAnchorTime, &timeUs)) {
mAnchorTimeUs = timeUs;
}
} else {
diff --git a/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp b/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp
index cd28413..002f055 100644
--- a/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp
+++ b/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp
@@ -224,7 +224,7 @@ status_t AMRWBEncoder::read(
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
wallClockTimeUs = timeUs;
}
- if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) {
+ if (mInputBuffer->meta_data()->findInt64(kKeyAnchorTime, &timeUs)) {
mAnchorTimeUs = timeUs;
}
readFromSource = true;