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

Commit 51051267 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

CCodec: put encrypted buffer in array mode right away

Bug: 118412571
Test: atest GtsMediaTestCases:WidevineH264PlaybackTests
Change-Id: Ic51339eb38e0bb877f3194dad21c151c7f49b2a3
parent 25d3eb57
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2127,6 +2127,7 @@ status_t CCodecBufferChannel::start(
            pools->inputPool = pool;
        }

        bool forceArrayMode = false;
        Mutexed<std::unique_ptr<InputBuffers>>::Locked buffers(mInputBuffers);
        if (graphic) {
            if (mInputSurface) {
@@ -2158,6 +2159,7 @@ status_t CCodecBufferChannel::start(
                }
                buffers->reset(new EncryptedLinearInputBuffers(
                        secure, mDealer, mCrypto, mHeapSeqNum, (size_t)capacity, mName));
                forceArrayMode = true;
            } else {
                buffers->reset(new LinearInputBuffers(mName));
            }
@@ -2169,6 +2171,10 @@ status_t CCodecBufferChannel::start(
        } else {
            // TODO: error
        }

        if (forceArrayMode) {
            *buffers = (*buffers)->toArrayMode(kMinInputBufferArraySize);
        }
    }

    if (outputFormat != nullptr) {