am d353c840: Merge "HW audio encoder expects timestamp via kKeyTime from each input buffer" into gingerbread
Merge commit 'd353c840ad5bf1b4e6bfba0e10bcdc79223bcdf7' into gingerbread-plus-aosp * commit 'd353c840ad5bf1b4e6bfba0e10bcdc79223bcdf7': HW audio encoder expects timestamp via kKeyTime from each input buffer
This commit is contained in:
@@ -49,6 +49,7 @@ enum {
|
|||||||
kKeyNTPTime = 'ntpT', // uint64_t (ntp-timestamp)
|
kKeyNTPTime = 'ntpT', // uint64_t (ntp-timestamp)
|
||||||
kKeyTargetTime = 'tarT', // int64_t (usecs)
|
kKeyTargetTime = 'tarT', // int64_t (usecs)
|
||||||
kKeyDriftTime = 'dftT', // int64_t (usecs)
|
kKeyDriftTime = 'dftT', // int64_t (usecs)
|
||||||
|
kKeyAnchorTime = 'ancT', // int64_t (usecs)
|
||||||
kKeyDuration = 'dura', // int64_t (usecs)
|
kKeyDuration = 'dura', // int64_t (usecs)
|
||||||
kKeyColorFormat = 'colf',
|
kKeyColorFormat = 'colf',
|
||||||
kKeyPlatformPrivate = 'priv', // pointer
|
kKeyPlatformPrivate = 'priv', // pointer
|
||||||
|
|||||||
@@ -316,8 +316,10 @@ status_t AudioSource::read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (numFramesRecorded == 0) {
|
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);
|
buffer->meta_data()->setInt64(kKeyDriftTime, readTimeUs - mInitialReadTimeUs);
|
||||||
CHECK(timestampUs > mPrevSampleTimeUs);
|
CHECK(timestampUs > mPrevSampleTimeUs);
|
||||||
mPrevSampleTimeUs = timestampUs;
|
mPrevSampleTimeUs = timestampUs;
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ status_t AACEncoder::read(
|
|||||||
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
|
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
|
||||||
wallClockTimeUs = timeUs;
|
wallClockTimeUs = timeUs;
|
||||||
}
|
}
|
||||||
if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) {
|
if (mInputBuffer->meta_data()->findInt64(kKeyAnchorTime, &timeUs)) {
|
||||||
mAnchorTimeUs = timeUs;
|
mAnchorTimeUs = timeUs;
|
||||||
}
|
}
|
||||||
readFromSource = true;
|
readFromSource = true;
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ status_t AMRNBEncoder::read(
|
|||||||
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
|
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
|
||||||
wallClockTimeUs = timeUs;
|
wallClockTimeUs = timeUs;
|
||||||
}
|
}
|
||||||
if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) {
|
if (mInputBuffer->meta_data()->findInt64(kKeyAnchorTime, &timeUs)) {
|
||||||
mAnchorTimeUs = timeUs;
|
mAnchorTimeUs = timeUs;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ status_t AMRWBEncoder::read(
|
|||||||
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
|
if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) {
|
||||||
wallClockTimeUs = timeUs;
|
wallClockTimeUs = timeUs;
|
||||||
}
|
}
|
||||||
if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) {
|
if (mInputBuffer->meta_data()->findInt64(kKeyAnchorTime, &timeUs)) {
|
||||||
mAnchorTimeUs = timeUs;
|
mAnchorTimeUs = timeUs;
|
||||||
}
|
}
|
||||||
readFromSource = true;
|
readFromSource = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user