Loading media/codec2/sfplugin/Codec2Buffer.cpp +18 −5 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define LOG_TAG "Codec2Buffer" #include <utils/Log.h> #include <android-base/properties.h> #include <android/hardware/cas/native/1.0/types.h> #include <android/hardware/drm/1.0/types.h> #include <hidlmemory/FrameworkUtils.h> Loading Loading @@ -580,7 +581,23 @@ GraphicMetadataBuffer::GraphicMetadataBuffer( } std::shared_ptr<C2Buffer> GraphicMetadataBuffer::asC2Buffer() { #ifndef __LP64__ #ifdef __LP64__ static std::once_flag s_checkOnce; static bool s_64bitonly {false}; std::call_once(s_checkOnce, [&](){ const std::string abi32list = ::android::base::GetProperty("ro.product.cpu.abilist32", ""); if (abi32list.empty()) { s_64bitonly = true; } }); if (!s_64bitonly) { ALOGE("GraphicMetadataBuffer does not work in 32+64 system if compiled as 64-bit object"); return nullptr; } #endif VideoNativeMetadata *meta = (VideoNativeMetadata *)base(); ANativeWindowBuffer *buffer = (ANativeWindowBuffer *)meta->pBuffer; if (buffer == nullptr) { Loading Loading @@ -613,10 +630,6 @@ std::shared_ptr<C2Buffer> GraphicMetadataBuffer::asC2Buffer() { } return C2Buffer::CreateGraphicBuffer( block->share(C2Rect(buffer->width, buffer->height), C2Fence())); #else ALOGE("GraphicMetadataBuffer does not work on 64-bit arch"); return nullptr; #endif } // ConstGraphicBlockBuffer Loading Loading
media/codec2/sfplugin/Codec2Buffer.cpp +18 −5 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define LOG_TAG "Codec2Buffer" #include <utils/Log.h> #include <android-base/properties.h> #include <android/hardware/cas/native/1.0/types.h> #include <android/hardware/drm/1.0/types.h> #include <hidlmemory/FrameworkUtils.h> Loading Loading @@ -580,7 +581,23 @@ GraphicMetadataBuffer::GraphicMetadataBuffer( } std::shared_ptr<C2Buffer> GraphicMetadataBuffer::asC2Buffer() { #ifndef __LP64__ #ifdef __LP64__ static std::once_flag s_checkOnce; static bool s_64bitonly {false}; std::call_once(s_checkOnce, [&](){ const std::string abi32list = ::android::base::GetProperty("ro.product.cpu.abilist32", ""); if (abi32list.empty()) { s_64bitonly = true; } }); if (!s_64bitonly) { ALOGE("GraphicMetadataBuffer does not work in 32+64 system if compiled as 64-bit object"); return nullptr; } #endif VideoNativeMetadata *meta = (VideoNativeMetadata *)base(); ANativeWindowBuffer *buffer = (ANativeWindowBuffer *)meta->pBuffer; if (buffer == nullptr) { Loading Loading @@ -613,10 +630,6 @@ std::shared_ptr<C2Buffer> GraphicMetadataBuffer::asC2Buffer() { } return C2Buffer::CreateGraphicBuffer( block->share(C2Rect(buffer->width, buffer->height), C2Fence())); #else ALOGE("GraphicMetadataBuffer does not work on 64-bit arch"); return nullptr; #endif } // ConstGraphicBlockBuffer Loading