Loading media/codec2/core/include/C2Buffer.h +5 −13 Original line number Diff line number Diff line Loading @@ -1046,13 +1046,9 @@ public: * (unexpected) */ virtual c2_status_t fetchLinearBlock( uint32_t capacity __unused, C2MemoryUsage usage __unused, uint32_t capacity, C2MemoryUsage usage, std::shared_ptr<C2LinearBlock> *block /* nonnull */, C2Fence *fence /* nonnull */) { *block = nullptr; (void) fence; return C2_OMITTED; } C2Fence *fence /* nonnull */); /** * Blocking fetch for 2D graphic block. Obtains a 2D graphic writable block of given |capacity| Loading Loading @@ -1096,14 +1092,10 @@ public: * (unexpected) */ virtual c2_status_t fetchGraphicBlock( uint32_t width __unused, uint32_t height __unused, uint32_t format __unused, C2MemoryUsage usage __unused, uint32_t width, uint32_t height, uint32_t format, C2MemoryUsage usage, std::shared_ptr<C2GraphicBlock> *block /* nonnull */, C2Fence *fence /* nonnull */) { *block = nullptr; (void) fence; return C2_OMITTED; } C2Fence *fence /* nonnull */); protected: C2BlockPool() = default; }; Loading media/codec2/vndk/C2Buffer.cpp +27 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <C2AllocatorGralloc.h> #include <C2AllocatorIon.h> #include <C2BufferPriv.h> #include <C2Debug.h> #include <C2BlockInternal.h> #include <C2PlatformSupport.h> #include <bufferpool/ClientManager.h> Loading Loading @@ -116,6 +117,32 @@ class BufferDataBuddy : public C2BufferData { } // namespace /* */ c2_status_t C2BlockPool::fetchLinearBlock( uint32_t capacity, C2MemoryUsage usage, std::shared_ptr<C2LinearBlock> *block /* nonnull */, C2Fence *fence /* nonnull */) { // fall back to non-waitable implementation, as long as it does not return C2_BLOCKING c2_status_t result = fetchLinearBlock(capacity, usage, block); C2_CHECK_NE(result, C2_BLOCKING); *fence = C2Fence(); return result; } c2_status_t C2BlockPool::fetchGraphicBlock( uint32_t width, uint32_t height, uint32_t format, C2MemoryUsage usage, std::shared_ptr<C2GraphicBlock> *block /* nonnull */, C2Fence *fence /* nonnull */) { // fall back to non-waitable implementation, as long as it does not return C2_BLOCKING c2_status_t result = fetchGraphicBlock(width, height, format, usage, block); C2_CHECK_NE(result, C2_BLOCKING); *fence = C2Fence(); return result; } /* ========================================== 1D BLOCK ========================================= */ /** Loading Loading
media/codec2/core/include/C2Buffer.h +5 −13 Original line number Diff line number Diff line Loading @@ -1046,13 +1046,9 @@ public: * (unexpected) */ virtual c2_status_t fetchLinearBlock( uint32_t capacity __unused, C2MemoryUsage usage __unused, uint32_t capacity, C2MemoryUsage usage, std::shared_ptr<C2LinearBlock> *block /* nonnull */, C2Fence *fence /* nonnull */) { *block = nullptr; (void) fence; return C2_OMITTED; } C2Fence *fence /* nonnull */); /** * Blocking fetch for 2D graphic block. Obtains a 2D graphic writable block of given |capacity| Loading Loading @@ -1096,14 +1092,10 @@ public: * (unexpected) */ virtual c2_status_t fetchGraphicBlock( uint32_t width __unused, uint32_t height __unused, uint32_t format __unused, C2MemoryUsage usage __unused, uint32_t width, uint32_t height, uint32_t format, C2MemoryUsage usage, std::shared_ptr<C2GraphicBlock> *block /* nonnull */, C2Fence *fence /* nonnull */) { *block = nullptr; (void) fence; return C2_OMITTED; } C2Fence *fence /* nonnull */); protected: C2BlockPool() = default; }; Loading
media/codec2/vndk/C2Buffer.cpp +27 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <C2AllocatorGralloc.h> #include <C2AllocatorIon.h> #include <C2BufferPriv.h> #include <C2Debug.h> #include <C2BlockInternal.h> #include <C2PlatformSupport.h> #include <bufferpool/ClientManager.h> Loading Loading @@ -116,6 +117,32 @@ class BufferDataBuddy : public C2BufferData { } // namespace /* */ c2_status_t C2BlockPool::fetchLinearBlock( uint32_t capacity, C2MemoryUsage usage, std::shared_ptr<C2LinearBlock> *block /* nonnull */, C2Fence *fence /* nonnull */) { // fall back to non-waitable implementation, as long as it does not return C2_BLOCKING c2_status_t result = fetchLinearBlock(capacity, usage, block); C2_CHECK_NE(result, C2_BLOCKING); *fence = C2Fence(); return result; } c2_status_t C2BlockPool::fetchGraphicBlock( uint32_t width, uint32_t height, uint32_t format, C2MemoryUsage usage, std::shared_ptr<C2GraphicBlock> *block /* nonnull */, C2Fence *fence /* nonnull */) { // fall back to non-waitable implementation, as long as it does not return C2_BLOCKING c2_status_t result = fetchGraphicBlock(width, height, format, usage, block); C2_CHECK_NE(result, C2_BLOCKING); *fence = C2Fence(); return result; } /* ========================================== 1D BLOCK ========================================= */ /** Loading