Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: remoting/host/audio_capturer_win.h

Issue 10823440: Silence detection test for the Windows audio capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comment Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/host/audio_capturer_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <audioclient.h>
6 #include <mmdeviceapi.h>
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/timer.h"
11 #include "base/win/scoped_co_mem.h"
12 #include "base/win/scoped_com_initializer.h"
13 #include "base/win/scoped_comptr.h"
14 #include "remoting/host/audio_capturer.h"
15 #include "remoting/proto/audio.pb.h"
16
17 namespace remoting {
18
19 class AudioCapturerWin : public AudioCapturer {
20 public:
21 AudioCapturerWin();
22 virtual ~AudioCapturerWin();
23
24 // AudioCapturer interface.
25 virtual bool Start(const PacketCapturedCallback& callback) OVERRIDE;
26 virtual void Stop() OVERRIDE;
27 virtual bool IsRunning() OVERRIDE;
28
29 static bool IsPacketOfSilence(const int16* samples, int number_of_samples);
30
31 private:
32 // Receives all packets from the audio capture endpoint buffer and pushes them
33 // to the network.
34 void DoCapture();
35
36 PacketCapturedCallback callback_;
37
38 AudioPacket::SamplingRate sampling_rate_;
39
40 scoped_ptr<base::RepeatingTimer<AudioCapturerWin> > capture_timer_;
41 base::TimeDelta audio_device_period_;
42
43 base::win::ScopedCoMem<WAVEFORMATEX> wave_format_ex_;
44 base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_;
45 base::win::ScopedComPtr<IAudioClient> audio_client_;
46 base::win::ScopedComPtr<IMMDevice> mm_device_;
47 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_;
48
49 base::ThreadChecker thread_checker_;
50
51 DISALLOW_COPY_AND_ASSIGN(AudioCapturerWin);
52 };
53
54 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/audio_capturer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698