OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fake_video_decoder.h" | 5 #include "media/filters/fake_video_decoder.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "media/base/bind_to_current_loop.h" | 8 #include "media/base/bind_to_current_loop.h" |
9 #include "media/base/test_helpers.h" | 9 #include "media/base/test_helpers.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 | 12 |
13 FakeVideoDecoder::FakeVideoDecoder(int decoding_delay, | 13 FakeVideoDecoder::FakeVideoDecoder(const std::string& decoder_name, |
| 14 int decoding_delay, |
14 int max_parallel_decoding_requests, | 15 int max_parallel_decoding_requests, |
15 const BytesDecodedCB& bytes_decoded_cb) | 16 const BytesDecodedCB& bytes_decoded_cb) |
16 : decoding_delay_(decoding_delay), | 17 : decoder_name_(decoder_name), |
| 18 decoding_delay_(decoding_delay), |
17 max_parallel_decoding_requests_(max_parallel_decoding_requests), | 19 max_parallel_decoding_requests_(max_parallel_decoding_requests), |
18 bytes_decoded_cb_(bytes_decoded_cb), | 20 bytes_decoded_cb_(bytes_decoded_cb), |
19 state_(STATE_UNINITIALIZED), | 21 state_(STATE_UNINITIALIZED), |
20 hold_decode_(false), | 22 hold_decode_(false), |
21 total_bytes_decoded_(0), | 23 total_bytes_decoded_(0), |
22 fail_to_initialize_(false), | 24 fail_to_initialize_(false), |
23 weak_factory_(this) { | 25 weak_factory_(this) { |
24 DVLOG(1) << __func__; | 26 DVLOG(1) << __func__; |
25 DCHECK_GE(decoding_delay, 0); | 27 DCHECK_GE(decoding_delay, 0); |
26 } | 28 } |
(...skipping 13 matching lines...) Expand all Loading... |
40 SatisfyReset(); | 42 SatisfyReset(); |
41 | 43 |
42 decoded_frames_.clear(); | 44 decoded_frames_.clear(); |
43 } | 45 } |
44 | 46 |
45 void FakeVideoDecoder::EnableEncryptedConfigSupport() { | 47 void FakeVideoDecoder::EnableEncryptedConfigSupport() { |
46 supports_encrypted_config_ = true; | 48 supports_encrypted_config_ = true; |
47 } | 49 } |
48 | 50 |
49 std::string FakeVideoDecoder::GetDisplayName() const { | 51 std::string FakeVideoDecoder::GetDisplayName() const { |
50 return "FakeVideoDecoder"; | 52 return decoder_name_; |
51 } | 53 } |
52 | 54 |
53 void FakeVideoDecoder::Initialize(const VideoDecoderConfig& config, | 55 void FakeVideoDecoder::Initialize(const VideoDecoderConfig& config, |
54 bool low_delay, | 56 bool low_delay, |
55 CdmContext* cdm_context, | 57 CdmContext* cdm_context, |
56 const InitCB& init_cb, | 58 const InitCB& init_cb, |
57 const OutputCB& output_cb) { | 59 const OutputCB& output_cb) { |
58 DVLOG(1) << __func__; | 60 DVLOG(1) << __func__; |
59 DCHECK(thread_checker_.CalledOnValidThread()); | 61 DCHECK(thread_checker_.CalledOnValidThread()); |
60 DCHECK(config.IsValidConfig()); | 62 DCHECK(config.IsValidConfig()); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 266 |
265 void FakeVideoDecoder::DoReset() { | 267 void FakeVideoDecoder::DoReset() { |
266 DCHECK(thread_checker_.CalledOnValidThread()); | 268 DCHECK(thread_checker_.CalledOnValidThread()); |
267 DCHECK(held_decode_callbacks_.empty()); | 269 DCHECK(held_decode_callbacks_.empty()); |
268 DCHECK(!reset_cb_.IsNull()); | 270 DCHECK(!reset_cb_.IsNull()); |
269 | 271 |
270 reset_cb_.RunOrHold(); | 272 reset_cb_.RunOrHold(); |
271 } | 273 } |
272 | 274 |
273 } // namespace media | 275 } // namespace media |
OLD | NEW |