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 "url/mojo/origin.mojom"; | |
8 | 9 |
9 // This interface handles audio output stream operations. | 10 // TODO: typemap to native OutputDeviceStatus. |
10 // It allows to close a stream. | 11 enum OutputDeviceStatus { |
11 // TODO(rchtara): Add methods that allow the interaction with audio output | 12 OUTPUT_DEVICE_STATUS_OK, |
12 // streams: Play, Pause and SetVolume to this interface. | 13 OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, |
13 // See crbug.com/606707 for more details. | 14 OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED, |
14 interface AudioOutputStream { | 15 OUTPUT_DEVICE_STATUS_ERROR_TIMED_OUT, |
15 Close(); | 16 OUTPUT_DEVICE_STATUS_ERROR_INTERNAL, |
17 OUTPUT_DEVICE_STATUS_LAST = OUTPUT_DEVICE_STATUS_ERROR_INTERNAL, | |
16 }; | 18 }; |
17 | 19 |
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 { | 20 interface AudioOutput { |
24 // TODO(rchtara): Remove |stream_id| from AudioOutput::CreateStream when all | 21 Start(AudioParameters params) => |
25 // the stream operations are mojofied. | 22 (bool ok, |
26 CreateStream( | 23 handle<shared_buffer> shared_buffer, |
27 int32 stream_id, | 24 handle socket_descriptor); |
28 AudioParameters params) => | 25 Play() => (bool ok); |
29 (int32 stream_id, | 26 Pause() => (bool ok); |
30 AudioOutputStream? stream, | 27 SetVolume(double volume) => (bool ok); |
31 handle<shared_buffer>? shared_buffer, | 28 }; |
32 handle? socket_descriptor); | 29 |
33 }; | 30 interface AudioOutputService { |
31 // Used to request device authorization from the AudioOutputService. | |
32 // An AudioOutput message pipe may be supplied, in which case it will | |
33 // be bound to an AudioOutput implementation or closed (in case of an error). | |
34 RequestDeviceAuthorization( | |
Henrik Grunell
2016/09/06 11:33:02
We need to rethink the naming here and/or how we d
| |
35 int64 render_frame_id, | |
36 int64 session_id, | |
37 string device_id, | |
38 AudioOutput&? audio_output | |
39 url.mojom.Origin origin) => | |
40 (// TODO make this a struct? | |
41 OutputDeviceStatus state, | |
42 AudioParameters output_params, | |
43 string matched_device_id); | |
44 }; | |
OLD | NEW |