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

Commit a7a04b56 authored by Arun Johnson's avatar Arun Johnson
Browse files

Moving CryptoInfo creation for Unencrypted samples

BLOCK_MODEL CryptoInfos for unencrypted samples are now created in
mediacodec. This now operates in the same way as in the normal mode.

Bug: 325512893
Test: atest android.mediav2.cts.CodecDecoderDrmTest
Test: atest android.mediav2.cts.CodecDecoderMultiAccessUnitDrmTest
Change-Id: I5a86348042748de080c7afde5eb9ce27ed35fabd
parent 2aef16f9
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -2999,18 +2999,15 @@ static void android_media_MediaCodec_native_queueLinearBlock(
                    "MediaCodec.LinearBlock#obtain method to obtain a compatible buffer.");
                    "MediaCodec.LinearBlock#obtain method to obtain a compatible buffer.");
            return;
            return;
        }
        }
        sp<CryptoInfosWrapper> cryptoInfos = new CryptoInfosWrapper{decltype(cryptoInfos->value)()};
        sp<CryptoInfosWrapper> cryptoInfos = nullptr;
        jint sampleSize = 0;
        jint sampleSize = totalSize;
        if (cryptoInfoArray != nullptr) {
        if (cryptoInfoArray != nullptr) {
            cryptoInfos = new CryptoInfosWrapper{decltype(cryptoInfos->value)()};
            extractCryptoInfosFromObjectArray(env,
            extractCryptoInfosFromObjectArray(env,
                    &sampleSize,
                    &sampleSize,
                    &cryptoInfos->value,
                    &cryptoInfos->value,
                    cryptoInfoArray,
                    cryptoInfoArray,
                    &errorDetailMsg);
                    &errorDetailMsg);
        } else {
            sampleSize = totalSize;
            std::unique_ptr<CodecCryptoInfo> cryptoInfo{new MediaCodecCryptoInfo(totalSize)};
            cryptoInfos->value.push_back(std::move(cryptoInfo));
        }
        }
        if (env->ExceptionCheck()) {
        if (env->ExceptionCheck()) {
            // Creation of cryptoInfo failed. Let the exception bubble up.
            // Creation of cryptoInfo failed. Let the exception bubble up.