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 module mojo.media; | 6 module mojo.media; |
6 | 7 |
7 // TimelineQuad | 8 // TimelineQuad |
| 9 // TODO(dalesat): Rename reference -> presentation. |
| 10 // TODO(dalesat): Rename target -> reference. |
8 // | 11 // |
9 // A structure which holds the four numbers needed to define a linear | 12 // A structure which holds the four numbers needed to define a linear |
10 // relationship between the points in two different timelines. The relationship | 13 // relationship between the points in two different timelines. The relationship |
11 // is expressed using 4 integers in order to facilitate compositions of multiple | 14 // is expressed using 4 integers in order to facilitate compositions of multiple |
12 // transformations (A->B can be composed with B->C to produce the transformation | 15 // transformations (A->B can be composed with B->C to produce the transformation |
13 // from A->C), and to minimize rounding and scaling errors when mapping points | 16 // from A->C), and to minimize rounding and scaling errors when mapping points |
14 // between timelines which do not have an integer scaling relationship between | 17 // between timelines which do not have an integer scaling relationship between |
15 // each other. | 18 // each other. |
16 // | 19 // |
17 // These values are used to define the following functions which map from | 20 // These values are used to define the following functions which map from |
(...skipping 13 matching lines...) Expand all Loading... |
31 // mojo/services/media/common/linear_transform.h | 34 // mojo/services/media/common/linear_transform.h |
32 // | 35 // |
33 struct TimelineQuad { | 36 struct TimelineQuad { |
34 int64 reference_offset = 0; | 37 int64 reference_offset = 0; |
35 int64 target_offset = 0; | 38 int64 target_offset = 0; |
36 int32 reference_delta = 0; | 39 int32 reference_delta = 0; |
37 uint32 target_delta = 1; | 40 uint32 target_delta = 1; |
38 }; | 41 }; |
39 | 42 |
40 // TimelineTransform | 43 // TimelineTransform |
| 44 // TODO(dalesat): Rename reference -> presentation. |
| 45 // TODO(dalesat): Rename target -> reference. |
41 // | 46 // |
42 // A structure which holds both a timeline quad, and a pair of identifiers which | 47 // A structure which holds both a timeline quad, and a pair of identifiers which |
43 // define the specific timelines which are the reference and target timelines. | 48 // define the specific timelines which are the reference and target timelines. |
44 struct TimelineTransform { | 49 struct TimelineTransform { |
45 // TODO: These constants should probably defined by a central time management | 50 // TODO: These constants should probably defined by a central time management |
46 // service, not here. | 51 // service, not here. |
47 const uint32 kLocalTimeID = 0xFFFFFFFF; | 52 const uint32 kLocalTimeID = 0xFFFFFFFF; |
48 const uint32 kContextual = 0xFFFFFFFE; | 53 const uint32 kContextual = 0xFFFFFFFE; |
49 | 54 |
50 TimelineQuad quad; | 55 TimelineQuad quad; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 int64 reference_time); | 91 int64 reference_time); |
87 | 92 |
88 // Schedule a first order continuous rate change at the specified target time. | 93 // Schedule a first order continuous rate change at the specified target time. |
89 SetRateAtTargetTime(int32 reference_delta, | 94 SetRateAtTargetTime(int32 reference_delta, |
90 uint32 target_delta, | 95 uint32 target_delta, |
91 int64 target_time); | 96 int64 target_time); |
92 | 97 |
93 // Cancel any pending rate changes | 98 // Cancel any pending rate changes |
94 CancelPendingChanges(); | 99 CancelPendingChanges(); |
95 }; | 100 }; |
OLD | NEW |