| 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 16 matching lines...) Expand all Loading... |
| 27 const char* GetTraceString<DemuxerStream::VIDEO>() { | 27 const char* GetTraceString<DemuxerStream::VIDEO>() { |
| 28 return "DecoderStream<VIDEO>::Decode"; | 28 return "DecoderStream<VIDEO>::Decode"; |
| 29 } | 29 } |
| 30 | 30 |
| 31 template <DemuxerStream::Type StreamType> | 31 template <DemuxerStream::Type StreamType> |
| 32 DecoderStream<StreamType>::DecoderStream( | 32 DecoderStream<StreamType>::DecoderStream( |
| 33 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 33 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 34 ScopedVector<Decoder> decoders, | 34 ScopedVector<Decoder> decoders, |
| 35 const SetDecryptorReadyCB& set_decryptor_ready_cb) | 35 const SetDecryptorReadyCB& set_decryptor_ready_cb) |
| 36 : task_runner_(task_runner), | 36 : task_runner_(task_runner), |
| 37 weak_factory_(this), | |
| 38 state_(STATE_UNINITIALIZED), | 37 state_(STATE_UNINITIALIZED), |
| 39 stream_(NULL), | 38 stream_(NULL), |
| 40 decoder_selector_( | 39 decoder_selector_( |
| 41 new DecoderSelector<StreamType>(task_runner, | 40 new DecoderSelector<StreamType>(task_runner, |
| 42 decoders.Pass(), | 41 decoders.Pass(), |
| 43 set_decryptor_ready_cb)) {} | 42 set_decryptor_ready_cb)), |
| 43 weak_factory_(this) {} |
| 44 | 44 |
| 45 template <DemuxerStream::Type StreamType> | 45 template <DemuxerStream::Type StreamType> |
| 46 DecoderStream<StreamType>::~DecoderStream() { | 46 DecoderStream<StreamType>::~DecoderStream() { |
| 47 DCHECK(state_ == STATE_UNINITIALIZED || state_ == STATE_STOPPED) << state_; | 47 DCHECK(state_ == STATE_UNINITIALIZED || state_ == STATE_STOPPED) << state_; |
| 48 } | 48 } |
| 49 | 49 |
| 50 template <DemuxerStream::Type StreamType> | 50 template <DemuxerStream::Type StreamType> |
| 51 void DecoderStream<StreamType>::Initialize(DemuxerStream* stream, | 51 void DecoderStream<StreamType>::Initialize(DemuxerStream* stream, |
| 52 const StatisticsCB& statistics_cb, | 52 const StatisticsCB& statistics_cb, |
| 53 const InitCB& init_cb) { | 53 const InitCB& init_cb) { |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 state_ = STATE_STOPPED; | 487 state_ = STATE_STOPPED; |
| 488 stream_ = NULL; | 488 stream_ = NULL; |
| 489 decoder_.reset(); | 489 decoder_.reset(); |
| 490 decrypting_demuxer_stream_.reset(); | 490 decrypting_demuxer_stream_.reset(); |
| 491 base::ResetAndReturn(&stop_cb_).Run(); | 491 base::ResetAndReturn(&stop_cb_).Run(); |
| 492 } | 492 } |
| 493 | 493 |
| 494 template class DecoderStream<DemuxerStream::VIDEO>; | 494 template class DecoderStream<DemuxerStream::VIDEO>; |
| 495 | 495 |
| 496 } // namespace media | 496 } // namespace media |
| OLD | NEW |