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_H_ | 5 #ifndef REMOTING_HOST_AUDIO_CAPTURER_H_ |
| 6 #define REMOTING_HOST_AUDIO_CAPTURER_H_ | 6 #define REMOTING_HOST_AUDIO_CAPTURER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "remoting/proto/audio.pb.h" | |
| 11 | 10 |
| 12 namespace remoting { | 11 namespace remoting { |
| 13 | 12 |
| 13 class AudioPacket; | |
| 14 | |
| 14 class AudioCapturer { | 15 class AudioCapturer { |
| 15 public: | 16 public: |
| 16 typedef base::Callback<void(scoped_ptr<AudioPacket> packet)> | 17 typedef base::Callback<void(scoped_ptr<AudioPacket> packet)> |
| 17 PacketCapturedCallback; | 18 PacketCapturedCallback; |
| 18 | 19 |
| 19 virtual ~AudioCapturer() {} | 20 virtual ~AudioCapturer() {} |
| 20 | 21 |
| 21 static scoped_ptr<AudioCapturer> Create(); | 22 static scoped_ptr<AudioCapturer> Create(); |
| 22 | 23 |
| 23 // Capturers should sample at a 44.1 kHz sampling rate, in uncompressed PCM | 24 // Capturers should sample at a 44.1 kHz sampling rate, in uncompressed PCM |
|
Wez
2012/07/25 09:23:48
nit: This comment needs updating if AudioCapturer
kxing
2012/07/26 22:47:17
Done.
| |
| 24 // stereo format. Capturers may choose the number of frames per packet. | 25 // stereo format. Capturers may choose the number of frames per packet. |
| 25 // Returns true on success. | 26 // Returns true on success. |
| 26 virtual bool Start(const PacketCapturedCallback& callback) = 0; | 27 virtual bool Start(const PacketCapturedCallback& callback) = 0; |
| 27 // Stops the audio capturer, and frees the OS-specific audio capture | 28 // Stops the audio capturer, and frees the OS-specific audio capture |
| 28 // resources. | 29 // resources. |
| 29 virtual void Stop() = 0; | 30 virtual void Stop() = 0; |
| 30 // Returns true if the audio capturer is running. | 31 // Returns true if the audio capturer is running. |
| 31 virtual bool IsRunning() = 0; | 32 virtual bool IsRunning() = 0; |
| 33 | |
| 34 static bool IsValidSampleRate(int sample_rate); | |
|
Wez
2012/07/25 09:23:48
Does it make sense for this to be a static? Won't
kxing
2012/07/26 22:47:17
It represents the rates the current client impleme
| |
| 32 }; | 35 }; |
| 33 | 36 |
| 34 } // namespace remoting | 37 } // namespace remoting |
| 35 | 38 |
| 36 #endif // REMOTING_HOST_AUDIO_CAPTURER_H_ | 39 #endif // REMOTING_HOST_AUDIO_CAPTURER_H_ |
| OLD | NEW |