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_video_decoder.h" | 5 #include "media/filters/decrypting_video_decoder.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 12 matching lines...) Expand all Loading... |
23 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 23 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
24 const SetDecryptorReadyCB& set_decryptor_ready_cb) | 24 const SetDecryptorReadyCB& set_decryptor_ready_cb) |
25 : task_runner_(task_runner), | 25 : task_runner_(task_runner), |
26 state_(kUninitialized), | 26 state_(kUninitialized), |
27 set_decryptor_ready_cb_(set_decryptor_ready_cb), | 27 set_decryptor_ready_cb_(set_decryptor_ready_cb), |
28 decryptor_(NULL), | 28 decryptor_(NULL), |
29 key_added_while_decode_pending_(false), | 29 key_added_while_decode_pending_(false), |
30 trace_id_(0), | 30 trace_id_(0), |
31 weak_factory_(this) {} | 31 weak_factory_(this) {} |
32 | 32 |
| 33 std::string DecryptingVideoDecoder::GetDisplayName() const { |
| 34 return "DecryptingVideoDecoder"; |
| 35 } |
| 36 |
33 void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config, | 37 void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config, |
34 bool /* low_delay */, | 38 bool /* low_delay */, |
35 const PipelineStatusCB& status_cb, | 39 const PipelineStatusCB& status_cb, |
36 const OutputCB& output_cb) { | 40 const OutputCB& output_cb) { |
37 DVLOG(2) << "Initialize()"; | 41 DVLOG(2) << "Initialize()"; |
38 DCHECK(task_runner_->BelongsToCurrentThread()); | 42 DCHECK(task_runner_->BelongsToCurrentThread()); |
39 DCHECK(state_ == kUninitialized || | 43 DCHECK(state_ == kUninitialized || |
40 state_ == kIdle || | 44 state_ == kIdle || |
41 state_ == kDecodeFinished) << state_; | 45 state_ == kDecodeFinished) << state_; |
42 DCHECK(decode_cb_.is_null()); | 46 DCHECK(decode_cb_.is_null()); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 312 } |
309 | 313 |
310 void DecryptingVideoDecoder::DoReset() { | 314 void DecryptingVideoDecoder::DoReset() { |
311 DCHECK(init_cb_.is_null()); | 315 DCHECK(init_cb_.is_null()); |
312 DCHECK(decode_cb_.is_null()); | 316 DCHECK(decode_cb_.is_null()); |
313 state_ = kIdle; | 317 state_ = kIdle; |
314 base::ResetAndReturn(&reset_cb_).Run(); | 318 base::ResetAndReturn(&reset_cb_).Run(); |
315 } | 319 } |
316 | 320 |
317 } // namespace media | 321 } // namespace media |
OLD | NEW |