Chromium Code Reviews| Index: remoting/host/audio_capturer_win.cc |
| diff --git a/remoting/host/audio_capturer_win.cc b/remoting/host/audio_capturer_win.cc |
| index 4dfc174da4aedc96ecf3e875ce526d79c75763bf..449cc9873c5beed74e1b5beda7c65aca2d3290dc 100644 |
| --- a/remoting/host/audio_capturer_win.cc |
| +++ b/remoting/host/audio_capturer_win.cc |
| @@ -2,6 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "remoting/host/audio_capturer_win.h" |
| + |
| #include <windows.h> |
| #include <audioclient.h> |
| #include <avrt.h> |
| @@ -46,41 +48,6 @@ const int kMaxExpectedTimerLag = 30; |
| namespace remoting { |
| -class AudioCapturerWin : public AudioCapturer { |
| - public: |
| - AudioCapturerWin(); |
| - virtual ~AudioCapturerWin(); |
| - |
| - // AudioCapturer interface. |
| - virtual bool Start(const PacketCapturedCallback& callback) OVERRIDE; |
| - virtual void Stop() OVERRIDE; |
| - virtual bool IsRunning() OVERRIDE; |
| - |
| - private: |
| - // Receives all packets from the audio capture endpoint buffer and pushes them |
| - // to the network. |
| - void DoCapture(); |
| - |
| - static bool IsPacketOfSilence(const int16* samples, int number_of_samples); |
| - |
| - PacketCapturedCallback callback_; |
| - |
| - AudioPacket::SamplingRate sampling_rate_; |
| - |
| - scoped_ptr<base::RepeatingTimer<AudioCapturerWin> > capture_timer_; |
| - base::TimeDelta audio_device_period_; |
| - |
| - base::win::ScopedCoMem<WAVEFORMATEX> wave_format_ex_; |
| - base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_; |
| - base::win::ScopedComPtr<IAudioClient> audio_client_; |
| - base::win::ScopedComPtr<IMMDevice> mm_device_; |
| - scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; |
| - |
| - base::ThreadChecker thread_checker_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(AudioCapturerWin); |
| -}; |
| - |
| AudioCapturerWin::AudioCapturerWin() |
| : sampling_rate_(AudioPacket::SAMPLING_RATE_INVALID) { |
| thread_checker_.DetachFromThread(); |
| @@ -310,6 +277,8 @@ void AudioCapturerWin::DoCapture() { |
| } |
| } |
| +// static |
|
Sergey Ulanov
2012/08/21 20:52:15
usually that comments goes directly in front of th
kxing
2012/08/21 21:24:27
Done.
|
| + |
| // Detects whether there is audio playing in a packet of samples. |
| // Windows can give nonzero samples, even when there is no audio playing, so |
| // extremely low amplitude samples are counted as silence. |