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 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 public: | 42 public: |
43 static const size_t kWebAudioRenderBufferSize; | 43 static const size_t kWebAudioRenderBufferSize; |
44 | 44 |
45 WebRtcLocalAudioSourceProvider(); | 45 WebRtcLocalAudioSourceProvider(); |
46 virtual ~WebRtcLocalAudioSourceProvider(); | 46 virtual ~WebRtcLocalAudioSourceProvider(); |
47 | 47 |
48 // Initialize function for the souce provider. This can be called multiple | 48 // Initialize function for the souce provider. This can be called multiple |
49 // times if the source format has changed. | 49 // times if the source format has changed. |
50 void Initialize(const media::AudioParameters& source_params); | 50 void Initialize(const media::AudioParameters& source_params); |
51 | 51 |
| 52 // TODO(xians): Merge with the sink interface. |
52 // Called by the WebRtcAudioCapturer to deliever captured data into fifo on | 53 // Called by the WebRtcAudioCapturer to deliever captured data into fifo on |
53 // the capture audio thread. | 54 // the capture audio thread. |
54 void DeliverData(media::AudioBus* audio_source, | 55 void DeliverData(const int16* data, |
55 int audio_delay_milliseconds, | 56 int sample_rate, |
56 int volume, | 57 int number_of_channels, |
57 bool key_pressed); | 58 int number_of_frames); |
58 | 59 |
59 // Called by the WebAudioCapturerSource to get the audio processing params. | 60 // Called by the WebAudioCapturerSource to get the audio processing params. |
60 // This function is triggered by provideInput() on the WebAudio audio thread, | 61 // This function is triggered by provideInput() on the WebAudio audio thread, |
61 // so it has been under the protection of |lock_|. | 62 // so it has been under the protection of |lock_|. |
62 void GetAudioProcessingParams(int* delay_ms, int* volume, bool* key_pressed); | 63 void GetAudioProcessingParams(int* delay_ms, int* volume, bool* key_pressed); |
63 | 64 |
64 // WebKit::WebAudioSourceProvider implementation. | 65 // WebKit::WebAudioSourceProvider implementation. |
65 virtual void setClient(WebKit::WebAudioSourceProviderClient* client) OVERRIDE; | 66 virtual void setClient(WebKit::WebAudioSourceProviderClient* client) OVERRIDE; |
66 virtual void provideInput(const WebKit::WebVector<float*>& audio_data, | 67 virtual void provideInput(const WebKit::WebVector<float*>& audio_data, |
67 size_t number_of_frames) OVERRIDE; | 68 size_t number_of_frames) OVERRIDE; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 101 |
101 // Used to report the correct delay to |webaudio_source_|. | 102 // Used to report the correct delay to |webaudio_source_|. |
102 base::TimeTicks last_fill_; | 103 base::TimeTicks last_fill_; |
103 | 104 |
104 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioSourceProvider); | 105 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioSourceProvider); |
105 }; | 106 }; |
106 | 107 |
107 } // namespace content | 108 } // namespace content |
108 | 109 |
109 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ | 110 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_SOURCE_PROVIDER_H_ |
OLD | NEW |