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

Unified Diff: content/common/gpu/media/v4l2_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/v4l2_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
index dfd0866e47d77748e1eb6cb95a695d27c5a6c9e4..0f251930a9431f2d8a4a2bf9693826674b492e93 100644
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
@@ -192,6 +192,7 @@ V4L2VideoDecodeAccelerator::V4L2VideoDecodeAccelerator(
egl_context_(egl_context),
video_profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN),
output_format_fourcc_(0),
+ min_picture_count_(0),
weak_this_factory_(this) {
weak_this_ = weak_this_factory_.GetWeakPtr();
}
@@ -210,6 +211,7 @@ V4L2VideoDecodeAccelerator::~V4L2VideoDecodeAccelerator() {
}
bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
+ uint32_t min_picture_count,
Client* client) {
DVLOG(3) << "Initialize()";
DCHECK(child_task_runner_->BelongsToCurrentThread());
@@ -239,6 +241,7 @@ bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
return false;
};
video_profile_ = profile;
+ min_picture_count_ = min_picture_count;
if (egl_display_ == EGL_NO_DISPLAY) {
LOG(ERROR) << "Initialize(): could not get EGLDisplay";
@@ -1836,7 +1839,9 @@ bool V4L2VideoDecodeAccelerator::CreateOutputBuffers() {
// Allocate the output buffers.
struct v4l2_requestbuffers reqbufs;
memset(&reqbufs, 0, sizeof(reqbufs));
- reqbufs.count = output_dpb_size_ + kDpbOutputBufferExtraCount;
+ reqbufs.count = std::max(min_picture_count_,
+ static_cast<uint32_t>(
+ output_dpb_size_ + kDpbOutputBufferExtraCount));
reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
reqbufs.memory = V4L2_MEMORY_MMAP;
IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_REQBUFS, &reqbufs);

Powered by Google App Engine
This is Rietveld 408576698