OLD | NEW |
---|---|
1 // Copyright 2016 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 module media.mojom; | 5 module media.mojom; |
6 | 6 |
7 import "media/mojo/interfaces/audio_parameters.mojom"; | 7 import "media/mojo/interfaces/audio_parameters.mojom"; |
8 import "media/mojo/interfaces/media_types.mojom"; | |
8 | 9 |
9 // This interface handles audio output stream operations. | 10 // An interface for controlling an audio output stream. |
10 // It allows to close a stream. | 11 // On error, the message pipe is closed. |
11 // TODO(rchtara): Add methods that allow the interaction with audio output | 12 // To close the stream, just close the message pipe. |
12 // streams: Play, Pause and SetVolume to this interface. | 13 interface AudioOutput { |
DaleCurtis
2017/03/06 17:56:12
I think I prefer some sort of trailing differentia
Max Morin
2017/03/07 11:23:16
Makes sense. Now AudioOutputStream.
o1ka
2017/03/07 13:04:53
Don't we have one AudioOutputStream already?
| |
13 // See crbug.com/606707 for more details. | 14 // Starts rendering audio. |
14 interface AudioOutputStream { | 15 Play(); |
15 Close(); | 16 // Stops rendering audio and sends a signal to the |socket_descriptor| |
DaleCurtis
2017/03/06 17:56:12
Add blank lines between comments and methods.
Max Morin
2017/03/07 11:23:16
Done.
| |
17 // indicating this. | |
18 Pause(); | |
19 // Sets volume. Volume must be in the range [0, 1]. | |
20 SetVolume(double volume); | |
16 }; | 21 }; |
17 | 22 |
18 // This interface manages audio output streams. | 23 interface AudioOutputProvider { |
19 // It allows to create an AudioOutputStream. | 24 // Creates a new AudioOutput using |params|. |shared_buffer| and |
20 // TODO(rchtara): Add a method to request device authorization to this | 25 // |socket_descriptor| are used to write data to the stream as defined |
21 // interface. | 26 // in AudioDeviceThread. Can only be used for one output stream. |
22 // See crbug.com/606707 for more details. | 27 Acquire(AudioOutput&? audio_output, media.mojom.AudioParameters params) => |
DaleCurtis
2017/03/06 17:56:12
Hmm, why this signature versus:
Acquire(params) =
Max Morin
2017/03/07 11:23:16
I prefer this one since it allows things like:
Au
| |
23 interface AudioOutput { | 28 (handle<shared_buffer> shared_buffer, |
24 // TODO(rchtara): Remove |stream_id| from AudioOutput::CreateStream when all | 29 handle socket_descriptor); |
25 // the stream operations are mojofied. | 30 }; |
26 CreateStream( | |
27 int32 stream_id, | |
28 AudioParameters params) => | |
29 (int32 stream_id, | |
30 AudioOutputStream? stream, | |
31 handle<shared_buffer>? shared_buffer, | |
32 handle? socket_descriptor); | |
33 }; | |
OLD | NEW |