Commit 00812534 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: remove unused argument from workarounds

The V4L2 workaround interface was taking the end position of the encoded
stream as a writable argument - this is dangerous and it doesn't even
need it, so remove it.

BUG=b:149663704
TEST=vdatest passes on Hana.

Change-Id: I6ec9b137e6e762fd999e6ae2462db4564b0e7134
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2130452
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755246}
parent 37ae8be0
......@@ -34,7 +34,7 @@ class SupportResolutionChecker : public V4L2StatefulWorkaround {
VideoCodecProfile profile);
~SupportResolutionChecker() override = default;
Result Apply(const uint8_t* data, size_t size, size_t* endpos) override;
Result Apply(const uint8_t* data, size_t size) override;
private:
using SupportedProfileMap = base::small_map<
......@@ -94,8 +94,7 @@ SupportResolutionChecker::CreateIfNeeded(V4L2Device::Type device_type,
V4L2StatefulWorkaround::Result SupportResolutionChecker::Apply(
const uint8_t* data,
size_t size,
size_t* endpos) {
size_t size) {
Vp8FrameHeader fhdr;
vp8_parser_->ParseFrame(data, size, &fhdr);
if (fhdr.IsKeyframe()) {
......
......@@ -24,7 +24,7 @@ class V4L2StatefulWorkaround {
virtual ~V4L2StatefulWorkaround() = default;
// Apply the workaround.
virtual Result Apply(const uint8_t* data, size_t size, size_t* endpos) = 0;
virtual Result Apply(const uint8_t* data, size_t size) = 0;
protected:
V4L2StatefulWorkaround() = default;
......
......@@ -987,7 +987,7 @@ bool V4L2VideoDecodeAccelerator::AdvanceFrameFragment(const uint8_t* data,
DCHECK(decoder_thread_.task_runner()->BelongsToCurrentThread());
for (auto& workaround : workarounds_) {
auto result = workaround->Apply(data, size, endpos);
auto result = workaround->Apply(data, size);
if (result == V4L2StatefulWorkaround::Result::NotifyError) {
LOG(ERROR) << "Failed doing a workaround";
NOTIFY_ERROR(PLATFORM_FAILURE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment