Index: remoting/host/audio_capturer_win.h |
diff --git a/remoting/host/audio_capturer_win.h b/remoting/host/audio_capturer_win.h |
index d53920a43d9284f6b4ebd8f7d8f5f626b568a87e..ec91d05d812f75ae0802b653145a0d97c937c161 100644 |
--- a/remoting/host/audio_capturer_win.h |
+++ b/remoting/host/audio_capturer_win.h |
@@ -31,6 +31,16 @@ class AudioCapturerWin : public AudioCapturer { |
bool Start(const PacketCapturedCallback& callback) override; |
private: |
+ // The implementation of IMMNotificationClient, to set |
+ // default_audio_device_changed_ in OnDefaultDeviceChanged function. |
+ class MMNotificationClient; |
+ friend class MMNotificationClient; |
+ |
+ // Initializes default audio device related components. These components must |
+ // be recreated once the default audio device changed. Returns false if |
+ // initialization failed. |
+ bool Initialize(); |
+ |
// Receives all packets from the audio capture endpoint buffer and pushes them |
// to the network. |
void DoCapture(); |
@@ -55,11 +65,17 @@ class AudioCapturerWin : public AudioCapturer { |
AudioSilenceDetector silence_detector_; |
base::win::ScopedCoMem<WAVEFORMATEX> wave_format_ex_; |
+ base::win::ScopedComPtr<IMMDeviceEnumerator> mm_device_enumerator_; |
base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_; |
base::win::ScopedComPtr<IAudioClient> audio_client_; |
base::win::ScopedComPtr<IMMDevice> mm_device_; |
base::win::ScopedComPtr<IAudioEndpointVolume> audio_volume_; |
+ // Whether the default audio device has been changed recently. If this value |
+ // is true, we need to recreate all audio components; |
+ bool default_audio_device_changed_; |
Sergey Ulanov
2016/07/18 23:09:24
= false;
Hzj_jie
2016/07/19 02:36:40
Done.
|
+ const std::unique_ptr<MMNotificationClient> notificator_; |
+ |
HRESULT last_capture_error_; |
base::ThreadChecker thread_checker_; |