diff options
author | James Dong <jdong@google.com> | 2010-09-08 15:07:21 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-09-08 17:28:57 -0700 |
commit | 3c3763d2ee1cd1fba7fe522fbaf0faca315d8c2a (patch) | |
tree | 4763aa3d027e3583625cdf3a2eeca8720b7a8f15 | |
parent | f9c0ae8474dc7180a561ed1e7a8ba3d0d31f6d38 (diff) | |
download | frameworks_av-3c3763d2ee1cd1fba7fe522fbaf0faca315d8c2a.zip frameworks_av-3c3763d2ee1cd1fba7fe522fbaf0faca315d8c2a.tar.gz frameworks_av-3c3763d2ee1cd1fba7fe522fbaf0faca315d8c2a.tar.bz2 |
HW audio encoder expects timestamp via kKeyTime from each input buffer
- This fixes media server crashes on droid
Change-Id: I7191cadc5275107425ec3ee3d437b2c5295858dc
-rw-r--r-- | include/media/stagefright/MetaData.h | 1 | ||||
-rw-r--r-- | media/libstagefright/AudioSource.cpp | 4 | ||||
-rw-r--r-- | media/libstagefright/codecs/aacenc/AACEncoder.cpp | 2 | ||||
-rw-r--r-- | media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp | 2 | ||||
-rw-r--r-- | media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp | 2 |
5 files changed, 7 insertions, 4 deletions
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h index 1e447f1..1594e31 100644 --- a/include/media/stagefright/MetaData.h +++ b/include/media/stagefright/MetaData.h @@ -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 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; |