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

Commit 9aedd3ab authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

Codec2Buffer: Update 64bit check in asC2Buffer

In case of devices which support both 64bit and 32bit builds,
GraphicMetadataBuffer will return an error in 64bit builds only if
debug.stagefright.c2inputsurface is set to 0.

Bug: 178228919
Test: atest CtsMediaV2TestCases

Change-Id: I98a96bad02930947bee40e09ae4d42e684981421
parent b9e7fac1
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -679,17 +679,20 @@ GraphicMetadataBuffer::GraphicMetadataBuffer(
std::shared_ptr<C2Buffer> GraphicMetadataBuffer::asC2Buffer() {
#ifdef __LP64__
    static std::once_flag s_checkOnce;
    static bool s_64bitonly {false};
    static bool s_is64bitOk {true};
    std::call_once(s_checkOnce, [&](){
        const std::string abi32list =
        ::android::base::GetProperty("ro.product.cpu.abilist32", "");
        if (abi32list.empty()) {
            s_64bitonly = true;
        if (!abi32list.empty()) {
            int32_t inputSurfaceSetting =
            ::android::base::GetIntProperty("debug.stagefright.c2inputsurface", int32_t(0));
            s_is64bitOk = inputSurfaceSetting != 0;
        }
    });

    if (!s_64bitonly) {
        ALOGE("GraphicMetadataBuffer does not work in 32+64 system if compiled as 64-bit object");
    if (!s_is64bitOk) {
        ALOGE("GraphicMetadataBuffer does not work in 32+64 system if compiled as 64-bit object"\
              "when debug.stagefright.c2inputsurface is set to 0");
        return nullptr;
    }
#endif