| Index: content/common/gpu/media/android_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc
|
| index 06d59863d049cacd6c03b22a0ebbf0e908d9755e..f420439d31b7d261aa89d00c578524a88ae992fc 100644
|
| --- a/content/common/gpu/media/android_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/android_video_decode_accelerator.cc
|
| @@ -70,6 +70,7 @@ AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator(
|
| const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder,
|
| const base::Callback<bool(void)>& make_context_current)
|
| : client_(NULL),
|
| + num_picture_buffers_(kNumPictureBuffers),
|
| make_context_current_(make_context_current),
|
| codec_(media::kCodecH264),
|
| state_(NO_ERROR),
|
| @@ -83,11 +84,14 @@ AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() {
|
| }
|
|
|
| bool AndroidVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
|
| + uint32 min_picture_count,
|
| Client* client) {
|
| DCHECK(!media_codec_);
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
|
|
| client_ = client;
|
| + num_picture_buffers_ = std::max(min_picture_count,
|
| + static_cast<uint32>(kNumPictureBuffers));
|
|
|
| if (profile == media::VP8PROFILE_ANY) {
|
| codec_ = media::kCodecVP8;
|
| @@ -415,7 +419,7 @@ void AndroidVideoDecodeAccelerator::AssignPictureBuffers(
|
| dismissed_picture_ids_.erase(id);
|
| }
|
|
|
| - RETURN_ON_FAILURE(output_picture_buffers_.size() == kNumPictureBuffers,
|
| + RETURN_ON_FAILURE(output_picture_buffers_.size() == num_picture_buffers_,
|
| "Invalid picture buffers were passed.",
|
| INVALID_ARGUMENT);
|
|
|
| @@ -528,7 +532,7 @@ bool AndroidVideoDecodeAccelerator::CanDecodeOnIOThread() {
|
| }
|
|
|
| void AndroidVideoDecodeAccelerator::RequestPictureBuffers() {
|
| - client_->ProvidePictureBuffers(kNumPictureBuffers, size_, GL_TEXTURE_2D);
|
| + client_->ProvidePictureBuffers(num_picture_buffers_, size_, GL_TEXTURE_2D);
|
| }
|
|
|
| void AndroidVideoDecodeAccelerator::NotifyPictureReady(
|
|
|