Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_AUDIO_CAPTURER_WIN_H_ | 5 #ifndef REMOTING_HOST_AUDIO_CAPTURER_WIN_H_ |
| 6 #define REMOTING_HOST_AUDIO_CAPTURER_WIN_H_ | 6 #define REMOTING_HOST_AUDIO_CAPTURER_WIN_H_ |
| 7 | 7 |
| 8 #include <audioclient.h> | 8 #include <audioclient.h> |
| 9 #include <mmdeviceapi.h> | 9 #include <mmdeviceapi.h> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 ~AudioCapturerWin() override; | 26 ~AudioCapturerWin() override; |
| 27 | 27 |
| 28 // AudioCapturer interface. | 28 // AudioCapturer interface. |
| 29 bool Start(const PacketCapturedCallback& callback) override; | 29 bool Start(const PacketCapturedCallback& callback) override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 // Receives all packets from the audio capture endpoint buffer and pushes them | 32 // Receives all packets from the audio capture endpoint buffer and pushes them |
| 33 // to the network. | 33 // to the network. |
| 34 void DoCapture(); | 34 void DoCapture(); |
| 35 | 35 |
| 36 // Returns whether audio has been muted. If audio is not muted, this function | |
| 37 // sets level as the volume value with range (0.0, 1.0]. | |
| 38 bool IsMuted(float* level); | |
|
joedow
2016/03/02 15:25:52
It seems like this function is doing too much for
| |
| 39 | |
| 36 PacketCapturedCallback callback_; | 40 PacketCapturedCallback callback_; |
| 37 | 41 |
| 38 AudioPacket::SamplingRate sampling_rate_; | 42 AudioPacket::SamplingRate sampling_rate_; |
| 39 | 43 |
| 40 scoped_ptr<base::RepeatingTimer> capture_timer_; | 44 scoped_ptr<base::RepeatingTimer> capture_timer_; |
| 41 base::TimeDelta audio_device_period_; | 45 base::TimeDelta audio_device_period_; |
| 42 | 46 |
| 43 AudioSilenceDetector silence_detector_; | 47 AudioSilenceDetector silence_detector_; |
| 44 | 48 |
| 45 base::win::ScopedCoMem<WAVEFORMATEX> wave_format_ex_; | 49 base::win::ScopedCoMem<WAVEFORMATEX> wave_format_ex_; |
| 46 base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_; | 50 base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_; |
| 47 base::win::ScopedComPtr<IAudioClient> audio_client_; | 51 base::win::ScopedComPtr<IAudioClient> audio_client_; |
| 48 base::win::ScopedComPtr<IMMDevice> mm_device_; | 52 base::win::ScopedComPtr<IMMDevice> mm_device_; |
| 53 base::win::ScopedComPtr<ISimpleAudioVolume> audio_volume_; | |
| 49 | 54 |
| 50 HRESULT last_capture_error_; | 55 HRESULT last_capture_error_; |
| 51 | 56 |
| 52 base::ThreadChecker thread_checker_; | 57 base::ThreadChecker thread_checker_; |
| 53 | 58 |
| 54 DISALLOW_COPY_AND_ASSIGN(AudioCapturerWin); | 59 DISALLOW_COPY_AND_ASSIGN(AudioCapturerWin); |
| 55 }; | 60 }; |
| 56 | 61 |
| 57 } // namespace remoting | 62 } // namespace remoting |
| 58 | 63 |
| 59 #endif // REMOTING_HOST_AUDIO_CAPTURER_WIN_H_ | 64 #endif // REMOTING_HOST_AUDIO_CAPTURER_WIN_H_ |
| OLD | NEW |