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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 void AudioPipelineImpl::Initialize( | 103 void AudioPipelineImpl::Initialize( |
104 const ::media::AudioDecoderConfig& audio_config, | 104 const ::media::AudioDecoderConfig& audio_config, |
105 scoped_ptr<CodedFrameProvider> frame_provider, | 105 scoped_ptr<CodedFrameProvider> frame_provider, |
106 const ::media::PipelineStatusCB& status_cb) { | 106 const ::media::PipelineStatusCB& status_cb) { |
107 CMALOG(kLogControl) << "AudioPipelineImpl::Initialize " | 107 CMALOG(kLogControl) << "AudioPipelineImpl::Initialize " |
108 << audio_config.AsHumanReadableString(); | 108 << audio_config.AsHumanReadableString(); |
109 if (frame_provider) | 109 if (frame_provider) |
110 SetCodedFrameProvider(frame_provider.Pass()); | 110 SetCodedFrameProvider(frame_provider.Pass()); |
111 | 111 |
| 112 DCHECK(audio_config.IsValidConfig()); |
112 if (!audio_device_->SetConfig( | 113 if (!audio_device_->SetConfig( |
113 DecoderConfigAdapter::ToCastAudioConfig(kPrimary, audio_config)) || | 114 DecoderConfigAdapter::ToCastAudioConfig(kPrimary, audio_config)) || |
114 !av_pipeline_impl_->Initialize()) { | 115 !av_pipeline_impl_->Initialize()) { |
115 status_cb.Run(::media::PIPELINE_ERROR_INITIALIZATION_FAILED); | 116 status_cb.Run(::media::PIPELINE_ERROR_INITIALIZATION_FAILED); |
116 return; | 117 return; |
117 } | 118 } |
118 av_pipeline_impl_->TransitionToState(AvPipelineImpl::kFlushed); | 119 av_pipeline_impl_->TransitionToState(AvPipelineImpl::kFlushed); |
119 status_cb.Run(::media::PIPELINE_OK); | 120 status_cb.Run(::media::PIPELINE_OK); |
120 } | 121 } |
121 | 122 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |