aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-29 00:17:41 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-29 00:17:41 +0000
commit56e8276bb0d187a7765566388a66d7116d92bfd1 (patch)
treeb6f2d007e3ae6a861d11269467c7773529e710fe
parent40714cb6d85f1c36bed0b4c5fbf31ab1514cfe52 (diff)
parent7e15865d2736fa6dc7d978215912b52a6d1a9cec (diff)
downloadv4l2_codec2-android14-qpr3-s2-release.tar.gz
Change-Id: I113b0785439a94c4c5d5aa2bcd609785b1b8bb7c
-rw-r--r--components/DecodeInterface.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/DecodeInterface.cpp b/components/DecodeInterface.cpp
index 3f0706a..53689bd 100644
--- a/components/DecodeInterface.cpp
+++ b/components/DecodeInterface.cpp
@@ -22,7 +22,11 @@ namespace {
constexpr size_t k1080pArea = 1920 * 1088;
constexpr size_t k4KArea = 3840 * 2160;
// Input bitstream buffer size for up to 1080p streams.
-constexpr size_t kInputBufferSizeFor1080p = 1024 * 1024; // 1MB
+// Set it to 2MB since it is possible for the encoded bitstream to exceed the size of 1MB
+// when using higher bitrates, like 1Mb/s on slower devices. Also, this brings up compability
+// with the Chrome browser as it is using 2MB buffer size for a 1080p stream, ref:
+// https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/gpu_video_encode_accelerator_helpers.cc;l=25
+constexpr size_t kInputBufferSizeFor1080p = 2 * 1024 * 1024; // 2MB
// Input bitstream buffer size for up to 4k streams.
constexpr size_t kInputBufferSizeFor4K = 4 * kInputBufferSizeFor1080p;