summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2014-03-13 23:43:25 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-13 23:43:25 +0000
commit29c291f2337561b1f8c2f79bc34339b0b9c28b9c (patch)
treea3632cabb7b28a33985370411ec0ae9dcc0a7379 /media/libstagefright/ACodec.cpp
parent28836548337865536788799430e9fae77e996422 (diff)
parenta671f943b72155460f0c94cdd92d829cb059b571 (diff)
downloadframeworks_av-29c291f2337561b1f8c2f79bc34339b0b9c28b9c.zip
frameworks_av-29c291f2337561b1f8c2f79bc34339b0b9c28b9c.tar.gz
frameworks_av-29c291f2337561b1f8c2f79bc34339b0b9c28b9c.tar.bz2
am a671f943: am c69bc40a: Merge "Cap pts gap between adjacent frames to specified value" into klp-dev
* commit 'a671f943b72155460f0c94cdd92d829cb059b571': Cap pts gap between adjacent frames to specified value
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index d4c41d8..6dcedca 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -373,7 +373,8 @@ ACodec::ACodec()
mDequeueCounter(0),
mStoreMetaDataInOutputBuffers(false),
mMetaDataBuffersToSubmit(0),
- mRepeatFrameDelayUs(-1ll) {
+ mRepeatFrameDelayUs(-1ll),
+ mMaxPtsGapUs(-1l) {
mUninitializedState = new UninitializedState(this);
mLoadedState = new LoadedState(this);
mLoadedToIdleState = new LoadedToIdleState(this);
@@ -1115,6 +1116,10 @@ status_t ACodec::configureCodec(
&mRepeatFrameDelayUs)) {
mRepeatFrameDelayUs = -1ll;
}
+
+ if (!msg->findInt64("max-pts-gap-to-encoder", &mMaxPtsGapUs)) {
+ mMaxPtsGapUs = -1l;
+ }
}
// Always try to enable dynamic output buffers on native surface
@@ -3926,6 +3931,21 @@ void ACodec::LoadedState::onCreateInputSurface(
}
}
+ if (err == OK && mCodec->mMaxPtsGapUs > 0l) {
+ err = mCodec->mOMX->setInternalOption(
+ mCodec->mNode,
+ kPortIndexInput,
+ IOMX::INTERNAL_OPTION_MAX_TIMESTAMP_GAP,
+ &mCodec->mMaxPtsGapUs,
+ sizeof(mCodec->mMaxPtsGapUs));
+
+ if (err != OK) {
+ ALOGE("[%s] Unable to configure max timestamp gap (err %d)",
+ mCodec->mComponentName.c_str(),
+ err);
+ }
+ }
+
if (err == OK) {
notify->setObject("input-surface",
new BufferProducerWrapper(bufferProducer));