OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 module mojo.media; | |
6 | |
7 import "mojo/services/media/common/interfaces/media_common.mojom"; | |
8 import "mojo/services/media/common/interfaces/media_pipe.mojom"; | |
9 import "mojo/services/media/common/interfaces/media_types.mojom"; | |
10 import "mojo/services/media/common/interfaces/rate_control.mojom"; | |
11 | |
12 struct AudioTrackDescriptor { | |
13 // The track supports the union of all these media type sets. | |
14 array<MediaTypeSet> supported_media_types; | |
15 | |
16 // Whether the track supports a push transport. | |
17 bool supports_push_transport; | |
18 | |
19 // Whether the track supports a pull transport. | |
20 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.
| |
21 }; | |
22 | |
23 struct AudioTrackConfiguration { | |
24 // The media type to use. | |
25 MediaType media_type; | |
26 | |
27 // Desired maximum buffer size, in frames of audio. | |
28 uint64 max_frames; | |
29 | |
30 // Ratio of audio frames to media time ticks. | |
31 // | |
32 // Presentation time stamps on audio packets are expressed in units of media | |
33 // time ticks. Many users will choose to use units of audio frames to express | |
34 // their media time, and can simply leave this ratio at the default of 1:1. | |
35 // For some, however, it may be more convenient to use different units for | |
36 // media time. For example, if the audio frame rate was 48KHz, and the time | |
37 // stamps are expressed in 90KHz units (the units used by MPEG-2 Program | |
38 // Stream timestamps), the ratio should be set to 48000:90000 (aka, 8:15). | |
39 // IOW - audio_frame_ratio would be set to 8 and media_time_ratio would be set | |
40 // to 15. | |
41 // | |
42 // Neither of these values may be 0. A configuration error will occur if they | |
43 // are. | |
44 uint32 audio_frame_ratio = 1; | |
45 uint32 media_time_ratio = 1; | |
46 }; | |
47 | |
48 interface AudioTrack { | |
49 // Get the descriptor. | |
50 Describe() => (AudioTrackDescriptor descriptor); | |
51 | |
52 // Set the configuration, receive a pipe to send data to in return. | |
53 // Possible results include... | |
54 // | |
55 // kOK: | |
56 // Configuration successful, the bound pipe interface is ready to be used. | |
57 // | |
58 // 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
| |
59 // One or more of the configuration arguments are illegal. For example, a | |
60 // value of 0 for either numerator or denominator of the audio frame to | |
61 // media time ratio. | |
62 // | |
63 // 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.
| |
64 // The requested configuration is not supported by this track. | |
65 // | |
66 // kInsufficientResources: | |
67 // Resource limitations prevent configuring the audio track is the desired | |
68 // way. Perhaps there is not enough RAM to support the 2.7 days of audio | |
69 // buffer you requested, or perhaps there is not enough CPU power given the | |
70 // existing active tracks in the system to support rendering 128 channels | |
71 // at 1.5 MHz frame rate. | |
72 // | |
73 // 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
| |
74 // The track is already configured and has pending data in its pipe. Data | |
75 // needs to be flushed and the media clock must be stopped before the track | |
76 // may be re-configured. | |
77 Configure(AudioTrackConfiguration configuration, | |
78 MediaPipe& pipe) => (MediaResult result); | |
79 | |
80 // Request the rate control interface for this AudioTrack | |
81 // Possbile results include... | |
82 // | |
83 // kOK: | |
84 // Everything went well. | |
85 // | |
86 // kBadState: | |
87 // Rate control interface is already bound to a different client. | |
88 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
| |
89 }; | |
OLD | NEW |