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/cast/audio_receiver/audio_decoder.h" | 5 #include "media/cast/audio_receiver/audio_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 audio_bus = AudioBus::Create(num_channels_, num_samples).Pass(); | 193 audio_bus = AudioBus::Create(num_channels_, num_samples).Pass(); |
194 audio_bus->FromInterleaved(pcm_data, num_samples, sizeof(int16)); | 194 audio_bus->FromInterleaved(pcm_data, num_samples, sizeof(int16)); |
195 return audio_bus.Pass(); | 195 return audio_bus.Pass(); |
196 } | 196 } |
197 | 197 |
198 DISALLOW_COPY_AND_ASSIGN(Pcm16Impl); | 198 DISALLOW_COPY_AND_ASSIGN(Pcm16Impl); |
199 }; | 199 }; |
200 | 200 |
201 AudioDecoder::AudioDecoder( | 201 AudioDecoder::AudioDecoder( |
202 const scoped_refptr<CastEnvironment>& cast_environment, | 202 const scoped_refptr<CastEnvironment>& cast_environment, |
203 const AudioReceiverConfig& audio_config) | 203 const FrameReceiverConfig& audio_config) |
204 : cast_environment_(cast_environment) { | 204 : cast_environment_(cast_environment) { |
205 switch (audio_config.codec) { | 205 switch (audio_config.codec.audio) { |
206 case transport::kOpus: | 206 case transport::kOpus: |
207 impl_ = new OpusImpl(cast_environment, | 207 impl_ = new OpusImpl(cast_environment, |
208 audio_config.channels, | 208 audio_config.channels, |
209 audio_config.frequency); | 209 audio_config.frequency); |
210 break; | 210 break; |
211 case transport::kPcm16: | 211 case transport::kPcm16: |
212 impl_ = new Pcm16Impl(cast_environment, | 212 impl_ = new Pcm16Impl(cast_environment, |
213 audio_config.channels, | 213 audio_config.channels, |
214 audio_config.frequency); | 214 audio_config.frequency); |
215 break; | 215 break; |
(...skipping 23 matching lines...) Expand all Loading... |
239 cast_environment_->PostTask(CastEnvironment::AUDIO, | 239 cast_environment_->PostTask(CastEnvironment::AUDIO, |
240 FROM_HERE, | 240 FROM_HERE, |
241 base::Bind(&AudioDecoder::ImplBase::DecodeFrame, | 241 base::Bind(&AudioDecoder::ImplBase::DecodeFrame, |
242 impl_, | 242 impl_, |
243 base::Passed(&encoded_frame), | 243 base::Passed(&encoded_frame), |
244 callback)); | 244 callback)); |
245 } | 245 } |
246 | 246 |
247 } // namespace cast | 247 } // namespace cast |
248 } // namespace media | 248 } // namespace media |
OLD | NEW |