| 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 "content/renderer/media/webrtc_local_audio_source_provider.h" | 5 #include "content/renderer/media/webrtc_local_audio_source_provider.h" | 
| 6 | 6 | 
| 7 #include "base/logging.h" | 7 #include "base/logging.h" | 
| 8 #include "content/public/renderer/render_frame.h" | 8 #include "content/public/renderer/render_frame.h" | 
| 9 #include "content/renderer/media/audio_device_factory.h" | 9 #include "content/renderer/media/audio_device_factory.h" | 
| 10 #include "media/base/audio_fifo.h" | 10 #include "media/base/audio_fifo.h" | 
| 11 #include "media/base/audio_parameters.h" | 11 #include "media/base/audio_parameters.h" | 
| 12 #include "third_party/WebKit/public/platform/WebAudioSourceProviderClient.h" | 12 #include "third_party/WebKit/public/platform/WebAudioSourceProviderClient.h" | 
| 13 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 13 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 
| 14 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 14 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 
| 15 | 15 | 
| 16 using blink::WebVector; | 16 using blink::WebVector; | 
| 17 | 17 | 
| 18 namespace content { | 18 namespace { | 
| 19 | 19 | 
| 20 static const size_t kMaxNumberOfBuffers = 10; | 20 static const size_t kMaxNumberOfBuffers = 10; | 
|  | 21 } | 
|  | 22 | 
|  | 23 namespace content { | 
| 21 | 24 | 
| 22 // Size of the buffer that WebAudio processes each time, it is the same value | 25 // Size of the buffer that WebAudio processes each time, it is the same value | 
| 23 // as AudioNode::ProcessingSizeInFrames in WebKit. | 26 // as AudioNode::ProcessingSizeInFrames in WebKit. | 
| 24 // static | 27 // static | 
| 25 const size_t WebRtcLocalAudioSourceProvider::kWebAudioRenderBufferSize = 128; | 28 const size_t WebRtcLocalAudioSourceProvider::kWebAudioRenderBufferSize = 128; | 
| 26 | 29 | 
| 27 WebRtcLocalAudioSourceProvider::WebRtcLocalAudioSourceProvider( | 30 WebRtcLocalAudioSourceProvider::WebRtcLocalAudioSourceProvider( | 
| 28     const blink::WebMediaStreamTrack& track) | 31     const blink::WebMediaStreamTrack& track) | 
| 29     : is_enabled_(false), | 32     : is_enabled_(false), | 
| 30       track_(track), | 33       track_(track), | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 150 | 153 | 
| 151   return 1.0; | 154   return 1.0; | 
| 152 } | 155 } | 
| 153 | 156 | 
| 154 void WebRtcLocalAudioSourceProvider::SetSinkParamsForTesting( | 157 void WebRtcLocalAudioSourceProvider::SetSinkParamsForTesting( | 
| 155     const media::AudioParameters& sink_params) { | 158     const media::AudioParameters& sink_params) { | 
| 156   sink_params_ = sink_params; | 159   sink_params_ = sink_params; | 
| 157 } | 160 } | 
| 158 | 161 | 
| 159 }  // namespace content | 162 }  // namespace content | 
| OLD | NEW | 
|---|