OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_pipeline_impl.h" | 5 #include "chromecast/media/cma/pipeline/audio_pipeline_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chromecast/media/cma/backend/audio_pipeline_device.h" | 8 #include "chromecast/media/cma/backend/audio_pipeline_device.h" |
9 #include "chromecast/media/cma/base/buffering_defs.h" | 9 #include "chromecast/media/cma/base/buffering_defs.h" |
10 #include "chromecast/media/cma/base/cma_logging.h" | 10 #include "chromecast/media/cma/base/cma_logging.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 void AudioPipelineImpl::SetVolume(float volume) { | 122 void AudioPipelineImpl::SetVolume(float volume) { |
123 audio_device_->SetStreamVolumeMultiplier(volume); | 123 audio_device_->SetStreamVolumeMultiplier(volume); |
124 } | 124 } |
125 | 125 |
126 void AudioPipelineImpl::OnUpdateConfig( | 126 void AudioPipelineImpl::OnUpdateConfig( |
127 StreamId id, | 127 StreamId id, |
128 const ::media::AudioDecoderConfig& audio_config, | 128 const ::media::AudioDecoderConfig& audio_config, |
129 const ::media::VideoDecoderConfig& video_config) { | 129 const ::media::VideoDecoderConfig& video_config) { |
| 130 DCHECK(!video_config.IsValidConfig()); |
130 if (audio_config.IsValidConfig()) { | 131 if (audio_config.IsValidConfig()) { |
131 CMALOG(kLogControl) << "AudioPipelineImpl::OnUpdateConfig id:" << id << " " | 132 CMALOG(kLogControl) << "AudioPipelineImpl::OnUpdateConfig id:" << id << " " |
132 << audio_config.AsHumanReadableString(); | 133 << audio_config.AsHumanReadableString(); |
133 | 134 |
134 bool success = audio_device_->SetConfig( | 135 bool success = audio_device_->SetConfig( |
135 DecoderConfigAdapter::ToCastAudioConfig(id, audio_config)); | 136 DecoderConfigAdapter::ToCastAudioConfig(id, audio_config)); |
136 if (!success && !audio_client_.playback_error_cb.is_null()) | 137 if (!success && !audio_client_.playback_error_cb.is_null()) |
137 audio_client_.playback_error_cb.Run(::media::PIPELINE_ERROR_DECODE); | 138 audio_client_.playback_error_cb.Run(::media::PIPELINE_ERROR_DECODE); |
138 } | 139 } |
139 } | 140 } |
(...skipping 13 matching lines...) Expand all Loading... |
153 delta_stats.audio_bytes_decoded = | 154 delta_stats.audio_bytes_decoded = |
154 current_stats.audio_bytes_decoded - previous_stats_.audio_bytes_decoded; | 155 current_stats.audio_bytes_decoded - previous_stats_.audio_bytes_decoded; |
155 | 156 |
156 previous_stats_ = current_stats; | 157 previous_stats_ = current_stats; |
157 | 158 |
158 audio_client_.statistics_cb.Run(delta_stats); | 159 audio_client_.statistics_cb.Run(delta_stats); |
159 } | 160 } |
160 | 161 |
161 } // namespace media | 162 } // namespace media |
162 } // namespace chromecast | 163 } // namespace chromecast |
OLD | NEW |