| 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 e5650914363a5142af6274da245a930b987d2ddc..a1d7c0113bfa37c269b04eb94d32b94bf74bd187 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 used to be 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();
|
| @@ -128,21 +118,11 @@ class CONTENT_EXPORT WebRtcAudioCapturer
|
| // Must be called without holding the lock. Returns true on success.
|
| bool Reconfigure(int sample_rate, media::ChannelLayout channel_layout);
|
|
|
| - // Distributes information about a stopped capture device to all registered
|
| - // capture sinks.
|
| - // Runs on the main render thread.
|
| - void DoOnDeviceStopped();
|
| -
|
| // Used to DCHECK that we are called on the correct thread.
|
| base::ThreadChecker thread_checker_;
|
|
|
| - // Message loop for the main render thread. Utilized in OnDeviceStopped() to
|
| - // ensure that OnSourceCaptureDeviceStopped() is called on the main thread
|
| - // instead of the originating IO thread.
|
| - scoped_refptr<base::MessageLoopProxy> main_loop_;
|
| -
|
| - // Protects |source_|, |sinks_|, |running_|, |on_device_stopped_cb_|,
|
| - // |loopback_fifo_|, |params_|, |buffering_| and |agc_is_enabled_|.
|
| + // Protects |source_|, |sinks_|, |running_|, |loopback_fifo_|, |params_|,
|
| + // |buffering_| and |agc_is_enabled_|.
|
| mutable base::Lock lock_;
|
|
|
| // A list of sinks that the audio data is fed to.
|
| @@ -155,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);
|
| };
|
|
|
|
|