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

Unified Diff: content/common/gpu/media/vaapi_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/vaapi_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
index 2d638cbcb565ee632b7db0947df44818c9e94f44..d8c3b31bf9217fb21035886baa755612cf4019b0 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
@@ -249,6 +249,7 @@ VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator(
finish_flush_pending_(false),
awaiting_va_surfaces_recycle_(false),
requested_num_pics_(0),
+ min_picture_count_(0),
bind_image_(bind_image),
weak_this_factory_(this) {
weak_this_ = weak_this_factory_.GetWeakPtr();
@@ -261,6 +262,7 @@ VaapiVideoDecodeAccelerator::~VaapiVideoDecodeAccelerator() {
}
bool VaapiVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
+ uint32 min_picture_count,
Client* client) {
DCHECK_EQ(message_loop_, base::MessageLoop::current());
@@ -308,6 +310,7 @@ bool VaapiVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
CHECK(decoder_thread_.Start());
decoder_thread_task_runner_ = decoder_thread_.task_runner();
+ min_picture_count_ = min_picture_count;
state_ = kIdle;
return true;
@@ -508,7 +511,9 @@ void VaapiVideoDecodeAccelerator::DecodeTask() {
DVLOG(1) << "Decoder requesting a new set of surfaces";
message_loop_->PostTask(FROM_HERE, base::Bind(
&VaapiVideoDecodeAccelerator::InitiateSurfaceSetChange, weak_this_,
- decoder_->GetRequiredNumOfPictures(),
+ std::max(min_picture_count_,
+ static_cast<uint32_t>(
+ decoder_->GetRequiredNumOfPictures())),
decoder_->GetPicSize()));
// We'll get rescheduled once ProvidePictureBuffers() finishes.
return;

Powered by Google App Engine
This is Rietveld 408576698