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

Commit 04abbff9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "RELAND CCodec: don't drop metadata for output with flag FLAG_DROP_FRAME." am: 160e69bf

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

Change-Id: I46d721193aaba14fb8028dbe4ebe25b5ddb999ee
parents 6204793c 160e69bf
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1421,6 +1421,10 @@ void CCodec::configure(const sp<AMessage> &msg) {
            }
        }

        if (config->mTunneled) {
            config->mOutputFormat->setInt32("android._tunneled", 1);
        }

        ALOGD("setup formats input: %s",
                config->mInputFormat->debugString().c_str());
        ALOGD("setup formats output: %s",
+20 −3
Original line number Diff line number Diff line
@@ -1385,6 +1385,12 @@ status_t CCodecBufferChannel::start(
                }
            }
        }

        int32_t tunneled = 0;
        if (!outputFormat->findInt32("android._tunneled", &tunneled)) {
            tunneled = 0;
        }
        mTunneled = (tunneled != 0);
    }

    // Set up pipeline control. This has to be done after mInputBuffers and
@@ -1887,11 +1893,22 @@ bool CCodecBufferChannel::handleWork(
        }
    }

    bool drop = false;
    if (worklet->output.flags & C2FrameData::FLAG_DROP_FRAME) {
        ALOGV("[%s] onWorkDone: drop buffer but keep metadata", mName);
        drop = true;
    }

    if (notifyClient && !buffer && !flags) {
        if (mTunneled && drop && outputFormat) {
            ALOGV("[%s] onWorkDone: Keep tunneled, drop frame with format change (%lld)",
                  mName, work->input.ordinal.frameIndex.peekull());
        } else {
            ALOGV("[%s] onWorkDone: Not reporting output buffer (%lld)",
                  mName, work->input.ordinal.frameIndex.peekull());
            notifyClient = false;
        }
    }

    if (buffer) {
        for (const std::shared_ptr<const C2Info> &info : buffer->info()) {
+2 −0
Original line number Diff line number Diff line
@@ -323,6 +323,8 @@ private:
        return mCrypto != nullptr || mDescrambler != nullptr;
    }
    std::atomic_bool mSendEncryptedInfoBuffer;

    std::atomic_bool mTunneled;
};

// Conversion of a c2_status_t value to a status_t value may depend on the