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

Commit fbdd9fcb authored by Harish Mahendrakar's avatar Harish Mahendrakar Committed by Automerger Merge Worker
Browse files

Codec2Buffer: Update 64bit check in asC2Buffer am: 731e914f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/15146210

Change-Id: Ibdf9baf54ed1eb7fa491bd4140557fcf14488d46
parents 7cfbbe06 731e914f
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