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

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

Issue 12440027: Do not pass the string device_id via IPC message to create an audio input stream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed Per's comments. Created 7 years, 9 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
« no previous file with comments | « content/renderer/media/webaudio_capturer_source.cc ('k') | content/renderer/media/webrtc_audio_capturer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f314e1a7545d6fedd71f3154c6171acb1da92962..5d35604891e834915b1e3f6952270bb60964507f 100644
--- a/content/renderer/media/webrtc_audio_capturer.h
+++ b/content/renderer/media/webrtc_audio_capturer.h
@@ -33,23 +33,22 @@ class WebRtcLocalAudioRenderer;
// created on the main render thread, captured data is provided on a dedicated
// AudioInputDevice thread, and methods can be called either on the Libjingle
// thread or on the main render thread but also other client threads
-// if an alternative AudioCapturerSource has been set. In addition, the
-// AudioCapturerSource::CaptureEventHandler methods are called on the IO thread
-// and requests for data to render is done on the AudioOutputDevice thread.
+// if an alternative AudioCapturerSource has been set.
class CONTENT_EXPORT WebRtcAudioCapturer
: public base::RefCountedThreadSafe<WebRtcAudioCapturer>,
- NON_EXPORTED_BASE(public media::AudioCapturerSource::CaptureCallback),
- NON_EXPORTED_BASE(
- public media::AudioCapturerSource::CaptureEventHandler) {
+ NON_EXPORTED_BASE(public media::AudioCapturerSource::CaptureCallback) {
public:
// Use to construct the audio capturer.
// Called on the main render thread.
static scoped_refptr<WebRtcAudioCapturer> CreateCapturer();
// Creates and configures the default audio capturing source using the
- // provided audio parameters.
+ // provided audio parameters, |session_id| is passed to the browser to
+ // decide which device to use.
// Called on the main render thread.
- bool Initialize(media::ChannelLayout channel_layout, int sample_rate);
+ bool Initialize(media::ChannelLayout channel_layout,
+ int sample_rate,
+ int session_id);
// Called by the client on the sink side to add a sink.
// WebRtcAudioDeviceImpl calls this method on the main render thread but
@@ -84,10 +83,6 @@ class CONTENT_EXPORT WebRtcAudioCapturer
// Called on the AudioInputDevice audio thread.
void SetVolume(double volume);
- // Specifies the |session_id| to query which device to use.
- // Called on the main render thread.
- void SetDevice(int session_id);
-
// Enables or disables the WebRtc AGC control.
// Called from a Libjingle working thread.
void SetAutomaticGainControl(bool enable);
@@ -109,11 +104,6 @@ class CONTENT_EXPORT WebRtcAudioCapturer
double volume) OVERRIDE;
virtual void OnCaptureError() OVERRIDE;
- // AudioCapturerSource::CaptureEventHandler implementation.
- // Called on the IO thread.
- virtual void OnDeviceStarted(const std::string& device_id) OVERRIDE;
- virtual void OnDeviceStopped() OVERRIDE;
-
protected:
friend class base::RefCountedThreadSafe<WebRtcAudioCapturer>;
virtual ~WebRtcAudioCapturer();
@@ -145,12 +135,14 @@ class CONTENT_EXPORT WebRtcAudioCapturer
// Allocated during initialization.
class ConfiguredBuffer;
scoped_refptr<ConfiguredBuffer> buffer_;
- std::string device_id_;
bool running_;
// True when automatic gain control is enabled, false otherwise.
bool agc_is_enabled_;
+ // The media session ID used to identify which input device to be started.
+ int session_id_;
+
DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturer);
};
« no previous file with comments | « content/renderer/media/webaudio_capturer_source.cc ('k') | content/renderer/media/webrtc_audio_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698