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

Commit 02148cb4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "codec2: Update DmaBufAllocator when new ComponentStore is set" am:...

Merge "codec2: Update DmaBufAllocator when new ComponentStore is set" am: 48ec4136 am: b013ddbc am: e262ff06

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

Change-Id: If666728f0c9a1f4a107ea7d1476140db2b61f004
parents eb72c95c e262ff06
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -301,13 +301,21 @@ void C2PlatformAllocatorStoreImpl::setComponentStore(std::shared_ptr<C2Component
        std::lock_guard<std::mutex> lock(_mComponentStoreReadLock);
        _mComponentStore = store;
    }
    std::shared_ptr<C2AllocatorIon> allocator;
    std::shared_ptr<C2AllocatorIon> ionAllocator;
    {
        std::lock_guard<std::mutex> lock(gIonAllocatorMutex);
        allocator = gIonAllocator.lock();
        ionAllocator = gIonAllocator.lock();
    }
    if (allocator) {
        UseComponentStoreForIonAllocator(allocator, store);
    if (ionAllocator) {
        UseComponentStoreForIonAllocator(ionAllocator, store);
    }
    std::shared_ptr<C2DmaBufAllocator> dmaAllocator;
    {
        std::lock_guard<std::mutex> lock(gDmaBufAllocatorMutex);
        dmaAllocator = gDmaBufAllocator.lock();
    }
    if (dmaAllocator) {
        UseComponentStoreForDmaBufAllocator(dmaAllocator, store);
    }
}