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

Commit b2bcebca authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I8b15407d,I2667b6f5,I8c83c6b7 into main

* changes:
  codec2 hal: type conversion refactoring, step 1
  RELAND "codec2 hal: move directories around"
  RELAND "codec2 hal: Codec2ConfigurableClient to take HIDL or AIDL base"
parents 912902c1 cef7a217
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -43,8 +43,10 @@ cc_library {
        "android.hardware.media.c2@1.0",
        "android.hardware.media.c2@1.1",
        "android.hardware.media.c2@1.2",
        "android.hardware.media.c2-V1-ndk",
        "libbase",
        "libbinder",
        "libbinder_ndk",
        "libcodec2",
        "libcodec2_hidl_client@1.0",
        "libcodec2_hidl_client@1.1",
+289 −129

File changed and moved.

Preview size limit exceeded, changes collapsed.

+41 −9
Original line number Diff line number Diff line
@@ -84,6 +84,13 @@ struct IComponent;
struct IComponentStore;
}  // namespace android::hardware::media::c2::V1_2

namespace aidl::android::hardware::media::c2 {
class IComponent;
class IComponentInterface;
class IComponentStore;
class IConfigurable;
}  // namespace aidl::android::hardware::media::c2

namespace android::hardware::media::bufferpool::V2_0 {
struct IClientManager;
}  // namespace android::hardware::media::bufferpool::V2_0
@@ -106,7 +113,36 @@ namespace android {
// declaration of an inner class is not possible.
struct Codec2ConfigurableClient {

    typedef ::android::hardware::media::c2::V1_0::IConfigurable Base;
    typedef ::android::hardware::media::c2::V1_0::IConfigurable HidlBase;
    typedef ::aidl::android::hardware::media::c2::IConfigurable AidlBase;

    struct ImplBase {
        virtual ~ImplBase() = default;

        virtual const C2String& getName() const = 0;

        virtual c2_status_t query(
                const std::vector<C2Param*>& stackParams,
                const std::vector<C2Param::Index> &heapParamIndices,
                c2_blocking_t mayBlock,
                std::vector<std::unique_ptr<C2Param>>* const heapParams) const = 0;

        virtual c2_status_t config(
                const std::vector<C2Param*> &params,
                c2_blocking_t mayBlock,
                std::vector<std::unique_ptr<C2SettingResult>>* const failures) = 0;

        virtual c2_status_t querySupportedParams(
                std::vector<std::shared_ptr<C2ParamDescriptor>>* const params
                ) const = 0;

        virtual c2_status_t querySupportedValues(
                std::vector<C2FieldSupportedValuesQuery>& fields,
                c2_blocking_t mayBlock) const = 0;
    };

    explicit Codec2ConfigurableClient(const sp<HidlBase> &hidlBase);
    explicit Codec2ConfigurableClient(const std::shared_ptr<AidlBase> &aidlBase);

    const C2String& getName() const;

@@ -128,15 +164,11 @@ struct Codec2ConfigurableClient {
    c2_status_t querySupportedValues(
            std::vector<C2FieldSupportedValuesQuery>& fields,
            c2_blocking_t mayBlock) const;
private:
    struct HidlImpl;
    struct AidlImpl;

    // base cannot be null.
    Codec2ConfigurableClient(const sp<Base>& base);

protected:
    sp<Base> mBase;
    C2String mName;

    friend struct Codec2Client;
    const std::unique_ptr<ImplBase> mImpl;
};

struct Codec2Client : public Codec2ConfigurableClient {
Loading