Chromium Code Reviews| Index: media/filters/gpu_video_decoder.cc |
| diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc |
| index 7ce3df75e74feaf68d9a6fbdf1ef9f3bcda8bd01..8901b68d692e555afd1ddca95fef20e5c26122c1 100644 |
| --- a/media/filters/gpu_video_decoder.cc |
| +++ b/media/filters/gpu_video_decoder.cc |
| @@ -53,7 +53,8 @@ GpuVideoDecoder::GpuVideoDecoder( |
| decoder_texture_target_(0), |
| next_picture_buffer_id_(0), |
| next_bitstream_buffer_id_(0), |
| - shutting_down_(false) { |
| + shutting_down_(false), |
| + pending_error_count_(0) { |
| DCHECK(gvd_loop_proxy_ && factories_); |
| } |
| @@ -192,8 +193,15 @@ void GpuVideoDecoder::Read(const ReadCB& read_cb) { |
| return; |
| } |
| + CHECK_GE(pending_error_count_, 0); |
|
Ami GONE FROM CHROMIUM
2012/04/27 16:49:14
unnecessary, IMO
xhwang
2012/04/27 23:22:30
Done.
|
| + if (pending_error_count_ > 0) { |
| + read_cb.Run(NULL, kDecodeError); |
| + pending_error_count_--; |
|
scherkus (not reviewing)
2012/04/27 18:27:56
fischman: is there a case where we'd report an err
Ami GONE FROM CHROMIUM
2012/04/27 18:31:16
No; pending_error_count_ only goes positive when N
xhwang
2012/04/27 23:22:30
Done.
xhwang
2012/04/27 23:22:30
Done.
|
| + return; |
| + } |
| + |
| if (!vda_) { |
| - read_cb.Run(VideoFrame::CreateEmptyFrame()); |
| + read_cb.Run(VideoFrame::CreateEmptyFrame(), kOk); |
| return; |
| } |
| @@ -233,7 +241,7 @@ void GpuVideoDecoder::RequestBufferDecode(const scoped_refptr<Buffer>& buffer) { |
| return; |
| gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
| - pending_read_cb_, scoped_refptr<VideoFrame>())); |
| + pending_read_cb_, scoped_refptr<VideoFrame>(), kOk)); |
| pending_read_cb_.Reset(); |
| return; |
| } |
| @@ -415,7 +423,7 @@ void GpuVideoDecoder::EnqueueFrameAndTriggerFrameDelivery( |
| return; |
| gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
| - pending_read_cb_, ready_video_frames_.front())); |
| + pending_read_cb_, ready_video_frames_.front(), kOk)); |
| pending_read_cb_.Reset(); |
| ready_video_frames_.pop_front(); |
| } |
| @@ -536,8 +544,14 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { |
| return; |
| vda_ = NULL; |
| DLOG(ERROR) << "VDA Error: " << error; |
| - if (host()) |
| - host()->SetError(PIPELINE_ERROR_DECODE); |
| + |
| + if (!pending_read_cb_.is_null()) { |
| + base::ResetAndReturn(&pending_read_cb_).Run(NULL, kDecodeError); |
| + return; |
| + } |
| + |
| + CHECK_GE(pending_error_count_, 0); |
|
Ami GONE FROM CHROMIUM
2012/04/27 16:49:14
unnecessary.
xhwang
2012/04/27 23:22:30
Done.
|
| + pending_error_count_++; |
| } |
| } // namespace media |