Loading media/codec2/hal/aidl/Component.cpp +9 −17 Original line number Diff line number Diff line Loading @@ -289,30 +289,22 @@ ScopedAStatus Component::createBlockPool( const IComponent::BlockPoolAllocator &allocator, IComponent::BlockPool *blockPool) { std::shared_ptr<C2BlockPool> c2BlockPool; static constexpr IComponent::BlockPoolAllocator::Tag ALLOCATOR_ID = IComponent::BlockPoolAllocator::allocatorId; static constexpr IComponent::BlockPoolAllocator::Tag IGBA = IComponent::BlockPoolAllocator::allocator; c2_status_t status = C2_OK; ::android::C2PlatformAllocatorDesc allocatorParam; switch (allocator.getTag()) { case ALLOCATOR_ID: { allocatorParam.allocatorId = allocator.get<IComponent::BlockPoolAllocator::allocatorId>(); allocatorParam.allocatorId = allocator.allocatorId; switch (allocator.allocatorId) { case ::android::C2PlatformAllocatorStore::IGBA: { allocatorParam.igba = allocator.gbAllocator->igba; allocatorParam.waitableFd.reset( allocator.gbAllocator->waitableFd.dup().release()); } break; case IGBA: { allocatorParam.allocatorId = ::android::C2PlatformAllocatorStore::IGBA; allocatorParam.igba = allocator.get<IComponent::BlockPoolAllocator::allocator>().igba; allocatorParam.waitableFd.reset( allocator.get<IComponent::BlockPoolAllocator::allocator>() .waitableFd.dup().release()); default: { // no-op } break; default: return ScopedAStatus::fromServiceSpecificError(C2_CORRUPTED); } #ifdef __ANDROID_APEX__ status = ::android::CreateCodec2BlockPool( allocatorParam, Loading media/codec2/hal/client/client.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -2072,6 +2072,8 @@ c2_status_t Codec2Client::Component::createBlockPool( id = id == C2PlatformAllocatorStore::BUFFERQUEUE ? C2PlatformAllocatorStore::IGBA : id; c2_aidl::IComponent::BlockPoolAllocator allocator; allocator.allocatorId = id; if (id == C2PlatformAllocatorStore::IGBA) { std::shared_ptr<AidlGraphicBufferAllocator> gba = mGraphicBufferAllocators->create(); Loading @@ -2081,12 +2083,11 @@ c2_status_t Codec2Client::Component::createBlockPool( if (status != C2_OK) { return status; } c2_aidl::IComponent::BlockPoolAllocator allocator; allocator.set<c2_aidl::IComponent::BlockPoolAllocator::allocator>(); allocator.get<c2_aidl::IComponent::BlockPoolAllocator::allocator>().igba = c2_aidl::IComponent::GbAllocator gbAllocator; gbAllocator.waitableFd = std::move(waitableFd); gbAllocator.igba = c2_aidl::IGraphicBufferAllocator::fromBinder(gba->asBinder()); allocator.get<c2_aidl::IComponent::BlockPoolAllocator::allocator>().waitableFd = std::move(waitableFd); allocator.gbAllocator = std::move(gbAllocator); ::ndk::ScopedAStatus transStatus = mAidlBase->createBlockPool( allocator, &aidlBlockPool); status = GetC2Status(transStatus, "createBlockPool"); Loading @@ -2096,7 +2097,7 @@ c2_status_t Codec2Client::Component::createBlockPool( mGraphicBufferAllocators->setCurrentId(aidlBlockPool.blockPoolId); } else { ::ndk::ScopedAStatus transStatus = mAidlBase->createBlockPool( static_cast<int32_t>(id), &aidlBlockPool); allocator, &aidlBlockPool); status = GetC2Status(transStatus, "createBlockPool"); if (status != C2_OK) { return status; Loading Loading
media/codec2/hal/aidl/Component.cpp +9 −17 Original line number Diff line number Diff line Loading @@ -289,30 +289,22 @@ ScopedAStatus Component::createBlockPool( const IComponent::BlockPoolAllocator &allocator, IComponent::BlockPool *blockPool) { std::shared_ptr<C2BlockPool> c2BlockPool; static constexpr IComponent::BlockPoolAllocator::Tag ALLOCATOR_ID = IComponent::BlockPoolAllocator::allocatorId; static constexpr IComponent::BlockPoolAllocator::Tag IGBA = IComponent::BlockPoolAllocator::allocator; c2_status_t status = C2_OK; ::android::C2PlatformAllocatorDesc allocatorParam; switch (allocator.getTag()) { case ALLOCATOR_ID: { allocatorParam.allocatorId = allocator.get<IComponent::BlockPoolAllocator::allocatorId>(); allocatorParam.allocatorId = allocator.allocatorId; switch (allocator.allocatorId) { case ::android::C2PlatformAllocatorStore::IGBA: { allocatorParam.igba = allocator.gbAllocator->igba; allocatorParam.waitableFd.reset( allocator.gbAllocator->waitableFd.dup().release()); } break; case IGBA: { allocatorParam.allocatorId = ::android::C2PlatformAllocatorStore::IGBA; allocatorParam.igba = allocator.get<IComponent::BlockPoolAllocator::allocator>().igba; allocatorParam.waitableFd.reset( allocator.get<IComponent::BlockPoolAllocator::allocator>() .waitableFd.dup().release()); default: { // no-op } break; default: return ScopedAStatus::fromServiceSpecificError(C2_CORRUPTED); } #ifdef __ANDROID_APEX__ status = ::android::CreateCodec2BlockPool( allocatorParam, Loading
media/codec2/hal/client/client.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -2072,6 +2072,8 @@ c2_status_t Codec2Client::Component::createBlockPool( id = id == C2PlatformAllocatorStore::BUFFERQUEUE ? C2PlatformAllocatorStore::IGBA : id; c2_aidl::IComponent::BlockPoolAllocator allocator; allocator.allocatorId = id; if (id == C2PlatformAllocatorStore::IGBA) { std::shared_ptr<AidlGraphicBufferAllocator> gba = mGraphicBufferAllocators->create(); Loading @@ -2081,12 +2083,11 @@ c2_status_t Codec2Client::Component::createBlockPool( if (status != C2_OK) { return status; } c2_aidl::IComponent::BlockPoolAllocator allocator; allocator.set<c2_aidl::IComponent::BlockPoolAllocator::allocator>(); allocator.get<c2_aidl::IComponent::BlockPoolAllocator::allocator>().igba = c2_aidl::IComponent::GbAllocator gbAllocator; gbAllocator.waitableFd = std::move(waitableFd); gbAllocator.igba = c2_aidl::IGraphicBufferAllocator::fromBinder(gba->asBinder()); allocator.get<c2_aidl::IComponent::BlockPoolAllocator::allocator>().waitableFd = std::move(waitableFd); allocator.gbAllocator = std::move(gbAllocator); ::ndk::ScopedAStatus transStatus = mAidlBase->createBlockPool( allocator, &aidlBlockPool); status = GetC2Status(transStatus, "createBlockPool"); Loading @@ -2096,7 +2097,7 @@ c2_status_t Codec2Client::Component::createBlockPool( mGraphicBufferAllocators->setCurrentId(aidlBlockPool.blockPoolId); } else { ::ndk::ScopedAStatus transStatus = mAidlBase->createBlockPool( static_cast<int32_t>(id), &aidlBlockPool); allocator, &aidlBlockPool); status = GetC2Status(transStatus, "createBlockPool"); if (status != C2_OK) { return status; Loading