OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUDIO_CAPTURER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 // if an alternative AudioCapturerSource has been set. | 36 // if an alternative AudioCapturerSource has been set. |
37 class CONTENT_EXPORT WebRtcAudioCapturer | 37 class CONTENT_EXPORT WebRtcAudioCapturer |
38 : public base::RefCountedThreadSafe<WebRtcAudioCapturer>, | 38 : public base::RefCountedThreadSafe<WebRtcAudioCapturer>, |
39 NON_EXPORTED_BASE(public media::AudioCapturerSource::CaptureCallback) { | 39 NON_EXPORTED_BASE(public media::AudioCapturerSource::CaptureCallback) { |
40 public: | 40 public: |
41 // Use to construct the audio capturer. | 41 // Use to construct the audio capturer. |
42 // Called on the main render thread. | 42 // Called on the main render thread. |
43 static scoped_refptr<WebRtcAudioCapturer> CreateCapturer(); | 43 static scoped_refptr<WebRtcAudioCapturer> CreateCapturer(); |
44 | 44 |
45 // Creates and configures the default audio capturing source using the | 45 // Creates and configures the default audio capturing source using the |
46 // provided audio parameters, |session_id| is passed to the browser to | 46 // provided audio parameters. |render_view_id| specifies the render view |
47 // decide which device to use. | 47 // consuming audio for capture. |session_id| is passed to the browser to |
48 // Called on the main render thread. | 48 // decide which device to use. Called on the main render thread. |
49 bool Initialize(media::ChannelLayout channel_layout, | 49 bool Initialize(int render_view_id, |
| 50 media::ChannelLayout channel_layout, |
50 int sample_rate, | 51 int sample_rate, |
51 int session_id); | 52 int session_id); |
52 | 53 |
53 // Called by the client on the sink side to add a sink. | 54 // Called by the client on the sink side to add a sink. |
54 // WebRtcAudioDeviceImpl calls this method on the main render thread but | 55 // WebRtcAudioDeviceImpl calls this method on the main render thread but |
55 // other clients may call it from other threads. The current implementation | 56 // other clients may call it from other threads. The current implementation |
56 // does not support multi-thread calling. | 57 // does not support multi-thread calling. |
57 // Called on the main render thread. | 58 // Called on the main render thread. |
58 void AddCapturerSink(WebRtcAudioCapturerSink* sink); | 59 void AddCapturerSink(WebRtcAudioCapturerSink* sink); |
59 | 60 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 143 |
143 // The media session ID used to identify which input device to be started. | 144 // The media session ID used to identify which input device to be started. |
144 int session_id_; | 145 int session_id_; |
145 | 146 |
146 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturer); | 147 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturer); |
147 }; | 148 }; |
148 | 149 |
149 } // namespace content | 150 } // namespace content |
150 | 151 |
151 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ | 152 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ |
OLD | NEW |