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

Side by Side Diff: remoting/protocol/audio_source.h

Issue 2254673002: Remove dependency on AudioStub in ConnectionToClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win Created 4 years, 3 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
« no previous file with comments | « remoting/protocol/audio_pump_unittest.cc ('k') | remoting/protocol/audio_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PROTOCOL_AUDIO_SOURCE_H_
6 #define REMOTING_HOST_AUDIO_CAPTURER_H_ 6 #define REMOTING_PROTOCOL_AUDIO_SOURCE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 11
12 namespace remoting { 12 namespace remoting {
13 13
14 class AudioPacket; 14 class AudioPacket;
15 15
16 class AudioCapturer { 16 namespace protocol {
17
18 class AudioSource {
17 public: 19 public:
18 typedef base::Callback<void(std::unique_ptr<AudioPacket> packet)> 20 typedef base::Callback<void(std::unique_ptr<AudioPacket> packet)>
19 PacketCapturedCallback; 21 PacketCapturedCallback;
20 22
21 virtual ~AudioCapturer() {} 23 virtual ~AudioSource() {}
22
23 // Returns true if audio capturing is supported on this platform. If this
24 // returns true, then Create() must not return nullptr.
25 static bool IsSupported();
26 static std::unique_ptr<AudioCapturer> Create();
27 24
28 // Capturers should sample at a 44.1 or 48 kHz sampling rate, in uncompressed 25 // Capturers should sample at a 44.1 or 48 kHz sampling rate, in uncompressed
29 // PCM stereo format. Capturers may choose the number of frames per packet. 26 // PCM stereo format. Capturers may choose the number of frames per packet.
30 // Returns true on success. 27 // Returns true on success.
31 virtual bool Start(const PacketCapturedCallback& callback) = 0; 28 virtual bool Start(const PacketCapturedCallback& callback) = 0;
32
33 static bool IsValidSampleRate(int sample_rate);
34 }; 29 };
35 30
31 } // namespace protocol
36 } // namespace remoting 32 } // namespace remoting
37 33
38 #endif // REMOTING_HOST_AUDIO_CAPTURER_H_ 34 #endif // REMOTING_PROTOCOL_AUDIO_SOURCE_H_
OLDNEW
« no previous file with comments | « remoting/protocol/audio_pump_unittest.cc ('k') | remoting/protocol/audio_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698