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

Commit 39aa749a authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "let outputFormat update and discard buffer" am: bd7f71fa

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

Change-Id: I6ea7bccdddb74efb1caf0836d498a7b9fce06a0b
parents 03a58995 bd7f71fa
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3505,6 +3505,20 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {

                case kWhatDrainThisBuffer:
                {
                    if ((mFlags & kFlagUseBlockModel) == 0 && mTunneled) {
                        sp<RefBase> obj;
                        CHECK(msg->findObject("buffer", &obj));
                        sp<MediaCodecBuffer> buffer = static_cast<MediaCodecBuffer *>(obj.get());
                        if (mFlags & kFlagIsAsync) {
                            // In asynchronous mode, output format change is processed immediately.
                            handleOutputFormatChangeIfNeeded(buffer);
                        } else {
                            postActivityNotificationIfPossible();
                        }
                        mBufferChannel->discardBuffer(buffer);
                        break;
                    }

                    /* size_t index = */updateBuffers(kPortIndexOutput, msg);

                    if (mState == FLUSHING