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

Commit a58abbff authored by shipeng.sun's avatar shipeng.sun Committed by jie.yuan
Browse files

libstatgefright: nts OPL-001-TC4 test failed [1/1]



Bug:171534171
PD#SWPL-35082

Problem:
For tunnel mode we can't set resolution to drm, so
add it when call queueSecureInputBuffer.

Solutoin:
For tunnel mode we can't set resolution to drm, so
add it when call queueSecureInputBuffer.

Verify:
AndroidQ

Change-Id: Icddb478051402d0b5ac0db29b78222faa96d8aa7
Signed-off-by: default avatarshipeng.sun <shipeng.sun@amlogic.com>
parent 46c5b630
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -637,6 +637,9 @@ MediaCodec::MediaCodec(
      mDequeueInputReplyID(0),
      mDequeueOutputTimeoutGeneration(0),
      mDequeueOutputReplyID(0),
      mTunneledInputWidth(0),
      mTunneledInputHeight(0),
      mTunneled(false),
      mHaveInputSurface(false),
      mHavePendingInputBuffers(false),
      mCpuBoostRequested(false),
@@ -2951,6 +2954,14 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {

            extractCSD(format);

            int32_t tunneled;
            if (format->findInt32("feature-tunneled-playback", &tunneled) && tunneled != 0) {
                ALOGI("Configuring TUNNELED video playback.");
                mTunneled = true;
            } else {
                mTunneled = false;
            }

            mCodec->initiateConfigureComponent(format);
            break;
        }
@@ -3930,7 +3941,18 @@ status_t MediaCodec::onQueueInputBuffer(const sp<AMessage> &msg) {
    if (hasCryptoOrDescrambler() && !c2Buffer && !memory) {
        AString *errorDetailMsg;
        CHECK(msg->findPointer("errorDetailMsg", (void **)&errorDetailMsg));

        // Notify mCrypto of video resolution changes
        if (mTunneled && mCrypto != NULL) {
            int32_t width, height;
            if (mInputFormat->findInt32("width", &width) &&
                mInputFormat->findInt32("height", &height) && width > 0 && height > 0) {
                if (width != mTunneledInputWidth || height != mTunneledInputHeight) {
                    mTunneledInputWidth = width;
                    mTunneledInputHeight = height;
                    mCrypto->notifyResolution(width, height);
                }
            }
        }
        err = mBufferChannel->queueSecureInputBuffer(
                buffer,
                (mFlags & kFlagIsSecure),
+4 −0
Original line number Diff line number Diff line
@@ -418,6 +418,10 @@ private:

    sp<ICrypto> mCrypto;

    int32_t mTunneledInputWidth;
    int32_t mTunneledInputHeight;
    bool mTunneled;

    sp<IDescrambler> mDescrambler;

    List<sp<ABuffer> > mCSD;