Merge "HW audio encoder expects timestamp via kKeyTime from each input buffer" into gingerbread

This commit is contained in:
James Dong
2010-09-08 17:51:59 -07:00
committed by Android (Google) Code Review
5 changed files with 7 additions and 4 deletions

View File

@@ -49,6 +49,7 @@ enum {
kKeyNTPTime = 'ntpT', // uint64_t (ntp-timestamp)
kKeyTargetTime = 'tarT', // int64_t (usecs)
kKeyDriftTime = 'dftT', // int64_t (usecs)
kKeyAnchorTime = 'ancT', // int64_t (usecs)
kKeyDuration = 'dura', // int64_t (usecs)
kKeyColorFormat = 'colf',
kKeyPlatformPrivate = 'priv', // pointer

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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;