Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a518dd9a authored by Ronghua Wu's avatar Ronghua Wu
Browse files

stagefright: Fix thumbnail generation for some clips.

Fix thumbnail generation for clips that include an immediate resolution change:
* Enable dynamic resolution change, when port settings may change while we have
  filled buffers.
* Handle the case when port settings change happens right after stop is called.

Bug: 16210021
Change-Id: I8b2c48365d74ce7551f000a1f4b0711647a9796f
parent 44a5a202
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -2500,12 +2500,6 @@ void OMXCodec::onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) {
                       data1, data2);

            if (data2 == 0 || data2 == OMX_IndexParamPortDefinition) {
                // There is no need to check whether mFilledBuffers is empty or not
                // when the OMX_EventPortSettingsChanged is not meant for reallocating
                // the output buffers.
                if (data1 == kPortIndexOutput) {
                    CHECK(mFilledBuffers.empty());
                }
                onPortSettingsChanged(data1);
            } else if (data1 == kPortIndexOutput &&
                        (data2 == OMX_IndexConfigCommonOutputCrop ||
@@ -2899,7 +2893,7 @@ status_t OMXCodec::freeBuffer(OMX_U32 portIndex, size_t bufIndex) {
void OMXCodec::onPortSettingsChanged(OMX_U32 portIndex) {
    CODEC_LOGV("PORT_SETTINGS_CHANGED(%ld)", portIndex);

    CHECK_EQ((int)mState, (int)EXECUTING);
    CHECK(mState == EXECUTING || mState == EXECUTING_TO_IDLE);
    CHECK_EQ(portIndex, (OMX_U32)kPortIndexOutput);
    CHECK(!mOutputPortSettingsChangedPending);