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 |
| 11 #include <memory> |
| 12 |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
14 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
15 #include "base/win/scoped_co_mem.h" | 16 #include "base/win/scoped_co_mem.h" |
16 #include "base/win/scoped_comptr.h" | 17 #include "base/win/scoped_comptr.h" |
17 #include "remoting/host/audio_capturer.h" | 18 #include "remoting/host/audio_capturer.h" |
18 #include "remoting/host/audio_silence_detector.h" | 19 #include "remoting/host/audio_silence_detector.h" |
19 #include "remoting/proto/audio.pb.h" | 20 #include "remoting/proto/audio.pb.h" |
20 | 21 |
21 namespace remoting { | 22 namespace remoting { |
22 | 23 |
(...skipping 17 matching lines...) Expand all Loading... |
40 float GetAudioLevel(); | 41 float GetAudioLevel(); |
41 | 42 |
42 // Processes a series of samples, and executes callback if the packet is | 43 // Processes a series of samples, and executes callback if the packet is |
43 // qualified to be sent to client. | 44 // qualified to be sent to client. |
44 void ProcessSamples(uint8_t* data, size_t frames, int32_t flags); | 45 void ProcessSamples(uint8_t* data, size_t frames, int32_t flags); |
45 | 46 |
46 PacketCapturedCallback callback_; | 47 PacketCapturedCallback callback_; |
47 | 48 |
48 AudioPacket::SamplingRate sampling_rate_; | 49 AudioPacket::SamplingRate sampling_rate_; |
49 | 50 |
50 scoped_ptr<base::RepeatingTimer> capture_timer_; | 51 std::unique_ptr<base::RepeatingTimer> capture_timer_; |
51 base::TimeDelta audio_device_period_; | 52 base::TimeDelta audio_device_period_; |
52 | 53 |
53 AudioSilenceDetector silence_detector_; | 54 AudioSilenceDetector silence_detector_; |
54 | 55 |
55 base::win::ScopedCoMem<WAVEFORMATEX> wave_format_ex_; | 56 base::win::ScopedCoMem<WAVEFORMATEX> wave_format_ex_; |
56 base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_; | 57 base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_; |
57 base::win::ScopedComPtr<IAudioClient> audio_client_; | 58 base::win::ScopedComPtr<IAudioClient> audio_client_; |
58 base::win::ScopedComPtr<IMMDevice> mm_device_; | 59 base::win::ScopedComPtr<IMMDevice> mm_device_; |
59 base::win::ScopedComPtr<ISimpleAudioVolume> audio_volume_; | 60 base::win::ScopedComPtr<ISimpleAudioVolume> audio_volume_; |
60 | 61 |
61 HRESULT last_capture_error_; | 62 HRESULT last_capture_error_; |
62 | 63 |
63 base::ThreadChecker thread_checker_; | 64 base::ThreadChecker thread_checker_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(AudioCapturerWin); | 66 DISALLOW_COPY_AND_ASSIGN(AudioCapturerWin); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace remoting | 69 } // namespace remoting |
69 | 70 |
70 #endif // REMOTING_HOST_AUDIO_CAPTURER_WIN_H_ | 71 #endif // REMOTING_HOST_AUDIO_CAPTURER_WIN_H_ |
OLD | NEW |