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

Unified Diff: media/filters/video_renderer_base.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/video_renderer_base.h ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_base.cc
diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc
index 51c51b03c7a018d1dd8440ccaa580261124e3f8b..83d5294bc8de293a0c4803cb70ce09310d1e1df8 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -359,13 +359,28 @@ void VideoRendererBase::PutCurrentFrame(scoped_refptr<VideoFrame> frame) {
}
}
-void VideoRendererBase::FrameReady(scoped_refptr<VideoFrame> frame) {
+void VideoRendererBase::FrameReady(VideoDecoder::DecoderStatus status,
+ scoped_refptr<VideoFrame> frame) {
base::AutoLock auto_lock(lock_);
DCHECK_NE(state_, kUninitialized);
CHECK(pending_read_);
pending_read_ = false;
+ if (status == VideoDecoder::kDecodeError) {
+ DCHECK(!frame);
+ host()->SetError(PIPELINE_ERROR_DECODE);
+ return;
+ }
+
+ if (status == VideoDecoder::kDecryptError) {
+ DCHECK(!frame);
+ host()->SetError(PIPELINE_ERROR_DECRYPT);
+ return;
+ }
+
+ DCHECK_EQ(status, VideoDecoder::kOk);
+
// Already-queued Decoder ReadCB's can fire after various state transitions
// have happened; in that case just drop those frames immediately.
if (state_ == kStopped || state_ == kError || state_ == kFlushed ||
@@ -460,8 +475,8 @@ void VideoRendererBase::AttemptRead_Locked() {
(!ready_frames_.empty() && ready_frames_.back()->IsEndOfStream()) ||
state_ == kFlushingDecoder ||
state_ == kFlushing) {
- return;
- }
+ return;
+ }
pending_read_ = true;
decoder_->Read(base::Bind(&VideoRendererBase::FrameReady, this));
« no previous file with comments | « media/filters/video_renderer_base.h ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698