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 import "media/mojo/interfaces/media_types.mojom"; |
9 | 9 |
10 // An interface for controlling an audio output stream. | 10 // An interface for controlling an audio output stream. |
11 // On error, the message pipe is closed. | 11 // On error, the message pipe is closed. |
12 // To close the stream, just close the message pipe. | 12 // To close the stream, just close the message pipe. |
13 interface AudioOutputStream { | 13 interface AudioOutputStream { |
14 // Starts rendering audio. | 14 // Starts rendering audio. |
15 Play(); | 15 Play(); |
16 | 16 |
17 // Stops rendering audio and sends a signal to the |socket_descriptor| | 17 // Stops rendering audio and sends a signal to the |socket_descriptor| |
18 // indicating this. | 18 // indicating this. |
19 Pause(); | 19 Pause(); |
20 | 20 |
21 // Sets volume. Volume must be in the range [0, 1]. | 21 // Sets volume. Volume must be in the range [0, 1]. |
22 SetVolume(double volume); | 22 SetVolume(double volume); |
23 }; | 23 }; |
24 | 24 |
25 interface AudioOutputStreamProvider { | 25 interface AudioOutputStreamProvider { |
26 // Creates a new AudioOutputStream using |params|. |shared_buffer| and | 26 // Creates a new AudioOutputStream using |params|. |shared_buffer| and |
27 // |socket_descriptor| are used to write data to the stream as defined | 27 // |socket_descriptor| are used to write data to the stream as defined |
28 // in AudioDeviceThread. Can only be called once. | 28 // in AudioDeviceThread. This means: |
| 29 // * |shared_buffer| will be a writable handle to memory of the size needed |
| 30 // by AudioDeviceThread for the specified params. |
| 31 // * |socket_descriptor| is a descriptor from which a |
| 32 // base::CancelableSyncSocket can be constructed. |
| 33 // Can only be called once. |
29 Acquire(AudioOutputStream& output_stream, AudioParameters params) | 34 Acquire(AudioOutputStream& output_stream, AudioParameters params) |
30 => (handle<shared_buffer> shared_buffer, handle socket_descriptor); | 35 => (handle<shared_buffer> shared_buffer, handle socket_descriptor); |
31 }; | 36 }; |
OLD | NEW |