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

Commit f3367cf4 authored by Lajos Molnar's avatar Lajos Molnar Committed by Automerger Merge Worker
Browse files

Merge "CCodec: Report codec error to MediaCodec" am: 5b7d0abc am: 4c3e6870

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icff719bc2fd32c66ae998a632d2e62ae5a1b0035
parents 4190e477 4c3e6870
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -518,9 +518,24 @@ struct CCodec::ClientListener : public Codec2Client::Listener {
    virtual void onError(
            const std::weak_ptr<Codec2Client::Component>& component,
            uint32_t errorCode) override {
        // TODO
        (void)component;
        (void)errorCode;
        {
            // Component is only used for reporting as we use a separate listener for each instance
            std::shared_ptr<Codec2Client::Component> comp = component.lock();
            if (!comp) {
                ALOGD("Component died with error: 0x%x", errorCode);
            } else {
                ALOGD("Component \"%s\" returned error: 0x%x", comp->getName().c_str(), errorCode);
            }
        }

        // Report to MediaCodec
        // Note: for now we do not propagate the error code to MediaCodec as we would need
        // to translate to a MediaCodec error.
        sp<CCodec> codec(mCodec.promote());
        if (!codec || !codec->mCallback) {
            return;
        }
        codec->mCallback->onError(UNKNOWN_ERROR, ACTION_CODE_FATAL);
    }

    virtual void onDeath(