OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/timelines.mojom"; | 8 import "mojo/services/media/common/interfaces/timelines.mojom"; |
9 | 9 |
10 // Timing controller for a media graph. | 10 // Timing controller for a media graph. |
11 interface MediaTimelineController { | 11 interface MediaTimelineController { |
12 const int64 kUnspecifiedTime = 0x7fffffffffffffff; | |
13 const uint64 kInitialStatus = 0; | |
14 | |
15 // Associates a control site with the controller. | 12 // Associates a control site with the controller. |
16 AddControlSite(MediaTimelineControlSite control_site); | 13 AddControlSite(MediaTimelineControlSite control_site); |
17 | 14 |
18 // Gets the status. To get the status immediately, call | |
19 // GetStatus(kInitialStatus). To get updates thereafter, pass | |
20 // the version sent in the previous callback. | |
21 GetStatus(uint64 version_last_seen) | |
22 => (uint64 version, MediaTimelineControllerStatus status); | |
23 | |
24 // Sets the timeline transform at the indicated effective time. At least one | |
25 // of the effective_*_time values must be kUnspecifiedTime. If both are | |
26 // kUnspecifiedTime, the requested change is implemented as soon as possible. | |
27 // effective_subject_time can only be specified if the current subject_delta | |
28 // isn’t zero. reference_delta may not be zero. subject_time may be | |
29 // kUnspecifiedTime to indicate that the new transform subject_time should | |
30 // be inferred from the effective time. The reference time for the new | |
31 // transform (the reference time that will correspond to the specified or | |
32 // inferred subject_time) is always inferred from the effective time. The | |
33 // callback is called at the effective time or when a pending operation is | |
34 // cancelled due to a subsequent call, in which case the 'completed' value is | |
35 // false. | |
36 SetTimelineTransform( | |
37 int64 subject_time, | |
38 uint32 subject_delta, | |
39 uint32 reference_delta, | |
40 int64 effective_subject_time, | |
41 int64 effective_reference_time) => (bool completed); | |
42 | |
43 // Gets a timeline control site interface for the controller. | 15 // Gets a timeline control site interface for the controller. |
44 GetControlSite(MediaTimelineControlSite& control_site); | 16 GetControlSite(MediaTimelineControlSite& control_site); |
45 }; | 17 }; |
46 | 18 |
47 // Status returned by MediaTimelineController's GetStatus method. | |
48 struct MediaTimelineControllerStatus { | |
49 // Current timeline transform. | |
50 mojo.TimelineTransform timeline_transform; | |
51 | |
52 // Whether end of stream was encountered. | |
53 bool end_of_stream; | |
54 }; | |
55 | |
56 // Media graph component controlled by a MediaTimelineController. | 19 // Media graph component controlled by a MediaTimelineController. |
57 interface MediaTimelineControlSite { | 20 interface MediaTimelineControlSite { |
58 const uint64 kInitialStatus = 0; | 21 const uint64 kInitialStatus = 0; |
59 | 22 |
60 // Gets the status. To get the status immediately, call | 23 // Gets the status. To get the status immediately, call |
61 // GetStatus(kInitialStatus). To get updates thereafter, pass | 24 // GetStatus(kInitialStatus). To get updates thereafter, pass |
62 // the version sent in the previous callback. | 25 // the version sent in the previous callback. |
63 GetStatus(uint64 version_last_seen) => | 26 GetStatus(uint64 version_last_seen) => |
64 (uint64 version, MediaTimelineControlSiteStatus status); | 27 (uint64 version, MediaTimelineControlSiteStatus status); |
65 | 28 |
66 // Gets a timeline consumer interface for the control site. | 29 // Gets a timeline consumer interface for the control site. |
67 GetTimelineConsumer(TimelineConsumer& timeline_consumer); | 30 GetTimelineConsumer(TimelineConsumer& timeline_consumer); |
68 }; | 31 }; |
69 | 32 |
70 // Status returned by MediaTimelineControlSite's GetStatus method. | 33 // Status returned by MediaTimelineControlSite's GetStatus method. |
71 struct MediaTimelineControlSiteStatus { | 34 struct MediaTimelineControlSiteStatus { |
72 // Whether end of stream was encountered. | 35 // Current timeline transform. |
| 36 mojo.TimelineTransform timeline_transform; |
| 37 |
| 38 // Indicates whether presentation has reached end-of-stream. |
73 bool end_of_stream; | 39 bool end_of_stream; |
74 | |
75 // Whether the site is starving. | |
76 bool starving; | |
77 }; | 40 }; |
OLD | NEW |