summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-12-05 15:54:51 -0800
committerLajos Molnar <lajos@google.com>2014-12-05 16:05:58 -0800
commit4e865a3cfe4c955e0890321a6b488cf661808b63 (patch)
tree468dc095999eef48d402e92af1b6b80eaed36333 /media/libstagefright/ACodec.cpp
parenta147c17adabaab819ac108fbc448c49525cf74bc (diff)
downloadframeworks_av-4e865a3cfe4c955e0890321a6b488cf661808b63.zip
frameworks_av-4e865a3cfe4c955e0890321a6b488cf661808b63.tar.gz
frameworks_av-4e865a3cfe4c955e0890321a6b488cf661808b63.tar.bz2
stagefright: preserve output format flags on format change
Some flags are only set in configure, and get lost when output format changes. Bug: 17383204 Change-Id: I2011bce70920c4ee46fccc378da3b428f3395c11
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 1413635..1a9b012 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1158,7 +1158,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;
@@ -1543,6 +1543,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;
@@ -3533,7 +3535,7 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> &notify) {
}
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);
@@ -4648,6 +4650,7 @@ void ACodec::LoadedState::stateEntered() {
mCodec->mRepeatFrameDelayUs = -1ll;
mCodec->mInputFormat.clear();
mCodec->mOutputFormat.clear();
+ mCodec->mBaseOutputFormat.clear();
if (mCodec->mShutdownInProgress) {
bool keepComponentAllocated = mCodec->mKeepComponentAllocated;