Chromium Code Reviews| 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 creating and controlling an output stream. |
| 10 // It allows to close a stream. | 11 interface AudioOutput { |
| 11 // TODO(rchtara): Add methods that allow the interaction with audio output | 12 // On error, the message pipe is closed. |
| 12 // streams: Play, Pause and SetVolume to this interface. | 13 // To close the stream, just close the message pipe. |
| 13 // See crbug.com/606707 for more details. | 14 |
| 14 interface AudioOutputStream { | 15 // Initializes the stream using |params|. |shared_buffer| and |socket_descript or| |
| 15 Close(); | 16 // is used to write data to the stream as defined in AudioDeviceThread. |
|
o1ka
2017/02/22 13:26:30
nit: are used
Max Morin
2017/03/02 23:11:32
Done.
| |
| 17 // Initialize must be called once before other methods may be called. | |
| 18 Initialize(media.mojom.AudioParameters params) => | |
| 19 (handle<shared_buffer> shared_buffer, | |
| 20 handle socket_descriptor); | |
| 21 // Starts rendering audio. | |
| 22 Play(); | |
| 23 // Stops rendering audio and sends a signal to the |socket_descriptor| | |
| 24 // indicating this. | |
| 25 Pause(); | |
| 26 // Sets volume. Volume is in the range [0, 1]. | |
|
o1ka
2017/02/22 13:26:30
Describe what happens if volume if out of range?
Max Morin
2017/03/02 23:11:32
It's not allowed.
| |
| 27 SetVolume(double volume); | |
| 16 }; | 28 }; |
| 17 | |
| 18 // This interface manages audio output streams. | |
| 19 // It allows to create an AudioOutputStream. | |
| 20 // TODO(rchtara): Add a method to request device authorization to this | |
| 21 // interface. | |
| 22 // See crbug.com/606707 for more details. | |
| 23 interface AudioOutput { | |
| 24 // TODO(rchtara): Remove |stream_id| from AudioOutput::CreateStream when all | |
| 25 // the stream operations are mojofied. | |
| 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 |