Commit 8f6bae67 authored by Ted Meyer's avatar Ted Meyer Committed by Chromium LUCI CQ

Fix bug where InitializeFailed was being sent

There were three uses of NotifyError(std::string) that should have been
using NotifyError(media::Status). It was causing decode errors to show
up with the initialization error code.

Also added the VDA error number to the log, if it is a decode error.
It'll usually be 4 though. This doesn't actually fix the issue where the
video isn't decoding, it just makes the debugging situation much easier.

Bug: 1164463
Change-Id: I399898e3b2ca02ade3ef5a0f8c4e2a0af87d722a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2618526
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841686}
parent e60105db
...@@ -78,6 +78,8 @@ enum class StatusCode : StatusCodeType { ...@@ -78,6 +78,8 @@ enum class StatusCode : StatusCodeType {
kCreateVideoProcessorEnumeratorFailed = 0x00000312, kCreateVideoProcessorEnumeratorFailed = 0x00000312,
kCreateVideoProcessorFailed = 0x00000313, kCreateVideoProcessorFailed = 0x00000313,
kQueryVideoContextFailed = 0x00000314, kQueryVideoContextFailed = 0x00000314,
kAcceleratorFlushFailed = 0x00000315,
kTryAgainNotSupported = 0x00000316,
// MojoDecoder Errors: 0x04 // MojoDecoder Errors: 0x04
kMojoDecoderNoWrappedDecoder = 0x00000401, kMojoDecoderNoWrappedDecoder = 0x00000401,
......
...@@ -554,7 +554,7 @@ void D3D11VideoDecoder::DoDecode() { ...@@ -554,7 +554,7 @@ void D3D11VideoDecoder::DoDecode() {
current_buffer_ = nullptr; current_buffer_ = nullptr;
if (!accelerated_video_decoder_->Flush()) { if (!accelerated_video_decoder_->Flush()) {
// This will also signal error |current_decode_cb_|. // This will also signal error |current_decode_cb_|.
NotifyError("Flush failed"); NotifyError(StatusCode::kAcceleratorFlushFailed);
return; return;
} }
// Pictures out output synchronously during Flush. Signal the decode // Pictures out output synchronously during Flush. Signal the decode
...@@ -651,11 +651,12 @@ void D3D11VideoDecoder::DoDecode() { ...@@ -651,11 +651,12 @@ void D3D11VideoDecoder::DoDecode() {
picture_buffers_.clear(); picture_buffers_.clear();
} else if (result == media::AcceleratedVideoDecoder::kTryAgain) { } else if (result == media::AcceleratedVideoDecoder::kTryAgain) {
LOG(ERROR) << "Try again is not supported"; LOG(ERROR) << "Try again is not supported";
NotifyError("Try again is not supported"); NotifyError(StatusCode::kTryAgainNotSupported);
return; return;
} else { } else {
LOG(ERROR) << "VDA Error " << result; std::ostringstream message;
NotifyError("Accelerated decode failed"); message << "VDA Error " << result;
NotifyError(Status(StatusCode::kDecoderFailedDecode, message.str()));
return; return;
} }
} }
...@@ -898,13 +899,15 @@ void D3D11VideoDecoder::NotifyError(const Status& reason) { ...@@ -898,13 +899,15 @@ void D3D11VideoDecoder::NotifyError(const Status& reason) {
TRACE_EVENT0("gpu", "D3D11VideoDecoder::NotifyError"); TRACE_EVENT0("gpu", "D3D11VideoDecoder::NotifyError");
state_ = State::kError; state_ = State::kError;
// TODO(tmathmeyer) - Remove this after plumbing Status through the if (init_cb_) {
// decode_cb and input_buffer_queue cb's.
MEDIA_LOG(ERROR, media_log_)
<< "D3D11VideoDecoder error: " << std::hex << reason.code();
if (init_cb_)
std::move(init_cb_).Run(reason); std::move(init_cb_).Run(reason);
} else {
// TODO(tmathmeyer) - Remove this after plumbing Status through the
// decode_cb and input_buffer_queue cb's.
// Let the init handler set the error string if this is an init failure.
MEDIA_LOG(ERROR, media_log_) << "D3D11VideoDecoder error: 0x" << std::hex
<< reason.code() << reason.message();
}
current_buffer_ = nullptr; current_buffer_ = nullptr;
if (current_decode_cb_) if (current_decode_cb_)
......
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