summaryrefslogtreecommitdiff
path: root/chromium/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc')
-rw-r--r--chromium/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/chromium/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc b/chromium/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc
index 87d4f153df5..b18d655dc68 100644
--- a/chromium/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc
+++ b/chromium/media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc
@@ -1,10 +1,10 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
+// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/gpu/v4l2/v4l2_video_decoder_backend_stateful.h"
-#include <cstddef>
+#include <cstddef>
#include <memory>
#include <tuple>
#include <utility>
@@ -16,6 +16,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
+#include "media/base/limits.h"
#include "media/base/media_switches.h"
#include "media/base/video_codecs.h"
#include "media/gpu/chromeos/dmabuf_video_frame_pool.h"
@@ -616,9 +617,10 @@ void V4L2StatefulVideoDecoderBackend::ChangeResolution() {
}
auto ctrl = device_->GetCtrl(V4L2_CID_MIN_BUFFERS_FOR_CAPTURE);
- constexpr size_t DEFAULT_NUM_OUTPUT_BUFFERS = 7;
+ constexpr size_t kDefaultNumOutputBuffers = 7;
+ constexpr size_t kPicsInPipeline = limits::kMaxVideoFrames + 1;
const size_t num_output_buffers =
- ctrl ? ctrl->value : DEFAULT_NUM_OUTPUT_BUFFERS;
+ (ctrl ? ctrl->value : kDefaultNumOutputBuffers) + kPicsInPipeline;
if (!ctrl)
VLOGF(1) << "Using default minimum number of CAPTURE buffers";
@@ -741,8 +743,7 @@ bool V4L2StatefulVideoDecoderBackend::IsSupportedProfile(
for (const auto& entry : profiles)
supported_profiles_.push_back(entry.profile);
}
- return std::find(supported_profiles_.begin(), supported_profiles_.end(),
- profile) != supported_profiles_.end();
+ return base::Contains(supported_profiles_, profile);
}
bool V4L2StatefulVideoDecoderBackend::StopInputQueueOnResChange() const {