| 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "content/renderer/media/webrtc/webrtc_audio_sink_adapter.h" | 6 #include "content/renderer/media/webrtc/webrtc_audio_sink_adapter.h" |
| 7 #include "media/base/audio_bus.h" | 7 #include "media/base/audio_bus.h" |
| 8 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 8 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 audio_bus.channels(), | 38 audio_bus.channels(), |
| 39 audio_bus.frames()); | 39 audio_bus.frames()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void WebRtcAudioSinkAdapter::OnSetFormat( | 42 void WebRtcAudioSinkAdapter::OnSetFormat( |
| 43 const media::AudioParameters& params) { | 43 const media::AudioParameters& params) { |
| 44 DCHECK(params.IsValid()); | 44 DCHECK(params.IsValid()); |
| 45 params_ = params; | 45 params_ = params; |
| 46 const int num_pcm16_data_elements = | 46 const int num_pcm16_data_elements = |
| 47 params_.frames_per_buffer() * params_.channels(); | 47 params_.frames_per_buffer() * params_.channels(); |
| 48 interleaved_data_.reset(new int16[num_pcm16_data_elements]); | 48 interleaved_data_.reset(new int16_t[num_pcm16_data_elements]); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace content | 51 } // namespace content |
| OLD | NEW |