| 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/webrtc/api/mediastreaminterface.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 WebRtcAudioSinkAdapter::WebRtcAudioSinkAdapter( | 12 WebRtcAudioSinkAdapter::WebRtcAudioSinkAdapter( |
| 13 webrtc::AudioTrackSinkInterface* sink) | 13 webrtc::AudioTrackSinkInterface* sink) |
| 14 : sink_(sink) { | 14 : sink_(sink) { |
| 15 DCHECK(sink); | 15 DCHECK(sink); |
| 16 } | 16 } |
| 17 | 17 |
| 18 WebRtcAudioSinkAdapter::~WebRtcAudioSinkAdapter() { | 18 WebRtcAudioSinkAdapter::~WebRtcAudioSinkAdapter() { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 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_t[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 |