| 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 "decoder_selector.h" | 5 #include "decoder_selector.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_to_current_loop.h" |
| 8 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 11 #include "media/base/audio_decoder.h" | 12 #include "media/base/audio_decoder.h" |
| 12 #include "media/base/bind_to_current_loop.h" | |
| 13 #include "media/base/demuxer_stream.h" | 13 #include "media/base/demuxer_stream.h" |
| 14 #include "media/base/pipeline.h" | 14 #include "media/base/pipeline.h" |
| 15 #include "media/base/video_decoder.h" | 15 #include "media/base/video_decoder.h" |
| 16 #include "media/filters/decoder_stream_traits.h" | 16 #include "media/filters/decoder_stream_traits.h" |
| 17 #include "media/filters/decrypting_audio_decoder.h" | 17 #include "media/filters/decrypting_audio_decoder.h" |
| 18 #include "media/filters/decrypting_demuxer_stream.h" | 18 #include "media/filters/decrypting_demuxer_stream.h" |
| 19 #include "media/filters/decrypting_video_decoder.h" | 19 #include "media/filters/decrypting_video_decoder.h" |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| 22 | 22 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 const base::Closure& waiting_for_decryption_key_cb) { | 79 const base::Closure& waiting_for_decryption_key_cb) { |
| 80 DVLOG(2) << __FUNCTION__; | 80 DVLOG(2) << __FUNCTION__; |
| 81 DCHECK(task_runner_->BelongsToCurrentThread()); | 81 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 82 DCHECK(stream); | 82 DCHECK(stream); |
| 83 DCHECK(select_decoder_cb_.is_null()); | 83 DCHECK(select_decoder_cb_.is_null()); |
| 84 | 84 |
| 85 set_decryptor_ready_cb_ = set_decryptor_ready_cb; | 85 set_decryptor_ready_cb_ = set_decryptor_ready_cb; |
| 86 waiting_for_decryption_key_cb_ = waiting_for_decryption_key_cb; | 86 waiting_for_decryption_key_cb_ = waiting_for_decryption_key_cb; |
| 87 | 87 |
| 88 // Make sure |select_decoder_cb| runs on a different execution stack. | 88 // Make sure |select_decoder_cb| runs on a different execution stack. |
| 89 select_decoder_cb_ = BindToCurrentLoop(select_decoder_cb); | 89 select_decoder_cb_ = base::BindToCurrentLoop(select_decoder_cb); |
| 90 | 90 |
| 91 if (!HasValidStreamConfig(stream)) { | 91 if (!HasValidStreamConfig(stream)) { |
| 92 DLOG(ERROR) << "Invalid stream config."; | 92 DLOG(ERROR) << "Invalid stream config."; |
| 93 ReturnNullDecoder(); | 93 ReturnNullDecoder(); |
| 94 return; | 94 return; |
| 95 } | 95 } |
| 96 | 96 |
| 97 input_stream_ = stream; | 97 input_stream_ = stream; |
| 98 output_cb_ = output_cb; | 98 output_cb_ = output_cb; |
| 99 | 99 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 204 |
| 205 // These forward declarations tell the compiler that we will use | 205 // These forward declarations tell the compiler that we will use |
| 206 // DecoderSelector with these arguments, allowing us to keep these definitions | 206 // DecoderSelector with these arguments, allowing us to keep these definitions |
| 207 // in our .cc without causing linker errors. This also means if anyone tries to | 207 // in our .cc without causing linker errors. This also means if anyone tries to |
| 208 // instantiate a DecoderSelector with anything but these two specializations | 208 // instantiate a DecoderSelector with anything but these two specializations |
| 209 // they'll most likely get linker errors. | 209 // they'll most likely get linker errors. |
| 210 template class DecoderSelector<DemuxerStream::AUDIO>; | 210 template class DecoderSelector<DemuxerStream::AUDIO>; |
| 211 template class DecoderSelector<DemuxerStream::VIDEO>; | 211 template class DecoderSelector<DemuxerStream::VIDEO>; |
| 212 | 212 |
| 213 } // namespace media | 213 } // namespace media |
| OLD | NEW |