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_audio_decoder.h" | 5 #include "media/filters/decrypting_audio_decoder.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 DecryptingAudioDecoder::DecryptingAudioDecoder( | 37 DecryptingAudioDecoder::DecryptingAudioDecoder( |
38 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 38 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
39 const SetDecryptorReadyCB& set_decryptor_ready_cb) | 39 const SetDecryptorReadyCB& set_decryptor_ready_cb) |
40 : task_runner_(task_runner), | 40 : task_runner_(task_runner), |
41 state_(kUninitialized), | 41 state_(kUninitialized), |
42 set_decryptor_ready_cb_(set_decryptor_ready_cb), | 42 set_decryptor_ready_cb_(set_decryptor_ready_cb), |
43 decryptor_(NULL), | 43 decryptor_(NULL), |
44 key_added_while_decode_pending_(false), | 44 key_added_while_decode_pending_(false), |
45 weak_factory_(this) {} | 45 weak_factory_(this) {} |
46 | 46 |
| 47 std::string DecryptingAudioDecoder::GetDisplayName() const { |
| 48 return "DecryptingAudioDecoder"; |
| 49 } |
| 50 |
47 void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config, | 51 void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config, |
48 const PipelineStatusCB& status_cb, | 52 const PipelineStatusCB& status_cb, |
49 const OutputCB& output_cb) { | 53 const OutputCB& output_cb) { |
50 DVLOG(2) << "Initialize()"; | 54 DVLOG(2) << "Initialize()"; |
51 DCHECK(task_runner_->BelongsToCurrentThread()); | 55 DCHECK(task_runner_->BelongsToCurrentThread()); |
52 DCHECK(decode_cb_.is_null()); | 56 DCHECK(decode_cb_.is_null()); |
53 DCHECK(reset_cb_.is_null()); | 57 DCHECK(reset_cb_.is_null()); |
54 | 58 |
55 weak_this_ = weak_factory_.GetWeakPtr(); | 59 weak_this_ = weak_factory_.GetWeakPtr(); |
56 init_cb_ = BindToCurrentLoop(status_cb); | 60 init_cb_ = BindToCurrentLoop(status_cb); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 } | 358 } |
355 | 359 |
356 frame->set_timestamp(current_time); | 360 frame->set_timestamp(current_time); |
357 timestamp_helper_->AddFrames(frame->frame_count()); | 361 timestamp_helper_->AddFrames(frame->frame_count()); |
358 | 362 |
359 output_cb_.Run(frame); | 363 output_cb_.Run(frame); |
360 } | 364 } |
361 } | 365 } |
362 | 366 |
363 } // namespace media | 367 } // namespace media |
OLD | NEW |