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

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

Merge "Codec2Buffer: Update 64bit check in asC2Buffer"

parents 6c003666 9aedd3ab
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