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

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

Issue 2319493002: Add mojo interface for audio rendering. (Closed)
Patch Set: format Created 4 years, 3 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..ccaed42ca477617d5882beacfc92727028e59090 100644
--- a/media/mojo/interfaces/audio_output.mojom
+++ b/media/mojo/interfaces/audio_output.mojom
@@ -5,29 +5,44 @@
module media.mojom;
import "media/mojo/interfaces/audio_parameters.mojom";
+import "url/mojo/origin.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();
+// TODO: typemap to native OutputDeviceStatus.
+enum OutputDeviceStatus {
+ OUTPUT_DEVICE_STATUS_OK,
+ OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND,
+ OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED,
+ OUTPUT_DEVICE_STATUS_ERROR_TIMED_OUT,
+ OUTPUT_DEVICE_STATUS_ERROR_INTERNAL,
+ OUTPUT_DEVICE_STATUS_LAST = OUTPUT_DEVICE_STATUS_ERROR_INTERNAL,
};
-// 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.
+// On error, the message pipe is closed.
+// To close the stream, just close the message pipe.
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);
-};
+ Start(AudioParameters params) =>
+ (handle<shared_buffer> shared_buffer,
+ handle socket_descriptor);
+ Play();
+ Pause();
+ SetVolume(double volume);
+};
+
+interface AudioOutputService {
+ // Used to request a device.
+ // An AudioOutputRequest may be supplied, in which case it will
+ // be bound to an AudioOutput implementation or closed (in case of an error).
+ // TODO better name.
+ RequestDeviceAuthorization(
+ // TODO: in implementation, use base::IsValueInRangeForNumericType<int>
+ // before casting these back to int.
+ int64 render_frame_id,
+ int64 session_id,
+ string device_id,
+ AudioOutput&? audio_output,
+ url.mojom.Origin origin) =>
+ (// TODO make this a struct?
+ OutputDeviceStatus state,
+ AudioParameters output_params,
+ string matched_device_id);
+};
« content/browser/renderer_host/media/audio_output_impl.cc ('K') | « media/mojo/interfaces/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698