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

Commit 753d3407 authored by Brian Lindahl's avatar Brian Lindahl Committed by Automerger Merge Worker
Browse files

Merge "Defer peek legacy configuration until after startup" into tm-qpr-dev am: b6f22b51

parents cd6c3ef3 b6f22b51
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -3534,6 +3534,17 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
                    }
                    setState(STARTED);
                    postPendingRepliesAndDeferredMessages("kWhatStartCompleted");

                    // Now that the codec has started, configure, by default, the peek behavior to
                    // be undefined for backwards compatibility with older releases. Later, if an
                    // app explicitly enables or disables peek, the parameter will be turned off and
                    // the legacy undefined behavior is disallowed.
                    // See updateTunnelPeek called in onSetParameters for more details.
                    if (mTunneled && mTunnelPeekState == TunnelPeekState::kLegacyMode) {
                        sp<AMessage> params = new AMessage;
                        params->setInt32("android._tunnel-peek-set-legacy", 1);
                        mCodec->signalSetParameters(params);
                    }
                    break;
                }

@@ -3973,14 +3984,6 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
                mTunneled = false;
            }

            // If mTunnelPeekState is still in kLegacyMode at this point,
            // configure the codec in legacy mode
            if (mTunneled && (mTunnelPeekState == TunnelPeekState::kLegacyMode)) {
                sp<AMessage> params = new AMessage;
                params->setInt32("android._tunnel-peek-set-legacy", 1);
                onSetParameters(params);
            }

            int32_t background = 0;
            if (format->findInt32("android._background-mode", &background) && background) {
                androidSetThreadPriority(gettid(), ANDROID_PRIORITY_BACKGROUND);