summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2014-03-13 23:26:39 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-13 23:26:39 +0000
commit7c47cafa5be623f1db483483ac27f714c54dc1cc (patch)
tree11f5ad937079c6ec2900ea13f3551ff8c636ac09 /media/libstagefright/ACodec.cpp
parent5b835698486077c5b1fd81b9fd741dfd7ff37cb3 (diff)
parentc69bc40a347c411751cb082b3eb4a82d976a68ec (diff)
downloadframeworks_av-7c47cafa5be623f1db483483ac27f714c54dc1cc.zip
frameworks_av-7c47cafa5be623f1db483483ac27f714c54dc1cc.tar.gz
frameworks_av-7c47cafa5be623f1db483483ac27f714c54dc1cc.tar.bz2
am c69bc40a: Merge "Cap pts gap between adjacent frames to specified value" into klp-dev
* commit 'c69bc40a347c411751cb082b3eb4a82d976a68ec': 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 fd81a31..a0bde58 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -371,7 +371,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);
@@ -1109,6 +1110,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
@@ -3855,6 +3860,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));