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

Side by Side Diff: media/audio/audio_system.h

Issue 2675713002: Switch Speech Recognition to asynchronous callback-based AudioManager interactions. (Closed)
Patch Set: another rebase! Created 3 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2017 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 MEDIA_AUDIO_AUDIO_SYSTEM_H_
6 #define MEDIA_AUDIO_AUDIO_SYSTEM_H_
7
8 #include "base/callback.h"
9 #include "media/audio/audio_device_description.h"
10 #include "media/base/audio_parameters.h"
11 #include "media/base/media_export.h"
12
13 namespace base {
14 class SingleThreadTaskRunner;
15 }
16
17 namespace media {
18 class AudioManager;
19
20 // Work in progress: Provides asynchronous interface to AudioManager. All the
21 // AudioManager clients will be switched to it, in preparation for moving
22 // to Mojo audio service.
23 class MEDIA_EXPORT AudioSystem {
24 public:
25 // Replies are asynchronously sent to the thread the call is issued on.
26 using OnAudioParamsCallback = base::Callback<void(const AudioParameters&)>;
27
28 virtual base::SingleThreadTaskRunner* GetTaskRunner() const = 0;
29
30 // Callback will receive invalid parameters if the device is not found.
31 virtual void GetInputStreamParameters(const std::string& device_id,
tommi (sloooow) - chröme 2017/02/05 20:14:54 Since we're making a new interface, would it make
o1ka 2017/02/06 12:06:08 Right! Done.
32 OnAudioParamsCallback on_params_cb) = 0;
33
34 // Must not be used for anything but stream creation.
35 virtual AudioManager* GetAudioManager() = 0;
36 };
37
38 } // namespace media
39
40 #endif // MEDIA_AUDIO_AUDIO_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698