diff --git a/components/DecodeInterface.cpp b/components/DecodeInterface.cpp index 3f0706a265b799eea6f49ca399877a7c58560f0a..53689bdc998bb25b2f26536ef28f316146df5af9 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;