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"; | |
| 9 import "url/mojo/origin.mojom"; | |
| 8 | 10 |
| 9 // This interface handles audio output stream operations. | 11 // On error, the message pipe is closed. |
| 10 // It allows to close a stream. | 12 // To close the stream, just close the message pipe. |
| 11 // TODO(rchtara): Add methods that allow the interaction with audio output | 13 interface AudioOutput { |
| 12 // streams: Play, Pause and SetVolume to this interface. | 14 Start(AudioParameters params) => |
| 13 // See crbug.com/606707 for more details. | 15 (handle<shared_buffer> shared_buffer, |
| 14 interface AudioOutputStream { | 16 handle socket_descriptor); |
| 15 Close(); | 17 Play(); |
| 18 Pause(); | |
| 19 SetVolume(double volume); | |
| 16 }; | 20 }; |
|
o1ka
2017/01/25 15:15:21
We want these two interfaces it live in separate m
| |
| 17 | 21 |
| 18 // This interface manages audio output streams. | 22 interface AudioOutputService { |
|
o1ka
2017/01/25 15:15:21
RendererAudioOutputService? Or some other more des
| |
| 19 // It allows to create an AudioOutputStream. | 23 // Used to request a device. |
| 20 // TODO(rchtara): Add a method to request device authorization to this | 24 // An AudioOutputRequest may be supplied, in which case it will |
| 21 // interface. | 25 // be bound to an AudioOutput implementation or closed (in case of an error). |
| 22 // See crbug.com/606707 for more details. | 26 // TODO better name. |
| 23 interface AudioOutput { | 27 RequestDeviceAuthorization( |
| 24 // TODO(rchtara): Remove |stream_id| from AudioOutput::CreateStream when all | 28 // TODO(maxmorin): When input stream control is also switched to mojo, |
| 25 // the stream operations are mojofied. | 29 // change session_id to be an int32_t in the code. |
| 26 CreateStream( | 30 int64 session_id, |
| 27 int32 stream_id, | 31 string device_id, |
| 28 AudioParameters params) => | 32 AudioOutput&? audio_output_request, |
| 29 (int32 stream_id, | 33 url.mojom.Origin origin) => |
| 30 AudioOutputStream? stream, | 34 (// TODO make this a struct? |
| 31 handle<shared_buffer>? shared_buffer, | 35 OutputDeviceStatus state, |
| 32 handle? socket_descriptor); | 36 AudioParameters output_params, |
| 33 }; | 37 string matched_device_id); |
| 38 }; | |
| OLD | NEW |