From d73cbf57bde3c2d9563d6fba2e001c560ec3f3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Grzesik?= <bgrzesik@google.com> Date: Tue, 7 Mar 2023 10:46:30 +0000 Subject: [PATCH] VideoFramePool: Remove unused methods This CL removes requestNewBufferSet and setNotifyBlockAvailableCb methods, that became unused after switch to C2BufferQueueBlockPool and C2PooledBlockPool. Bug: 268301611 Bug: 268305422 Bug: 270329448 Bug: 238710012 Bug: 238390060 Bug: 270331759 Bug: 238709912 Test: CtsMediaCodecTestCases Test: CtsMediaDecoderTestCases Test: CtsMediaV2TestCases Test: GtsExoPlayerTestCases com.google.android.exoplayer.gts.CommonEncryptionDrmTest#cencSchemeTypeV* Change-Id: I6085cb7d5a7118d2b81d1f6d9d533b98fc978fa1 --- components/VideoFramePool.cpp | 18 ------------------ .../v4l2_codec2/components/VideoFramePool.h | 10 ---------- 2 files changed, 28 deletions(-) diff --git a/components/VideoFramePool.cpp b/components/VideoFramePool.cpp index bb892a8..070cc40 100644 --- a/components/VideoFramePool.cpp +++ b/components/VideoFramePool.cpp @@ -65,19 +65,6 @@ std::optional<uint32_t> VideoFramePool::getBufferIdFromGraphicBlock(C2BlockPool& return std::nullopt; } -// static -c2_status_t VideoFramePool::requestNewBufferSet(C2BlockPool& blockPool, int32_t bufferCount, - const ui::Size& size, uint32_t format, - C2MemoryUsage usage) { - ALOGE("%s(): unknown allocator ID: %u", __func__, blockPool.getAllocatorId()); - return C2_BAD_VALUE; -} - -// static -bool VideoFramePool::setNotifyBlockAvailableCb(C2BlockPool& blockPool, ::base::OnceClosure cb) { - return false; -} - // static std::unique_ptr<VideoFramePool> VideoFramePool::Create( std::shared_ptr<C2BlockPool> blockPool, const size_t numBuffers, const ui::Size& size, @@ -94,11 +81,6 @@ std::unique_ptr<VideoFramePool> VideoFramePool::Create( } const C2MemoryUsage memoryUsage(usage); - if (requestNewBufferSet(*blockPool, numBuffers, size, static_cast<uint32_t>(pixelFormat), - memoryUsage) != C2_OK) { - return nullptr; - } - std::unique_ptr<VideoFramePool> pool = ::base::WrapUnique(new VideoFramePool(std::move(blockPool), numBuffers, size, pixelFormat, memoryUsage, std::move(taskRunner))); diff --git a/components/include/v4l2_codec2/components/VideoFramePool.h b/components/include/v4l2_codec2/components/VideoFramePool.h index 4e1537e..6bebc37 100644 --- a/components/include/v4l2_codec2/components/VideoFramePool.h +++ b/components/include/v4l2_codec2/components/VideoFramePool.h @@ -63,19 +63,9 @@ private: // Returns true if a buffer shall not be handed to client. bool shouldDropBuffer(uint32_t bufferId); - // Ask |blockPool| to allocate the specified number of buffers. - // |bufferCount| is the number of requested buffers. - static c2_status_t requestNewBufferSet(C2BlockPool& blockPool, int32_t bufferCount, - const ui::Size& size, uint32_t format, - C2MemoryUsage usage); - static std::optional<uint32_t> getBufferIdFromGraphicBlock(C2BlockPool& blockPool, const C2Block2D& block); - // Ask |blockPool| to notify when a block is available via |cb|. - // Return true if |blockPool| supports notifying buffer available. - static bool setNotifyBlockAvailableCb(C2BlockPool& blockPool, ::base::OnceClosure cb); - std::shared_ptr<C2BlockPool> mBlockPool; // Holds the number of maximum amount of buffers that VideoFramePool -- GitLab