Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5099)

Unified Diff: content/common/gpu/media/vt_video_decode_accelerator.cc

Issue 1207043002: Introduce a client minimum picture pool size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/vt_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc
index 0aeab2bfcc331d9567af823f792f37f4c0df4ab1..5827dd091742c74aad52062818fe68efacb35737 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vt_video_decode_accelerator.cc
@@ -291,6 +291,7 @@ VTVideoDecodeAccelerator::VTVideoDecodeAccelerator(
make_context_current_(make_context_current),
client_(nullptr),
state_(STATE_DECODING),
+ num_picture_buffers_(kNumPictureBuffers),
format_(nullptr),
session_(nullptr),
last_sps_id_(-1),
@@ -309,10 +310,14 @@ VTVideoDecodeAccelerator::~VTVideoDecodeAccelerator() {
bool VTVideoDecodeAccelerator::Initialize(
media::VideoCodecProfile profile,
+ uint32_t min_picture_count,
Client* client) {
DCHECK(gpu_thread_checker_.CalledOnValidThread());
client_ = client;
+ num_picture_buffers_ = std::max(min_picture_count,
+ static_cast<uint32_t>(kNumPictureBuffers));
+
if (!InitializeVideoToolbox())
return false;
@@ -967,7 +972,7 @@ bool VTVideoDecodeAccelerator::ProcessFrame(const Frame& frame) {
// Request new pictures.
picture_size_ = frame.coded_size;
client_->ProvidePictureBuffers(
- kNumPictureBuffers, coded_size_, GL_TEXTURE_RECTANGLE_ARB);
+ num_picture_buffers_, coded_size_, GL_TEXTURE_RECTANGLE_ARB);
return false;
}
if (!SendFrame(frame))

Powered by Google App Engine
This is Rietveld 408576698