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

Unified Diff: content/renderer/media/webrtc_audio_capturer.h

Issue 15979027: start/stop the source of the capturer when 1st audiotrack/last audiotrack is added/removed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_audio_capturer.h
diff --git a/content/renderer/media/webrtc_audio_capturer.h b/content/renderer/media/webrtc_audio_capturer.h
index 12e0a346890b4695480e87ca810821a322f63db9..e365f6e56812078cdeee396695aa3ec337819e58 100644
--- a/content/renderer/media/webrtc_audio_capturer.h
+++ b/content/renderer/media/webrtc_audio_capturer.h
@@ -52,15 +52,22 @@ class CONTENT_EXPORT WebRtcAudioCapturer
int sample_rate,
int session_id);
+ // Called by the WebRtcAudioDeviceImpl to add the ADM as the default sink to
henrika (OOO until Aug 14) 2013/06/05 09:09:20 Please add some comments about the effects are by
no longer working on chromium 2013/06/05 16:29:45 Not the existing unittests, but I have already add
+ // the capturer. This function is needed since WebRTC supports only one ADM
+ // but multiple audio tracks, so the ADM can't be the sink of certain audio
+ // track now.
+ // TODO(xians): Remove this function after WebRtc supports multiple ADMs.
+ void SetDefaultSink(WebRtcAudioCapturerSink* sink);
+
// Add a audio track to the sinks of the capturer.
// WebRtcAudioDeviceImpl calls this method on the main render thread but
// other clients may call it from other threads. The current implementation
// does not support multi-thread calling.
- // Called on the main render thread.
+ // Called on the main render thread or libjingle working thread.
void AddSink(WebRtcAudioCapturerSink* track);
// Remove a audio track from the sinks of the capturer.
- // Called on the main render thread.
+ // Called on the main render thread or libjingle working thread.
void RemoveSink(WebRtcAudioCapturerSink* track);
// SetCapturerSource() is called if the client on the source side desires to
@@ -72,14 +79,6 @@ class CONTENT_EXPORT WebRtcAudioCapturer
media::ChannelLayout channel_layout,
float sample_rate);
- // Starts recording audio.
- // Called on the main render thread or a Libjingle working thread.
- void Start();
-
- // Stops recording audio.
- // Called on the main render thread or a Libjingle working thread.
- void Stop();
-
// Sets the microphone volume.
// Called on the AudioInputDevice audio thread.
void SetVolume(double volume);
@@ -117,6 +116,17 @@ class CONTENT_EXPORT WebRtcAudioCapturer
// Must be called without holding the lock. Returns true on success.
bool Reconfigure(int sample_rate, media::ChannelLayout channel_layout);
+ // Starts recording audio.
+ // Triggered by AddSink() on the main render thread or a Libjingle working
+ // thread. It should NOT be called under |lock_|.
+ void Start();
+
+ // Stops recording audio.
+ // Triggered by RemoveSink() on the main render thread or a Libjingle working
+ // thread. It should NOT be called under |lock_|.
+ void Stop();
+
+
// Used to DCHECK that we are called on the correct thread.
base::ThreadChecker thread_checker_;
@@ -127,6 +137,8 @@ class CONTENT_EXPORT WebRtcAudioCapturer
// A list of audio tracks that the audio data is fed to.
TrackList tracks_;
+ WebRtcAudioCapturerSink* default_sink_;
henrika (OOO until Aug 14) 2013/06/05 09:09:20 Add comment.
no longer working on chromium 2013/06/05 16:29:45 Done.
+
// The audio data source from the browser process.
scoped_refptr<media::AudioCapturerSource> source_;

Powered by Google App Engine
This is Rietveld 408576698