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

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

Merge "C2BlockPool created with CreateCodec2BlockPool" into main

parents e80ec9b8 3d59d43a
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -487,7 +487,19 @@ void Component::initListener(const std::shared_ptr<Component>& self) {
    if (__builtin_available(android __ANDROID_API_T__, *)) {
        std::shared_ptr<C2Component::Listener> c2listener;
        if (mMultiAccessUnitIntf) {
            mMultiAccessUnitHelper = std::make_shared<MultiAccessUnitHelper>(mMultiAccessUnitIntf);
            std::shared_ptr<C2Allocator> allocator;
            std::shared_ptr<C2BlockPool> linearPool;
            std::shared_ptr<C2AllocatorStore> store = ::android::GetCodec2PlatformAllocatorStore();
            if(store->fetchAllocator(C2AllocatorStore::DEFAULT_LINEAR, &allocator) == C2_OK) {
                ::android::C2PlatformAllocatorDesc desc;
                desc.allocatorId = allocator->getId();
                if (C2_OK == CreateCodec2BlockPool(desc, mComponent, &linearPool)) {
                    if (linearPool) {
                        mMultiAccessUnitHelper = std::make_shared<MultiAccessUnitHelper>(
                                mMultiAccessUnitIntf, linearPool);
                    }
                }
            }
        }
        c2listener = mMultiAccessUnitHelper ?
                std::make_shared<MultiAccessUnitListener>(self, mMultiAccessUnitHelper) :
+5 −5
Original line number Diff line number Diff line
@@ -126,12 +126,12 @@ class C2MultiAccessUnitBuffer : public C2Buffer {

//MultiAccessUnitHelper
MultiAccessUnitHelper::MultiAccessUnitHelper(
        const std::shared_ptr<MultiAccessUnitInterface>& intf):
        const std::shared_ptr<MultiAccessUnitInterface>& intf,
        std::shared_ptr<C2BlockPool>& linearPool):
        mInit(false),
        mInterface(intf) {
    std::shared_ptr<C2AllocatorStore> store = GetCodec2PlatformAllocatorStore();
    if(store->fetchAllocator(C2AllocatorStore::DEFAULT_LINEAR, &mLinearAllocator) == C2_OK) {
        mLinearPool = std::make_shared<C2PooledBlockPool>(mLinearAllocator, ++mBlockPoolId);
        mInterface(intf),
        mLinearPool(linearPool) {
    if (mLinearPool) {
        mInit = true;
    }
}
+2 −3
Original line number Diff line number Diff line
@@ -58,7 +58,8 @@ protected:
struct MultiAccessUnitHelper {
public:
    MultiAccessUnitHelper(
            const std::shared_ptr<MultiAccessUnitInterface>& intf);
            const std::shared_ptr<MultiAccessUnitInterface>& intf,
            std::shared_ptr<C2BlockPool> &linearPool);

    virtual ~MultiAccessUnitHelper();

@@ -202,8 +203,6 @@ protected:
    C2BlockPool::local_id_t mBlockPoolId;
    // C2Blockpool for output buffer allocation
    std::shared_ptr<C2BlockPool> mLinearPool;
    // Allocator for output buffer allocation
    std::shared_ptr<C2Allocator> mLinearAllocator;
    // FrameIndex for the current outgoing work
    std::atomic_uint64_t mFrameIndex;
    // Mutex to protect mFrameHolder
+13 −1
Original line number Diff line number Diff line
@@ -570,7 +570,19 @@ std::shared_ptr<C2Component> Component::findLocalComponent(
void Component::initListener(const sp<Component>& self) {
    std::shared_ptr<C2Component::Listener> c2listener;
    if (mMultiAccessUnitIntf) {
        mMultiAccessUnitHelper = std::make_shared<MultiAccessUnitHelper>(mMultiAccessUnitIntf);
        std::shared_ptr<C2Allocator> allocator;
        std::shared_ptr<C2BlockPool> linearPool;
        std::shared_ptr<C2AllocatorStore> store = ::android::GetCodec2PlatformAllocatorStore();
        if(store->fetchAllocator(C2AllocatorStore::DEFAULT_LINEAR, &allocator) == C2_OK) {
            ::android::C2PlatformAllocatorDesc desc;
            desc.allocatorId = allocator->getId();
            if (C2_OK == CreateCodec2BlockPool(desc, mComponent, &linearPool)) {
                if (linearPool) {
                    mMultiAccessUnitHelper = std::make_shared<MultiAccessUnitHelper>(
                            mMultiAccessUnitIntf, linearPool);
                }
            }
        }
    }
    c2listener = mMultiAccessUnitHelper ?
            std::make_shared<MultiAccessUnitListener>(self, mMultiAccessUnitHelper) :
+13 −1
Original line number Diff line number Diff line
@@ -583,7 +583,19 @@ std::shared_ptr<C2Component> Component::findLocalComponent(
void Component::initListener(const sp<Component>& self) {
    std::shared_ptr<C2Component::Listener> c2listener;
    if (mMultiAccessUnitIntf) {
        mMultiAccessUnitHelper = std::make_shared<MultiAccessUnitHelper>(mMultiAccessUnitIntf);
        std::shared_ptr<C2Allocator> allocator;
        std::shared_ptr<C2BlockPool> linearPool;
        std::shared_ptr<C2AllocatorStore> store = ::android::GetCodec2PlatformAllocatorStore();
        if(store->fetchAllocator(C2AllocatorStore::DEFAULT_LINEAR, &allocator) == C2_OK) {
            ::android::C2PlatformAllocatorDesc desc;
            desc.allocatorId = allocator->getId();
            if (C2_OK == CreateCodec2BlockPool(desc, mComponent, &linearPool)) {
                if (linearPool) {
                    mMultiAccessUnitHelper = std::make_shared<MultiAccessUnitHelper>(
                            mMultiAccessUnitIntf, linearPool);
                }
            }
        }
    }
    c2listener = mMultiAccessUnitHelper ?
            std::make_shared<MultiAccessUnitListener>(self, mMultiAccessUnitHelper) :
Loading