Index: media/mojo/interfaces/audio_output.mojom |
diff --git a/media/mojo/interfaces/audio_output.mojom b/media/mojo/interfaces/audio_output.mojom |
index 895a93e4967727e4d2846679b50433a2de46ff94..28665707a0a9fc8ba37d0ca717cb26ebacb4d8fd 100644 |
--- a/media/mojo/interfaces/audio_output.mojom |
+++ b/media/mojo/interfaces/audio_output.mojom |
@@ -5,29 +5,26 @@ |
module media.mojom; |
import "media/mojo/interfaces/audio_parameters.mojom"; |
+import "media/mojo/interfaces/media_types.mojom"; |
-// This interface handles audio output stream operations. |
-// It allows to close a stream. |
-// TODO(rchtara): Add methods that allow the interaction with audio output |
-// streams: Play, Pause and SetVolume to this interface. |
-// See crbug.com/606707 for more details. |
-interface AudioOutputStream { |
- Close(); |
+// An interface for controlling an audio output stream. |
+// On error, the message pipe is closed. |
+// To close the stream, just close the message pipe. |
+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?
|
+ // Starts rendering audio. |
+ Play(); |
+ // 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.
|
+ // indicating this. |
+ Pause(); |
+ // Sets volume. Volume must be in the range [0, 1]. |
+ SetVolume(double volume); |
}; |
-// This interface manages audio output streams. |
-// It allows to create an AudioOutputStream. |
-// TODO(rchtara): Add a method to request device authorization to this |
-// interface. |
-// See crbug.com/606707 for more details. |
-interface AudioOutput { |
- // TODO(rchtara): Remove |stream_id| from AudioOutput::CreateStream when all |
- // the stream operations are mojofied. |
- CreateStream( |
- int32 stream_id, |
- AudioParameters params) => |
- (int32 stream_id, |
- AudioOutputStream? stream, |
- handle<shared_buffer>? shared_buffer, |
- handle? socket_descriptor); |
-}; |
+interface AudioOutputProvider { |
+ // Creates a new AudioOutput using |params|. |shared_buffer| and |
+ // |socket_descriptor| are used to write data to the stream as defined |
+ // in AudioDeviceThread. Can only be used for one output stream. |
+ 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
|
+ (handle<shared_buffer> shared_buffer, |
+ handle socket_descriptor); |
+}; |