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

Commit f60cbe56 authored by Robert Shih's avatar Robert Shih
Browse files

nuplayer2: pass crypto info from extractor to decoder

Bug: 121387877
Test: MediaPlayer2DrmTest
Change-Id: Iabe59aaffe2b0fae2f5a8420566b41ff324d0758
parent 73142871
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1286,6 +1286,11 @@ void NuPlayer2::GenericSource2::readBuffer(
            mVideoTimeUs = timeUs;
        }

        sp<AMediaCodecCryptoInfoWrapper> cryptInfo = extractor->getSampleCryptoInfo();
        if (cryptInfo != NULL) {
            meta->setObject("cryptInfo", cryptInfo);
        }

        queueDiscontinuityIfNeeded(seeking, formatChange, trackType, track);

        if (numBuffers == 0 && actualTimeUs != nullptr) {
+5 −0
Original line number Diff line number Diff line
@@ -1108,6 +1108,11 @@ bool NuPlayer2::Decoder::onInputBufferFetched(const sp<AMessage> &msg) {
            } // buffer->data()
        } // needsCopy

        sp<RefBase> cryptInfoObj;
        if (buffer->meta()->findObject("cryptInfo", &cryptInfoObj)) {
            cryptInfo = static_cast<AMediaCodecCryptoInfoWrapper *>(cryptInfoObj.get());
        }

        status_t err;
        if (cryptInfo != NULL) {
            err = mCodec->queueSecureInputBuffer(