Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: trunk/src/content/renderer/media/webrtc_audio_capturer.h

Issue 110303003: Revert 240548 "Enable platform echo cancellation through the Aud..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // consuming audio for capture. |session_id| is passed to the browser to 49 // consuming audio for capture. |session_id| is passed to the browser to
50 // decide which device to use. |device_id| is used to identify which device 50 // decide which device to use. |device_id| is used to identify which device
51 // the capturer is created for. Called on the main render thread. 51 // the capturer is created for. Called on the main render thread.
52 bool Initialize(int render_view_id, 52 bool Initialize(int render_view_id,
53 media::ChannelLayout channel_layout, 53 media::ChannelLayout channel_layout,
54 int sample_rate, 54 int sample_rate,
55 int buffer_size, 55 int buffer_size,
56 int session_id, 56 int session_id,
57 const std::string& device_id, 57 const std::string& device_id,
58 int paired_output_sample_rate, 58 int paired_output_sample_rate,
59 int paired_output_frames_per_buffer, 59 int paired_output_frames_per_buffer);
60 int effects);
61 60
62 // Add a audio track to the sinks of the capturer. 61 // Add a audio track to the sinks of the capturer.
63 // WebRtcAudioDeviceImpl calls this method on the main render thread but 62 // WebRtcAudioDeviceImpl calls this method on the main render thread but
64 // other clients may call it from other threads. The current implementation 63 // other clients may call it from other threads. The current implementation
65 // does not support multi-thread calling. 64 // does not support multi-thread calling.
66 // The first AddTrack will implicitly trigger the Start() of this object. 65 // The first AddTrack will implicitly trigger the Start() of this object.
67 // Called on the main render thread or libjingle working thread. 66 // Called on the main render thread or libjingle working thread.
68 void AddTrack(WebRtcLocalAudioTrack* track); 67 void AddTrack(WebRtcLocalAudioTrack* track);
69 68
70 // Remove a audio track from the sinks of the capturer. 69 // Remove a audio track from the sinks of the capturer.
71 // If the track has been added to the capturer, it must call RemoveTrack() 70 // If the track has been added to the capturer, it must call RemoveTrack()
72 // before it goes away. 71 // before it goes away.
73 // Called on the main render thread or libjingle working thread. 72 // Called on the main render thread or libjingle working thread.
74 void RemoveTrack(WebRtcLocalAudioTrack* track); 73 void RemoveTrack(WebRtcLocalAudioTrack* track);
75 74
76 // SetCapturerSource() is called if the client on the source side desires to 75 // SetCapturerSource() is called if the client on the source side desires to
77 // provide their own captured audio data. Client is responsible for calling 76 // provide their own captured audio data. Client is responsible for calling
78 // Start() on its own source to have the ball rolling. 77 // Start() on its own source to have the ball rolling.
79 // Called on the main render thread. 78 // Called on the main render thread.
80 void SetCapturerSource( 79 void SetCapturerSource(
81 const scoped_refptr<media::AudioCapturerSource>& source, 80 const scoped_refptr<media::AudioCapturerSource>& source,
82 media::ChannelLayout channel_layout, 81 media::ChannelLayout channel_layout,
83 float sample_rate, 82 float sample_rate);
84 int effects);
85 83
86 // Called when a stream is connecting to a peer connection. This will set 84 // Called when a stream is connecting to a peer connection. This will set
87 // up the native buffer size for the stream in order to optimize the 85 // up the native buffer size for the stream in order to optimize the
88 // performance for peer connection. 86 // performance for peer connection.
89 void EnablePeerConnectionMode(); 87 void EnablePeerConnectionMode();
90 88
91 // Volume APIs used by WebRtcAudioDeviceImpl. 89 // Volume APIs used by WebRtcAudioDeviceImpl.
92 // Called on the AudioInputDevice audio thread. 90 // Called on the AudioInputDevice audio thread.
93 void SetVolume(int volume); 91 void SetVolume(int volume);
94 int Volume() const; 92 int Volume() const;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // AudioCapturerSource::CaptureCallback implementation. 135 // AudioCapturerSource::CaptureCallback implementation.
138 // Called on the AudioInputDevice audio thread. 136 // Called on the AudioInputDevice audio thread.
139 virtual void Capture(media::AudioBus* audio_source, 137 virtual void Capture(media::AudioBus* audio_source,
140 int audio_delay_milliseconds, 138 int audio_delay_milliseconds,
141 double volume, 139 double volume,
142 bool key_pressed) OVERRIDE; 140 bool key_pressed) OVERRIDE;
143 virtual void OnCaptureError() OVERRIDE; 141 virtual void OnCaptureError() OVERRIDE;
144 142
145 // Reconfigures the capturer with a new capture parameters. 143 // Reconfigures the capturer with a new capture parameters.
146 // Must be called without holding the lock. 144 // Must be called without holding the lock.
147 void Reconfigure(int sample_rate, media::ChannelLayout channel_layout, 145 void Reconfigure(int sample_rate, media::ChannelLayout channel_layout);
148 int effects);
149 146
150 // Starts recording audio. 147 // Starts recording audio.
151 // Triggered by AddSink() on the main render thread or a Libjingle working 148 // Triggered by AddSink() on the main render thread or a Libjingle working
152 // thread. It should NOT be called under |lock_|. 149 // thread. It should NOT be called under |lock_|.
153 void Start(); 150 void Start();
154 151
155 // Helper function to get the buffer size based on |peer_connection_mode_| 152 // Helper function to get the buffer size based on |peer_connection_mode_|
156 // and sample rate; 153 // and sample rate;
157 int GetBufferSize(int sample_rate) const; 154 int GetBufferSize(int sample_rate) const;
158 155
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Cache value for the audio processing params. 199 // Cache value for the audio processing params.
203 base::TimeDelta audio_delay_; 200 base::TimeDelta audio_delay_;
204 bool key_pressed_; 201 bool key_pressed_;
205 202
206 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturer); 203 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturer);
207 }; 204 };
208 205
209 } // namespace content 206 } // namespace content
210 207
211 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ 208 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698