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

Commit 420a7d29 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12991197 from 7ad1b46d to 25Q2-release

Change-Id: I586c88c3a4188faab582a611d81c9ffc2eca4cfd
parents a23a744d 7ad1b46d
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -1177,6 +1177,16 @@ void C2SoftApvEnc::createCsdData(const std::unique_ptr<C2Work>& work,
    number_of_frame_info = 1;  // The real-time encoding on the device is assumed to be 1.

    std::vector<uint8_t> csdData;

    //TODO(b/392976813): These 4 lines need to be removed once test data are fixed.
    csdData.push_back((uint8_t)0x0);
    csdData.push_back((uint8_t)0x0);
    csdData.push_back((uint8_t)0x0);
    csdData.push_back((uint8_t)0x0);

    //TODO(b/392976819) This need to be removed once OpenAPV is fixed.
    bit_depth_minus8 = 2;

    csdData.push_back((uint8_t)0x1);
    csdData.push_back(number_of_configuration_entry);

@@ -1197,8 +1207,8 @@ void C2SoftApvEnc::createCsdData(const std::unique_ptr<C2Work>& work,
            csdData.push_back((uint8_t)((frame_height_minus1 >> 16) & 0xff));
            csdData.push_back((uint8_t)((frame_height_minus1 >> 8) & 0xff));
            csdData.push_back((uint8_t)(frame_height_minus1 & 0xff));
            csdData.push_back((uint8_t)(((chroma_format_idc << 4) & 0xf0) |
                                      (bit_depth_minus8 & 0xf)));
            csdData.push_back((uint8_t)(((bit_depth_minus8 << 4) & 0xf0) |
                                      (chroma_format_idc & 0xf)));
            csdData.push_back((uint8_t)(capture_time_distance));
            if (color_description_present_flag) {
                csdData.push_back(color_primaries);
+25 −6
Original line number Diff line number Diff line
@@ -154,6 +154,12 @@ struct C2_HIDE _C2FlexHelper<S[],
    enum : uint32_t { FLEX_SIZE = sizeof(S) };
};

/**
 * Simple wrapper class for size_t, so that we can define a T::operator new(size_t, _C2FlexCount)
 * because T::operator new(size_t, size_t) is disallowed by the C++ standard.
 */
enum class _C2FlexCount : size_t {};

/**
 * \brief Helper class to check flexible struct requirements and add common operations.
 *
@@ -178,6 +184,11 @@ public:
    // default constructor needed because of the disabled copy constructor
    inline _C2FlexStructCheck() = default;

    /// usual delete operator, needed because the class also has a placement delete operator
    inline void operator delete(void* ptr) noexcept {
        ::operator delete(ptr);
    }

protected:
    // cannot copy flexible params
    _C2FlexStructCheck(const _C2FlexStructCheck<S, ParamIndex, TypeFlags> &) = delete;
@@ -202,14 +213,19 @@ protected:
    }

    /// dynamic new operator usable for params of type S
    inline void* operator new(size_t size, size_t flexCount) noexcept {
    inline void* operator new(size_t size, _C2FlexCount flexCount) noexcept {
        // TODO: assert(size == BASE_SIZE);
        size = CalcSize(flexCount, size);
        size = CalcSize(static_cast<size_t>(flexCount), size);
        if (size > 0) {
            return ::operator new(size);
        }
        return nullptr;
    }

    /// placement delete, called during placement new if constructor throws
    inline void operator delete(void* ptr, _C2FlexCount) noexcept {
        ::operator delete(ptr);
    }
};

/// Define equality (and inequality) operators for params.
@@ -262,21 +278,24 @@ protected:
#define DEFINE_FLEXIBLE_ALLOC(_Type, S, ptr, Ptr) \
    template<typename ...Args> \
    inline static std::ptr##_ptr<_Type> Alloc##Ptr(size_t flexCount, const Args(&... args)) { \
        return std::ptr##_ptr<_Type>(new(flexCount) _Type(flexCount, args...)); \
        return std::ptr##_ptr<_Type>(new(static_cast<_C2FlexCount>(flexCount)) \
            _Type(flexCount, args...)); \
    } \
    template<typename ...Args, typename U=typename S::FlexType> \
    inline static std::ptr##_ptr<_Type> Alloc##Ptr( \
            const std::initializer_list<U> &init, const Args(&... args)) { \
        return std::ptr##_ptr<_Type>(new(init.size()) _Type(init.size(), args..., init)); \
        return std::ptr##_ptr<_Type>(new(static_cast<_C2FlexCount>(init.size())) \
            _Type(init.size(), args..., init)); \
    } \
    template<typename ...Args, typename U=typename S::FlexType> \
    inline static std::ptr##_ptr<_Type> Alloc##Ptr( \
            const std::vector<U> &init, const Args(&... args)) { \
        return std::ptr##_ptr<_Type>(new(init.size()) _Type(init.size(), args..., init)); \
        return std::ptr##_ptr<_Type>(new(static_cast<_C2FlexCount>(init.size())) \
            _Type(init.size(), args..., init)); \
    } \
    template<typename ...Args, typename U=typename S::FlexType, unsigned N> \
    inline static std::ptr##_ptr<_Type> Alloc##Ptr(const U(&init)[N], const Args(&... args)) { \
        return std::ptr##_ptr<_Type>(new(N) _Type(N, args..., init)); \
        return std::ptr##_ptr<_Type>(new(static_cast<_C2FlexCount>(N)) _Type(N, args..., init)); \
    } \

/**
+14 −0
Original line number Diff line number Diff line
@@ -191,6 +191,20 @@ cc_fuzz {
    ],
}

cc_fuzz {
    name: "C2FuzzerAPVDec",
    defaults: ["C2Fuzzer-defaults"],

    cflags: [
        "-DC2COMPONENTNAME=\"c2.android.apv.decoder\"",
    ],

    static_libs: [
        "libopenapv",
        "libcodec2_soft_apvdec",
    ],
}

cc_fuzz {
    name: "C2FuzzerAacDec",
    defaults: ["C2Fuzzer-defaults-shipped"],
+96 −0
Original line number Diff line number Diff line
@@ -54,6 +54,89 @@ cc_library {
    ],
}

// DO NOT DEPEND ON THIS DIRECTLY
// use libcodec2-aidl-noisurface-defaults instead
cc_library {
    name: "libcodec2_aidl_noisurface",
    min_sdk_version: "30",
    vendor_available: true,
    apex_available: [
        "//apex_available:platform",
        "com.android.media.swcodec",
    ],

    defaults: [
        "aconfig_lib_cc_static_link.defaults",
        "libcodec2_hal_selection",
    ],

    srcs: [
        "BufferTypes.cpp",
        "Component.cpp",
        "ComponentInterface.cpp",
        "ComponentStore.cpp",
        "Configurable.cpp",
        "InputBufferManager.cpp",
        "ParamTypes.cpp",
    ],

    header_libs: [
        "libcodec2_internal", // private
    ],

    shared_libs: [
        "android.hardware.common-V2-ndk",
        "android.hardware.media.bufferpool2-V2-ndk",
        "android.hardware.media.c2-V1-ndk",
        "libbase",
        "libbinder_ndk",
        "libcodec2",
        "libcodec2_hal_common",
        "libcodec2_hidl_plugin_stub",
        "libcodec2_vndk",
        "libcutils",
        "libhidlbase",
        "liblog",
        "libnativewindow",
        "libstagefright_aidl_bufferpool2",
        "libstagefright_bufferpool@2.0.1",
        "libui",
        "libutils",
    ],

    static_libs: [
        "libaidlcommonsupport",
    ],

    target: {
        vendor: {
            exclude_shared_libs: [
                "libcodec2_hidl_plugin_stub",
            ],
            shared_libs: [
                "libcodec2_hidl_plugin",
            ],
        },
        apex: {
            exclude_shared_libs: [
                "libcodec2_hidl_plugin_stub",
                "libcodec2_hidl_plugin",
            ],
        },
    },

    export_include_dirs: [
        "include",
    ],

    export_shared_lib_headers: [
        "android.hardware.media.c2-V1-ndk",
        "libcodec2",
        "libstagefright_bufferpool@2.0.1",
        "libui",
    ],
}

// DO NOT DEPEND ON THIS DIRECTLY
// use libcodec2-aidl-defaults instead
cc_library {
@@ -140,6 +223,19 @@ cc_library {
    ],
}

// public dependency for Codec 2.0 HAL service implementations
cc_defaults {
    name: "libcodec2-aidl-noisurface-defaults",
    min_sdk_version: "30",
    defaults: ["libcodec2-impl-defaults"],

    shared_libs: [
        "android.hardware.media.c2-V1-ndk",
        "libbinder_ndk",
        "libcodec2_aidl_noisurface",
    ],
}

// public dependency for Codec 2.0 HAL service implementations
cc_defaults {
    name: "libcodec2-aidl-defaults",
+5 −2
Original line number Diff line number Diff line
@@ -1184,7 +1184,8 @@ binder::Status CameraDeviceClient::createStream(
        bool isDepthCompositeStream =
                camera3::DepthCompositeStream::isDepthCompositeStream(surfaceHolders[0].mSurface);
        bool isHeicCompositeStream = camera3::HeicCompositeStream::isHeicCompositeStream(
                surfaceHolders[0].mSurface);
                surfaceHolders[0].mSurface, mDevice->isCompositeHeicDisabled(),
                mDevice->isCompositeHeicUltraHDRDisabled());
        bool isJpegRCompositeStream =
            camera3::JpegRCompositeStream::isJpegRCompositeStream(surfaceHolders[0].mSurface) &&
            !mDevice->isCompositeJpegRDisabled();
@@ -2173,7 +2174,9 @@ binder::Status CameraDeviceClient::switchToOffline(
            sp<Surface> s = new Surface(surface, false /*controlledByApp*/);
#endif
            isCompositeStream = camera3::DepthCompositeStream::isDepthCompositeStream(s) ||
                                camera3::HeicCompositeStream::isHeicCompositeStream(s) ||
                                camera3::HeicCompositeStream::isHeicCompositeStream(
                                        s, mDevice->isCompositeHeicDisabled(),
                                        mDevice->isCompositeHeicUltraHDRDisabled()) ||
                                (camera3::JpegRCompositeStream::isJpegRCompositeStream(s) &&
                                 !mDevice->isCompositeJpegRDisabled());
            if (isCompositeStream) {
Loading