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

Commit 80e1cf28 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...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/18919132



Change-Id: Ida8b8364963e157aa50929d5a556807bd04b9898
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e081aca3 753d3407
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);