OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/decoder_stream.h" | 5 #include "media/filters/decoder_stream.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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 set_decryptor_ready_cb)), | 52 set_decryptor_ready_cb)), |
53 active_splice_(false), | 53 active_splice_(false), |
54 pending_decode_requests_(0), | 54 pending_decode_requests_(0), |
55 weak_factory_(this) {} | 55 weak_factory_(this) {} |
56 | 56 |
57 template <DemuxerStream::Type StreamType> | 57 template <DemuxerStream::Type StreamType> |
58 DecoderStream<StreamType>::~DecoderStream() { | 58 DecoderStream<StreamType>::~DecoderStream() { |
59 FUNCTION_DVLOG(2); | 59 FUNCTION_DVLOG(2); |
60 DCHECK(task_runner_->BelongsToCurrentThread()); | 60 DCHECK(task_runner_->BelongsToCurrentThread()); |
61 | 61 |
62 // TODO(xhwang): Fold DecoderSelector::Abort() into the dtor. | 62 decoder_selector_.reset(); |
63 if (state_ == STATE_INITIALIZING) | |
64 decoder_selector_->Abort(); | |
65 | 63 |
66 if (!init_cb_.is_null()) { | 64 if (!init_cb_.is_null()) { |
67 task_runner_->PostTask(FROM_HERE, | 65 task_runner_->PostTask(FROM_HERE, |
68 base::Bind(base::ResetAndReturn(&init_cb_), false)); | 66 base::Bind(base::ResetAndReturn(&init_cb_), false)); |
69 } | 67 } |
70 if (!read_cb_.is_null()) { | 68 if (!read_cb_.is_null()) { |
71 task_runner_->PostTask(FROM_HERE, base::Bind( | 69 task_runner_->PostTask(FROM_HERE, base::Bind( |
72 base::ResetAndReturn(&read_cb_), ABORTED, scoped_refptr<Output>())); | 70 base::ResetAndReturn(&read_cb_), ABORTED, scoped_refptr<Output>())); |
73 } | 71 } |
74 if (!reset_cb_.is_null()) | 72 if (!reset_cb_.is_null()) |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 } | 530 } |
533 | 531 |
534 // The resetting process will be continued in OnDecoderReinitialized(). | 532 // The resetting process will be continued in OnDecoderReinitialized(). |
535 ReinitializeDecoder(); | 533 ReinitializeDecoder(); |
536 } | 534 } |
537 | 535 |
538 template class DecoderStream<DemuxerStream::VIDEO>; | 536 template class DecoderStream<DemuxerStream::VIDEO>; |
539 template class DecoderStream<DemuxerStream::AUDIO>; | 537 template class DecoderStream<DemuxerStream::AUDIO>; |
540 | 538 |
541 } // namespace media | 539 } // namespace media |
OLD | NEW |