Loading media/codec2/vndk/C2AllocatorGralloc.cpp +10 −4 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,10 @@ namespace /* unnamed */ { static_assert((~C2MemoryUsage::PLATFORM_MASK & PASSTHROUGH_USAGE_MASK) == 0, ""); static_assert((~C2MemoryUsage::PLATFORM_MASK & PASSTHROUGH_USAGE_MASK) == 0, ""); } // unnamed } // unnamed static bool isAtLeastT() { return android_get_device_api_level() >= __ANDROID_API_T__; } C2MemoryUsage C2AndroidMemoryUsage::FromGrallocUsage(uint64_t usage) { C2MemoryUsage C2AndroidMemoryUsage::FromGrallocUsage(uint64_t usage) { // gralloc does not support WRITE_PROTECTED // gralloc does not support WRITE_PROTECTED return C2MemoryUsage( return C2MemoryUsage( Loading Loading @@ -760,11 +764,13 @@ c2_status_t C2AllocationGralloc::map( default: { default: { // We don't know what it is, let's try to lock it with gralloc4 // We don't know what it is, let's try to lock it with gralloc4 android_ycbcr ycbcrLayout; android_ycbcr ycbcrLayout; if (isAtLeastT()) { c2_status_t status = Gralloc4Mapper_lock( c2_status_t status = Gralloc4Mapper_lock( const_cast<native_handle_t*>(mBuffer), grallocUsage, rect, layout, addr); const_cast<native_handle_t*>(mBuffer), grallocUsage, rect, layout, addr); if (status == C2_OK) { if (status == C2_OK) { break; break; } } } // fallback to lockYCbCr // fallback to lockYCbCr status_t err = GraphicBufferMapper::get().lockYCbCr( status_t err = GraphicBufferMapper::get().lockYCbCr( Loading Loading
media/codec2/vndk/C2AllocatorGralloc.cpp +10 −4 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,10 @@ namespace /* unnamed */ { static_assert((~C2MemoryUsage::PLATFORM_MASK & PASSTHROUGH_USAGE_MASK) == 0, ""); static_assert((~C2MemoryUsage::PLATFORM_MASK & PASSTHROUGH_USAGE_MASK) == 0, ""); } // unnamed } // unnamed static bool isAtLeastT() { return android_get_device_api_level() >= __ANDROID_API_T__; } C2MemoryUsage C2AndroidMemoryUsage::FromGrallocUsage(uint64_t usage) { C2MemoryUsage C2AndroidMemoryUsage::FromGrallocUsage(uint64_t usage) { // gralloc does not support WRITE_PROTECTED // gralloc does not support WRITE_PROTECTED return C2MemoryUsage( return C2MemoryUsage( Loading Loading @@ -760,11 +764,13 @@ c2_status_t C2AllocationGralloc::map( default: { default: { // We don't know what it is, let's try to lock it with gralloc4 // We don't know what it is, let's try to lock it with gralloc4 android_ycbcr ycbcrLayout; android_ycbcr ycbcrLayout; if (isAtLeastT()) { c2_status_t status = Gralloc4Mapper_lock( c2_status_t status = Gralloc4Mapper_lock( const_cast<native_handle_t*>(mBuffer), grallocUsage, rect, layout, addr); const_cast<native_handle_t*>(mBuffer), grallocUsage, rect, layout, addr); if (status == C2_OK) { if (status == C2_OK) { break; break; } } } // fallback to lockYCbCr // fallback to lockYCbCr status_t err = GraphicBufferMapper::get().lockYCbCr( status_t err = GraphicBufferMapper::get().lockYCbCr( Loading