Commit da4e8998 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/v4l2VEA: NotifyError() with kPlatformFailure if unexpected VideoFrame is fed on Encode()

V4L2VEA doesn't allow change coded_size of VideoFrame during
encoding. If the size varies, it invokes NotifyError() with
kInvalidArgumentError. However, RtcVideoEncoder does not regard
the error as so critical that software encoder fallback should be
triggered. As a result, any frame will no longer be encoded if it
happens, which is viewed like encoding hangs.

This CL lets V4L2VEA invoke NotifyError() with KPlatformFailure
in the case so that software encoder fallback happens.

Bug: 1057528
Test: SW encoder fallback happens upon rotation on scarlet
Change-Id: I8300e42d3a913548736e9d17bba6d394f12345cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087329
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarJeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748526}
parent 5efb8291
......@@ -692,7 +692,7 @@ void V4L2VideoEncodeAccelerator::EncodeTask(scoped_refptr<VideoFrame> frame,
}
if (frame && !ReconfigureFormatIfNeeded(*frame)) {
NOTIFY_ERROR(kInvalidArgumentError);
NOTIFY_ERROR(kPlatformFailureError);
encoder_state_ = kError;
return;
}
......@@ -722,6 +722,7 @@ bool V4L2VideoEncodeAccelerator::ReconfigureFormatIfNeeded(
}
if (!input_buffer_map_.empty()) {
// TODO(crbug.com/1060057): Handle coded_size change.
if (frame.coded_size() != input_frame_size_) {
VLOGF(1) << "Input frame size is changed during encoding"
<< ", frame.coded_size()=" << frame.coded_size().ToString()
......
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