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

Unified Diff: mojo/services/media/audio/interfaces/audio_track.mojom

Issue 1424933002: Add an initial revision of an audio server. (Closed) Base URL: https://github.com/domokit/mojo.git@change4
Patch Set: refactor MixerKernel into a class to prepare for the addition of a linear interpolation sampler Created 5 years, 1 month 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: mojo/services/media/audio/interfaces/audio_track.mojom
diff --git a/mojo/services/media/audio/interfaces/audio_track.mojom b/mojo/services/media/audio/interfaces/audio_track.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..29cb218d3f37133cb0478e0a116518f04cdef526
--- /dev/null
+++ b/mojo/services/media/audio/interfaces/audio_track.mojom
@@ -0,0 +1,89 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module mojo.media;
+
+import "mojo/services/media/common/interfaces/media_common.mojom";
+import "mojo/services/media/common/interfaces/media_pipe.mojom";
+import "mojo/services/media/common/interfaces/media_types.mojom";
+import "mojo/services/media/common/interfaces/rate_control.mojom";
+
+struct AudioTrackDescriptor {
+ // The track supports the union of all these media type sets.
+ array<MediaTypeSet> supported_media_types;
+
+ // Whether the track supports a push transport.
+ bool supports_push_transport;
+
+ // Whether the track supports a pull transport.
+ bool supports_pull_transport;
jeffbrown 2015/11/04 23:43:32 I thought we were only going to support push?
johngro 2015/11/06 02:20:23 copied directly from Dale's design doc. Let's bri
dalesat 2015/11/06 06:14:11 Push-only came up in the doc review...no longer th
johngro 2015/11/06 20:24:25 Acknowledged. What do you think I should do here?
dalesat 2015/11/06 21:03:56 If you're not using them, you might as well delete
johngro 2015/11/09 20:25:16 Done.
+};
+
+struct AudioTrackConfiguration {
+ // The media type to use.
+ MediaType media_type;
+
+ // Desired maximum buffer size, in frames of audio.
+ uint64 max_frames;
+
+ // Ratio of audio frames to media time ticks.
+ //
+ // Presentation time stamps on audio packets are expressed in units of media
+ // time ticks. Many users will choose to use units of audio frames to express
+ // their media time, and can simply leave this ratio at the default of 1:1.
+ // For some, however, it may be more convenient to use different units for
+ // media time. For example, if the audio frame rate was 48KHz, and the time
+ // stamps are expressed in 90KHz units (the units used by MPEG-2 Program
+ // Stream timestamps), the ratio should be set to 48000:90000 (aka, 8:15).
+ // IOW - audio_frame_ratio would be set to 8 and media_time_ratio would be set
+ // to 15.
+ //
+ // Neither of these values may be 0. A configuration error will occur if they
+ // are.
+ uint32 audio_frame_ratio = 1;
+ uint32 media_time_ratio = 1;
+};
+
+interface AudioTrack {
+ // Get the descriptor.
+ Describe() => (AudioTrackDescriptor descriptor);
+
+ // Set the configuration, receive a pipe to send data to in return.
+ // Possible results include...
+ //
+ // kOK:
+ // Configuration successful, the bound pipe interface is ready to be used.
+ //
+ // kInvalidArgs:
jeffbrown 2015/11/04 23:43:32 close the connection
johngro 2015/11/06 02:20:24 Acknowledged. FWIW - I'm putting these all in my
+ // One or more of the configuration arguments are illegal. For example, a
+ // value of 0 for either numerator or denominator of the audio frame to
+ // media time ratio.
+ //
+ // kUnsupportedConfig:
jeffbrown 2015/11/04 23:43:32 if the client was able to determine this ahead of
johngro 2015/11/06 02:20:24 Acknowledged.
+ // The requested configuration is not supported by this track.
+ //
+ // kInsufficientResources:
+ // Resource limitations prevent configuring the audio track is the desired
+ // way. Perhaps there is not enough RAM to support the 2.7 days of audio
+ // buffer you requested, or perhaps there is not enough CPU power given the
+ // existing active tracks in the system to support rendering 128 channels
+ // at 1.5 MHz frame rate.
+ //
+ // kBadState:
jeffbrown 2015/11/04 23:43:32 This suggests coupling the creation of an audio tr
johngro 2015/11/06 02:20:24 Acknowledged. Agreed, I do not think we currently
+ // The track is already configured and has pending data in its pipe. Data
+ // needs to be flushed and the media clock must be stopped before the track
+ // may be re-configured.
+ Configure(AudioTrackConfiguration configuration,
+ MediaPipe& pipe) => (MediaResult result);
+
+ // Request the rate control interface for this AudioTrack
+ // Possbile results include...
+ //
+ // kOK:
+ // Everything went well.
+ //
+ // kBadState:
+ // Rate control interface is already bound to a different client.
+ GetRateControl(RateControl& rate_control) => (MediaResult result);
jeffbrown 2015/11/04 23:43:32 I can't think of a meaningful error to report here
johngro 2015/11/06 02:20:24 It is possible for anyone with access to the Audio
+};

Powered by Google App Engine
This is Rietveld 408576698