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..ae217f91d0610f991240b542fee837158b564115 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> |
|
Sergey Ulanov
2012/08/21 21:34:39
Don't need to include files that are already inclu
kxing
2012/08/21 21:55:53
Done.
|
| #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(); |
| @@ -313,6 +280,7 @@ void AudioCapturerWin::DoCapture() { |
| // 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. |
| +// static |
| bool AudioCapturerWin::IsPacketOfSilence( |
| const int16* samples, int number_of_samples) { |
| for (int i = 0; i < number_of_samples; i++) { |