Commit 99d991f6 authored by watk's avatar watk Committed by Commit bot

GpuVideoDecoder now propagates errors during Flush()

Previously it was possible for GVD to be processing a Flush() but not
have no outstanding bitstream buffers in the VDA when it received a
NotifyError(). For example, when decoding single frame videos. In that
case it went into the error state but never propagated the error. Now,
if an error is received while in the flushing state, the error is
propagated by calling the decode cb corresponding to the EOS buffer.

BUG=647081
TEST=manually verified that AVDA decode errors now propagate to WMPI

Review-Url: https://codereview.chromium.org/2344703003
Cr-Commit-Position: refs/heads/master@{#419001}
parent 68de0eb0
...@@ -787,8 +787,6 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { ...@@ -787,8 +787,6 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
if (!vda_) if (!vda_)
return; return;
state_ = kError;
// If we have any bitstream buffers, then notify one that an error has // If we have any bitstream buffers, then notify one that an error has
// occurred. This guarantees that somebody finds out about the error. If // occurred. This guarantees that somebody finds out about the error. If
// we don't do this, and if the max decodes are already in flight, then there // we don't do this, and if the max decodes are already in flight, then there
...@@ -799,6 +797,11 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { ...@@ -799,6 +797,11 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
bitstream_buffers_in_decoder_.erase(it); bitstream_buffers_in_decoder_.erase(it);
} }
if (state_ == kDrainingDecoder)
base::ResetAndReturn(&eos_decode_cb_).Run(DecodeStatus::DECODE_ERROR);
state_ = kError;
DLOG(ERROR) << "VDA Error: " << error; DLOG(ERROR) << "VDA Error: " << error;
UMA_HISTOGRAM_ENUMERATION("Media.GpuVideoDecoderError", error, UMA_HISTOGRAM_ENUMERATION("Media.GpuVideoDecoderError", error,
media::VideoDecodeAccelerator::ERROR_MAX + 1); media::VideoDecodeAccelerator::ERROR_MAX + 1);
......
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