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/decrypting_demuxer_stream.h" | 5 #include "media/filters/decrypting_demuxer_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/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "media/base/bind_to_current_loop.h" | 13 #include "media/base/bind_to_current_loop.h" |
14 #include "media/base/decoder_buffer.h" | 14 #include "media/base/decoder_buffer.h" |
15 #include "media/base/media_log.h" | 15 #include "media/base/media_log.h" |
16 #include "media/base/media_util.h" | 16 #include "media/base/media_util.h" |
17 | 17 |
18 namespace media { | 18 namespace media { |
19 | 19 |
20 static bool IsStreamValid(DemuxerStream* stream) { | 20 static bool IsStreamValid(DemuxerStream* stream) { |
21 return ((stream->type() == DemuxerStream::AUDIO && | 21 return ((stream->type() == DemuxerStream::AUDIO && |
22 stream->audio_decoder_config().IsValidConfig()) || | 22 stream->audio_decoder_config().IsValidConfig()) || |
23 (stream->type() == DemuxerStream::VIDEO && | 23 (stream->type() == DemuxerStream::VIDEO && |
24 stream->video_decoder_config().IsValidConfig())); | 24 stream->video_decoder_config().IsValidConfig())); |
25 } | 25 } |
26 | 26 |
27 DecryptingDemuxerStream::DecryptingDemuxerStream( | 27 DecryptingDemuxerStream::DecryptingDemuxerStream( |
28 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 28 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
29 const scoped_refptr<MediaLog>& media_log, | 29 MediaLog* media_log, |
30 const base::Closure& waiting_for_decryption_key_cb) | 30 const base::Closure& waiting_for_decryption_key_cb) |
31 : task_runner_(task_runner), | 31 : task_runner_(task_runner), |
32 media_log_(media_log), | 32 media_log_(media_log), |
33 state_(kUninitialized), | 33 state_(kUninitialized), |
34 waiting_for_decryption_key_cb_(waiting_for_decryption_key_cb), | 34 waiting_for_decryption_key_cb_(waiting_for_decryption_key_cb), |
35 demuxer_stream_(NULL), | 35 demuxer_stream_(NULL), |
36 decryptor_(NULL), | 36 decryptor_(NULL), |
37 key_added_while_decrypt_pending_(false), | 37 key_added_while_decrypt_pending_(false), |
38 weak_factory_(this) {} | 38 weak_factory_(this) {} |
39 | 39 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 break; | 377 break; |
378 } | 378 } |
379 | 379 |
380 default: | 380 default: |
381 NOTREACHED(); | 381 NOTREACHED(); |
382 return; | 382 return; |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 } // namespace media | 386 } // namespace media |
OLD | NEW |