OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chromecast/media/cma/pipeline/audio_decoder_software_wrapper.h" | 5 #include "chromecast/media/cma/pipeline/audio_decoder_software_wrapper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "chromecast/media/cma/base/decoder_buffer_base.h" | 10 #include "chromecast/media/cma/base/decoder_buffer_base.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 bool AudioDecoderSoftwareWrapper::SetConfig(const AudioConfig& config) { | 52 bool AudioDecoderSoftwareWrapper::SetConfig(const AudioConfig& config) { |
53 DCHECK(delegate_); | 53 DCHECK(delegate_); |
54 DCHECK(IsValidConfig(config)); | 54 DCHECK(IsValidConfig(config)); |
55 | 55 |
56 if (backend_decoder_->SetConfig(config)) { | 56 if (backend_decoder_->SetConfig(config)) { |
57 software_decoder_.reset(); | 57 software_decoder_.reset(); |
58 output_config_ = config; | 58 output_config_ = config; |
59 return true; | 59 return true; |
60 } | 60 } |
61 | 61 |
62 if (config.is_encrypted || !CreateSoftwareDecoder(config)) | 62 if (config.is_encrypted() || !CreateSoftwareDecoder(config)) |
63 return false; | 63 return false; |
64 | 64 |
65 output_config_.codec = media::kCodecPCM; | 65 output_config_.codec = media::kCodecPCM; |
66 output_config_.sample_format = media::kSampleFormatS16; | 66 output_config_.sample_format = media::kSampleFormatS16; |
67 output_config_.channel_number = 2; | 67 output_config_.channel_number = 2; |
68 output_config_.bytes_per_channel = 2; | 68 output_config_.bytes_per_channel = 2; |
69 output_config_.samples_per_second = config.samples_per_second; | 69 output_config_.samples_per_second = config.samples_per_second; |
70 output_config_.is_encrypted = false; | 70 output_config_.encryption_scheme = EncryptionScheme(false); |
halliwell
2016/01/13 03:29:41
another example of 'false' ... not instantly reada
dougsteed
2016/02/09 22:58:53
Done.
| |
71 return backend_decoder_->SetConfig(output_config_); | 71 return backend_decoder_->SetConfig(output_config_); |
72 } | 72 } |
73 | 73 |
74 bool AudioDecoderSoftwareWrapper::SetVolume(float multiplier) { | 74 bool AudioDecoderSoftwareWrapper::SetVolume(float multiplier) { |
75 return backend_decoder_->SetVolume(multiplier); | 75 return backend_decoder_->SetVolume(multiplier); |
76 } | 76 } |
77 | 77 |
78 AudioDecoderSoftwareWrapper::RenderingDelay | 78 AudioDecoderSoftwareWrapper::RenderingDelay |
79 AudioDecoderSoftwareWrapper::GetRenderingDelay() { | 79 AudioDecoderSoftwareWrapper::GetRenderingDelay() { |
80 return backend_decoder_->GetRenderingDelay(); | 80 return backend_decoder_->GetRenderingDelay(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 DCHECK(delegate_); | 135 DCHECK(delegate_); |
136 delegate_->OnKeyStatusChanged(key_id, key_status, system_code); | 136 delegate_->OnKeyStatusChanged(key_id, key_status, system_code); |
137 } | 137 } |
138 | 138 |
139 void AudioDecoderSoftwareWrapper::OnVideoResolutionChanged(const Size& size) { | 139 void AudioDecoderSoftwareWrapper::OnVideoResolutionChanged(const Size& size) { |
140 NOTREACHED(); | 140 NOTREACHED(); |
141 } | 141 } |
142 | 142 |
143 } // namespace media | 143 } // namespace media |
144 } // namespace chromecast | 144 } // namespace chromecast |
OLD | NEW |