diff options
author | Lajos Molnar <lajos@google.com> | 2014-12-09 23:18:16 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-09 23:18:16 +0000 |
commit | ccc3113681e2878e9c3ef98215f51db79ac034cc (patch) | |
tree | b2240321e71a4f20bfd81165df9cc58ac82059f8 | |
parent | 230e8b2b843666c2803d6b3ea3a5276381b1ecfb (diff) | |
parent | e09bf82465ff83f4da966b77d551367f7c050154 (diff) | |
download | frameworks_av-ccc3113681e2878e9c3ef98215f51db79ac034cc.zip frameworks_av-ccc3113681e2878e9c3ef98215f51db79ac034cc.tar.gz frameworks_av-ccc3113681e2878e9c3ef98215f51db79ac034cc.tar.bz2 |
am e09bf824: am 6874ed79: am a9d2f9fb: Merge "stagefright: preserve output format flags on format change" into lmp-mr1-dev
* commit 'e09bf82465ff83f4da966b77d551367f7c050154':
stagefright: preserve output format flags on format change
-rw-r--r-- | include/media/stagefright/ACodec.h | 1 | ||||
-rw-r--r-- | media/libstagefright/ACodec.cpp | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index fcccc6d..4d4ce90 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -182,6 +182,7 @@ private: sp<ANativeWindow> mNativeWindow; sp<AMessage> mInputFormat; sp<AMessage> mOutputFormat; + sp<AMessage> mBaseOutputFormat; Vector<BufferInfo> mBuffers[2]; bool mPortEOS[2]; diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 7dfd8d6..ef21c9a 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -1157,7 +1157,7 @@ status_t ACodec::configureCodec( } sp<AMessage> inputFormat = new AMessage(); - sp<AMessage> outputFormat = new AMessage(); + sp<AMessage> outputFormat = mNotify->dup(); // will use this for kWhatOutputFormatChanged mIsEncoder = encoder; @@ -1542,6 +1542,8 @@ status_t ACodec::configureCodec( err = setMinBufferSize(kPortIndexInput, 8192); // XXX } + mBaseOutputFormat = outputFormat; + CHECK_EQ(getPortFormat(kPortIndexInput, inputFormat), (status_t)OK); CHECK_EQ(getPortFormat(kPortIndexOutput, outputFormat), (status_t)OK); mInputFormat = inputFormat; @@ -3531,7 +3533,7 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> ¬ify) { } void ACodec::sendFormatChange(const sp<AMessage> &reply) { - sp<AMessage> notify = mNotify->dup(); + sp<AMessage> notify = mBaseOutputFormat->dup(); notify->setInt32("what", kWhatOutputFormatChanged); CHECK_EQ(getPortFormat(kPortIndexOutput, notify), (status_t)OK); @@ -4645,6 +4647,7 @@ void ACodec::LoadedState::stateEntered() { mCodec->mRepeatFrameDelayUs = -1ll; mCodec->mInputFormat.clear(); mCodec->mOutputFormat.clear(); + mCodec->mBaseOutputFormat.clear(); if (mCodec->mShutdownInProgress) { bool keepComponentAllocated = mCodec->mKeepComponentAllocated; |