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

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

Issue 133903004: Cleaned up the WebRtcAudioCapturer a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and fixed the comment. Created 6 years, 11 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_device_impl.h
diff --git a/content/renderer/media/webrtc_audio_device_impl.h b/content/renderer/media/webrtc_audio_device_impl.h
index 1d904fa496202277130bc900edb0aea72b525472..f9279f5f6ff5c4986b1afd62e5223228426ae690 100644
--- a/content/renderer/media/webrtc_audio_device_impl.h
+++ b/content/renderer/media/webrtc_audio_device_impl.h
@@ -299,14 +299,21 @@ class CONTENT_EXPORT WebRtcAudioDeviceImpl
// Called on the main renderer thread.
bool SetAudioRenderer(WebRtcAudioRenderer* renderer);
- // Adds the capturer to the ADM.
+ // Adds/Removes the capturer to the ADM.
+ // TODO(xians): Remove these two methods once the ADM does not need to pass
+ // hardware information up to WebRtc.
void AddAudioCapturer(const scoped_refptr<WebRtcAudioCapturer>& capturer);
-
- // Gets the default capturer, which is the capturer in the list with
- // a valid |device_id|. Microphones are represented by capturers with a valid
- // |device_id|, since only one microphone is supported today, only one
- // capturer in the |capturers_| can have a valid |device_id|.
- scoped_refptr<WebRtcAudioCapturer> GetDefaultCapturer() const;
+ void RemoveAudioCapturer(const scoped_refptr<WebRtcAudioCapturer>& capturer);
+
+ // Gets paired device information of the capture device for the audio
+ // renderer. This is used to pass on a session id, sample rate and buffer
+ // size to a webrtc audio renderer (either local or remote), so that audio
+ // will be rendered to a matching output device.
+ // Returns true if the capture device has a paired output device, otherwise
+ // false. Note that if there are more than one open capture device the
+ // function will not be able to pick an appropriate device and return false.
+ bool GetAuthorizedDeviceInfoForAudioRenderer(
+ int* session_id, int* output_sample_rate, int* output_buffer_size);
const scoped_refptr<WebRtcAudioRenderer>& renderer() const {
return renderer_;
@@ -355,6 +362,10 @@ class CONTENT_EXPORT WebRtcAudioDeviceImpl
virtual void SetRenderFormat(const media::AudioParameters& params) OVERRIDE;
virtual void RemoveAudioRenderer(WebRtcAudioRenderer* renderer) OVERRIDE;
+ // Helper to get the default capturer, which is the last capturer in
+ // |capturers_|.
+ scoped_refptr<WebRtcAudioCapturer> GetDefaultCapturer() const;
+
// Used to DCHECK that we are called on the correct thread.
base::ThreadChecker thread_checker_;
« no previous file with comments | « content/renderer/media/webrtc_audio_capturer_unittest.cc ('k') | content/renderer/media/webrtc_audio_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698