| 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))
|
|
|