OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 #ifndef COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_MANAGER_H_ | |
6 #define COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_MANAGER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "components/copresence/public/copresence_constants.h" | |
12 | |
13 namespace media { | |
14 class AudioBusRefCounted; | |
15 } | |
16 | |
17 namespace copresence { | |
18 | |
19 class AudioManager { | |
20 public: | |
21 typedef base::Callback<void(const std::string&, | |
22 AudioType, | |
23 const scoped_refptr<media::AudioBusRefCounted>&)> | |
24 SamplesCallback; | |
Daniel Erat
2014/10/22 16:34:35
it seems confusing to have one callback named "Dec
rkc
2014/10/22 18:21:47
Done.
| |
25 typedef base::Callback<void(const std::string&, | |
26 AudioType, | |
27 const SamplesCallback&)> EncodeTokenCallback; | |
28 typedef base::Callback<void(AudioType, const std::string&)> | |
29 DecodeSamplesCallback; | |
30 | |
31 virtual ~AudioManager() {} | |
32 | |
33 // Initializes the object. Do not use this object before calling this method. | |
34 virtual void Initialize(const DecodeSamplesCallback& decode_cb, | |
35 const EncodeTokenCallback& encode_cb) = 0; | |
36 | |
37 virtual void StartPlaying(AudioType type) = 0; | |
38 virtual void StopPlaying(AudioType type) = 0; | |
39 | |
40 virtual void StartRecording(AudioType type) = 0; | |
41 virtual void StopRecording(AudioType type) = 0; | |
42 | |
43 virtual void SetToken(AudioType type, | |
44 const std::string& url_unsafe_token) = 0; | |
45 | |
46 virtual const std::string& GetToken(AudioType type) = 0; | |
Daniel Erat
2014/10/22 16:34:35
if the returned value is short, please just return
rkc
2014/10/22 18:21:47
Any particular reason for not returning a const re
Daniel Erat
2014/10/22 18:32:40
in general, i find that it's better not to impose
rkc
2014/10/22 19:28:46
So this code will be called 'fairly' often; consid
Daniel Erat
2014/10/22 21:50:15
my larger point was that specifying a reference re
| |
47 | |
48 virtual bool IsRecording(AudioType type) = 0; | |
49 virtual bool IsPlaying(AudioType type) = 0; | |
50 }; | |
51 | |
52 } // namespace copresence | |
53 | |
54 #endif // COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_MANAGER_H_ | |
OLD | NEW |