OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/filters/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 return; | 229 return; |
230 } | 230 } |
231 demuxer_read_in_progress_ = false; | 231 demuxer_read_in_progress_ = false; |
232 | 232 |
233 if (status != DemuxerStream::kOk) { | 233 if (status != DemuxerStream::kOk) { |
234 if (pending_read_cb_.is_null()) | 234 if (pending_read_cb_.is_null()) |
235 return; | 235 return; |
236 | 236 |
237 // TODO(acolwell): Add support for reinitializing the decoder when | 237 // TODO(acolwell): Add support for reinitializing the decoder when |
238 // |status| == kConfigChanged. For now we just trigger a decode error. | 238 // |status| == kConfigChanged. For now we just trigger a decode error. |
239 DecoderStatus decoder_status = | 239 Status decoder_status = |
240 (status == DemuxerStream::kAborted) ? kOk : kDecodeError; | 240 (status == DemuxerStream::kAborted) ? kOk : kDecodeError; |
241 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( | 241 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
242 pending_read_cb_, decoder_status, scoped_refptr<VideoFrame>())); | 242 pending_read_cb_, decoder_status, scoped_refptr<VideoFrame>())); |
243 pending_read_cb_.Reset(); | 243 pending_read_cb_.Reset(); |
244 return; | 244 return; |
245 } | 245 } |
246 | 246 |
247 if (!vda_.get()) { | 247 if (!vda_.get()) { |
248 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); | 248 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); |
249 return; | 249 return; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 | 558 |
559 error_occured_ = true; | 559 error_occured_ = true; |
560 | 560 |
561 if (!pending_read_cb_.is_null()) { | 561 if (!pending_read_cb_.is_null()) { |
562 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); | 562 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); |
563 return; | 563 return; |
564 } | 564 } |
565 } | 565 } |
566 | 566 |
567 } // namespace media | 567 } // namespace media |
OLD | NEW |