Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Unified Diff: media/mojo/interfaces/audio_output.mojom

Issue 2697793002: Add mojo interface+impl for audio stream control. (Closed)
Patch Set: Dale's comments and add MEDIA_MOJO_EXPORT Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..150ace22d9e2981fd0c8ae3b5288f133c5064870 100644
--- a/media/mojo/interfaces/audio_output.mojom
+++ b/media/mojo/interfaces/audio_output.mojom
@@ -5,29 +5,24 @@
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();
-};
-
-// 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.
+// An interface for creating and controlling an output stream.
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);
-};
+ // On error, the message pipe is closed.
+ // To close the stream, just close the message pipe.
+
+ // Initializes the stream using |params|. |shared_buffer| and |socket_descriptor|
+ // 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.
+ // Initialize must be called once before other methods may be called.
+ Initialize(media.mojom.AudioParameters params) =>
+ (handle<shared_buffer> shared_buffer,
+ handle socket_descriptor);
+ // Starts rendering audio.
+ Play();
+ // Stops rendering audio and sends a signal to the |socket_descriptor|
+ // indicating this.
+ Pause();
+ // 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.
+ SetVolume(double volume);
+};

Powered by Google App Engine
This is Rietveld 408576698