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

Commit 16e2cc16 authored by Harish Mahendrakar's avatar Harish Mahendrakar Committed by android-build-merger
Browse files

Merge "codecs: fix MPEG2 decoder resolution change"

am: 331916a2

* commit '331916a2':
  codecs: fix MPEG2 decoder resolution change

Change-Id: Id4c6e49a6cec87cda58857525c16ab85be903868
parents 7c4d5982 331916a2
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -74,7 +74,8 @@ SoftMPEG2::SoftMPEG2(
      mIvColorFormat(IV_YUV_420P),
      mNewWidth(mWidth),
      mNewHeight(mHeight),
      mChangingResolution(false) {
      mChangingResolution(false),
      mStride(mWidth) {
    initPorts(kNumBuffers, INPUT_BUF_SIZE, kNumBuffers, CODEC_MIME_TYPE);

    // If input dump is enabled, then open create an empty file
@@ -202,6 +203,8 @@ status_t SoftMPEG2::resetDecoder() {
    /* Set number of cores/threads to be used by the codec */
    setNumCores();

    mStride = 0;

    return OK;
}

@@ -384,7 +387,8 @@ status_t SoftMPEG2::initDecoder() {
    resetPlugin();

    /* Set the run time (dynamic) parameters */
    setParams(displayStride);
    mStride = outputBufferWidth();
    setParams(mStride);

    /* Set number of cores/threads to be used by the codec */
    setNumCores();
@@ -543,6 +547,12 @@ void SoftMPEG2::onQueueFilled(OMX_U32 portIndex) {
    List<BufferInfo *> &inQueue = getPortQueue(kInputPortIndex);
    List<BufferInfo *> &outQueue = getPortQueue(kOutputPortIndex);

    if (outputBufferWidth() != mStride) {
        /* Set the run-time (dynamic) parameters */
        mStride = outputBufferWidth();
        setParams(mStride);
    }

    /* If input EOS is seen and decoder is not in flush mode,
     * set the decoder in flush mode.
     * There can be a case where EOS is sent along with last picture data
@@ -677,6 +687,8 @@ void SoftMPEG2::onQueueFilled(OMX_U32 portIndex) {
                mChangingResolution = false;
                resetDecoder();
                resetPlugin();
                mStride = outputBufferWidth();
                setParams(mStride);
                continue;
            }

+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ private:
    bool mChangingResolution;
    bool mFlushNeeded;
    bool mWaitForI;
    size_t mStride;

    status_t initDecoder();
    status_t deInitDecoder();