Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 10248002: Report VideoDecoder status through ReadCB instead of through FilterHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename VideoDecoder::Status to VideoDecoder::DecoderStatus since Status has been polluted by Xlib.h. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/filters/video_frame_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..547d36114c28a624c40db610f7f29deac6f9b73a 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),
+ error_occured_(false) {
DCHECK(gvd_loop_proxy_ && factories_);
}
@@ -192,8 +193,13 @@ void GpuVideoDecoder::Read(const ReadCB& read_cb) {
return;
}
+ if (error_occured_) {
+ read_cb.Run(kDecodeError, NULL);
+ return;
+ }
+
if (!vda_) {
- read_cb.Run(VideoFrame::CreateEmptyFrame());
+ read_cb.Run(kOk, VideoFrame::CreateEmptyFrame());
return;
}
@@ -233,7 +239,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_, kOk, scoped_refptr<VideoFrame>()));
pending_read_cb_.Reset();
return;
}
@@ -415,7 +421,7 @@ void GpuVideoDecoder::EnqueueFrameAndTriggerFrameDelivery(
return;
gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind(
- pending_read_cb_, ready_video_frames_.front()));
+ pending_read_cb_, kOk, ready_video_frames_.front()));
pending_read_cb_.Reset();
ready_video_frames_.pop_front();
}
@@ -536,8 +542,13 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
return;
vda_ = NULL;
DLOG(ERROR) << "VDA Error: " << error;
- if (host())
- host()->SetError(PIPELINE_ERROR_DECODE);
+
+ error_occured_ = true;
+
+ if (!pending_read_cb_.is_null()) {
+ base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL);
+ return;
+ }
}
} // namespace media
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/filters/video_frame_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698