aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Yu Huang <akahuang@google.com>2021-06-02 16:35:47 +0900
committerChih-Yu Huang <akahuang@google.com>2021-06-07 14:10:53 +0900
commitdeb4e3881d4a4f9175e4ac71caf3b4ab02e5fe62 (patch)
treece2e4445c6af5e0e3c33ba94711c9d219f340cb3
parenta109e7dbe5574303a07e3012cdecb4e85b9309a2 (diff)
downloadv4l2_codec2-deb4e3881d4a4f9175e4ac71caf3b4ab02e5fe62.tar.gz
C2PooledBlockPool: remove retry logic
C2PooledBlockPool is used by VideoFramePool. Currently VideoFramePool has exponential backoff retry, so we don't need another retry logic in C2PooledBlockPool. This CL removes the unnecessary retry logic. Bug: 160110407 Test: tast.arc.VideoDecodeAccel.h264_vm Change-Id: I73ffd4b27000846eeea1e5bffbedb21e16795593
-rw-r--r--plugin_store/C2VdaPooledBlockPool.cpp22
-rw-r--r--plugin_store/include/v4l2_codec2/plugin_store/C2VdaPooledBlockPool.h3
2 files changed, 0 insertions, 25 deletions
diff --git a/plugin_store/C2VdaPooledBlockPool.cpp b/plugin_store/C2VdaPooledBlockPool.cpp
index 48cc2e5..2b9104b 100644
--- a/plugin_store/C2VdaPooledBlockPool.cpp
+++ b/plugin_store/C2VdaPooledBlockPool.cpp
@@ -14,19 +14,6 @@
#include <log/log.h>
namespace android {
-namespace {
-// The wait time for another try to fetch a buffer from bufferpool.
-const int64_t kFetchRetryDelayUs = 10 * 1000;
-
-int64_t GetNowUs() {
- struct timespec t;
- t.tv_sec = 0;
- t.tv_nsec = 0;
- clock_gettime(CLOCK_MONOTONIC, &t);
- int64_t nsecs = static_cast<int64_t>(t.tv_sec) * 1000000000LL + t.tv_nsec;
- return nsecs / 1000ll;
-}
-} // namespace
using android::hardware::media::bufferpool::BufferPoolData;
@@ -57,14 +44,6 @@ c2_status_t C2VdaPooledBlockPool::fetchGraphicBlock(uint32_t width, uint32_t hei
ALOG_ASSERT(block != nullptr);
std::lock_guard<std::mutex> lock(mMutex);
- if (mNextFetchTimeUs != 0) {
- int delayUs = GetNowUs() - mNextFetchTimeUs;
- if (delayUs > 0) {
- ::usleep(delayUs);
- }
- mNextFetchTimeUs = 0;
- }
-
std::shared_ptr<C2GraphicBlock> fetchBlock;
c2_status_t err =
C2PooledBlockPool::fetchGraphicBlock(width, height, format, usage, &fetchBlock);
@@ -89,7 +68,6 @@ c2_status_t C2VdaPooledBlockPool::fetchGraphicBlock(uint32_t width, uint32_t hei
return C2_OK;
}
ALOGV("No buffer could be recycled now, wait for another try...");
- mNextFetchTimeUs = GetNowUs() + kFetchRetryDelayUs;
return C2_TIMED_OUT;
}
diff --git a/plugin_store/include/v4l2_codec2/plugin_store/C2VdaPooledBlockPool.h b/plugin_store/include/v4l2_codec2/plugin_store/C2VdaPooledBlockPool.h
index 5603046..749ff47 100644
--- a/plugin_store/include/v4l2_codec2/plugin_store/C2VdaPooledBlockPool.h
+++ b/plugin_store/include/v4l2_codec2/plugin_store/C2VdaPooledBlockPool.h
@@ -47,9 +47,6 @@ private:
std::set<uint32_t> mBufferIds GUARDED_BY(mMutex);
// The maximum count of allocated buffers.
size_t mBufferCount GUARDED_BY(mMutex){0};
- // The timestamp for the next fetchGraphicBlock() call.
- // Set when the previous fetchGraphicBlock() call timed out.
- int64_t mNextFetchTimeUs GUARDED_BY(mMutex){0};
};
} // namespace android