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

Commit 6eec57fb authored by Wonsik Kim's avatar Wonsik Kim
Browse files

codec2 hidl plugin samples: implement queryParamsForPreviousComponent

Bug: 186891056
Test: atest android.media.cts.DecoderTest
Change-Id: I590426f636501adfb727ac024c1d087da2b4c91d
parent 5769742e
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -114,6 +114,16 @@ public:
            }
            return info && info.transfer == C2Color::TRANSFER_170M;
        }

        static c2_status_t QueryParamsForPreviousComponent(
                [[maybe_unused]] const std::shared_ptr<C2ComponentInterface> &intf,
                std::vector<std::unique_ptr<C2Param>> *params) {
            params->emplace_back(new C2StreamUsageTuning::output(
                    0u, C2AndroidMemoryUsage::HW_TEXTURE_READ));
            params->emplace_back(new C2StreamPixelFormatInfo::output(
                    0u, HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED));
            return C2_OK;
        }
    private:
        const c2_node_id_t mId;
        std::shared_ptr<C2ReflectorHelper> mReflector;
@@ -946,6 +956,16 @@ public:
        return false;
    }

    c2_status_t queryParamsForPreviousComponent(
            const std::shared_ptr<C2ComponentInterface> &intf,
            std::vector<std::unique_ptr<C2Param>> *params) override {
        if (intf->getName() == SampleToneMappingFilter::Interface::NAME) {
            return SampleToneMappingFilter::Interface::QueryParamsForPreviousComponent(
                    intf, params);
        }
        return C2_BAD_VALUE;
    }

private:
    std::shared_ptr<C2ComponentStore> mStore;
};