OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
6 module mojo.media; | 6 module mojo.media; |
7 | 7 |
8 import "mojo/services/media/common/interfaces/media_clock.mojom"; | 8 import "mojo/services/media/common/interfaces/media_clock.mojom"; |
9 import "mojo/services/media/common/interfaces/media_common.mojom"; | 9 import "mojo/services/media/common/interfaces/media_common.mojom"; |
10 import "mojo/services/media/common/interfaces/media_state.mojom"; | 10 import "mojo/services/media/common/interfaces/media_state.mojom"; |
11 import "mojo/services/media/common/interfaces/media_transport.mojom"; | 11 import "mojo/services/media/common/interfaces/media_transport.mojom"; |
12 import "mojo/services/media/common/interfaces/media_types.mojom"; | 12 import "mojo/services/media/common/interfaces/media_types.mojom"; |
13 import "mojo/services/media/common/interfaces/rate_control.mojom"; | 13 import "mojo/services/media/common/interfaces/rate_control.mojom"; |
14 | 14 |
15 // TODO(dalesat): Define a media sink that multiplexes streams. | 15 // TODO(dalesat): Define a media sink that multiplexes streams. |
16 | 16 |
17 // Consumes media streams and delivers them to specified destinations. | 17 // Consumes media streams and delivers them to specified destinations. |
18 interface MediaSink { | 18 interface MediaSink { |
19 // TODO(dalesat): Support fanout to many destinations. | 19 // TODO(dalesat): Support fanout to many destinations. |
20 | 20 |
| 21 // Special value for GetStatus version_last_seen parameter to get the current |
| 22 // status immediately. |
| 23 const uint64 kInitialStatus = 0; |
| 24 |
21 // Gets the clock disposition from the source. | 25 // Gets the clock disposition from the source. |
22 GetClockDisposition() => (ClockDisposition clock_disposition); | 26 GetClockDisposition() => (ClockDisposition clock_disposition); |
23 | 27 |
24 // Gets a master clock if the sink can be master, null otherwise. | 28 // Gets a master clock if the sink can be master, null otherwise. |
25 GetMasterClock(Clock& master_clock); | 29 GetMasterClock(Clock& master_clock); |
26 | 30 |
27 // Sets a master clock. | 31 // Sets a master clock. |
28 SetMasterClock(Clock? master_clock); | 32 SetMasterClock(Clock? master_clock); |
29 | 33 |
30 // Gets the consumer for the stream to be delivered. | 34 // Gets the consumer for the stream to be delivered. |
31 GetConsumer(MediaConsumer& consumer); | 35 GetConsumer(MediaConsumer& consumer); |
32 | 36 |
33 // Gets the status. To get the status immediately, call GetStatus(0). To | 37 // Gets the status. To get the status immediately, call |
34 // get updates thereafter, pass the version sent in the previous callback. | 38 // GetStatus(kInitialStatus). To get updates thereafter, pass the version |
| 39 // sent in the previous callback. |
35 GetStatus(uint64 version_last_seen) => | 40 GetStatus(uint64 version_last_seen) => |
36 (uint64 version, MediaSinkStatus status); | 41 (uint64 version, MediaSinkStatus status); |
37 | 42 |
38 // Starts playback. | 43 // Starts playback. |
39 Play(); | 44 Play(); |
40 | 45 |
41 // Pauses playback. | 46 // Pauses playback. |
42 Pause(); | 47 Pause(); |
43 }; | 48 }; |
44 | 49 |
45 // MediaSink status information. | 50 // MediaSink status information. |
46 struct MediaSinkStatus { | 51 struct MediaSinkStatus { |
47 // Current state of the sink. | 52 // Current state of the sink. |
48 MediaState state; | 53 MediaState state; |
49 | 54 |
50 // Transform translating local time to presentation time. Reverse translation | 55 // Transform translating local time to presentation time. Reverse translation |
51 // (presentation time to local time) is only valid when media is playing. | 56 // (presentation time to local time) is only valid when media is playing. |
52 TimelineTransform? timeline_transform; | 57 TimelineTransform? timeline_transform; |
53 }; | 58 }; |
OLD | NEW |