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 // TimelineQuad | 8 // TimelineQuad |
9 // TODO(dalesat): Rename reference -> presentation. | 9 // TODO(dalesat): Rename reference -> presentation. |
10 // TODO(dalesat): Rename target -> reference. | 10 // TODO(dalesat): Rename target -> reference. |
(...skipping 15 matching lines...) Expand all Loading... |
26 // | 26 // |
27 // Given that r and t represent the same instant in time (in a single frame of | 27 // Given that r and t represent the same instant in time (in a single frame of |
28 // reference) | 28 // reference) |
29 // | 29 // |
30 // t = f(r) = (((r - ref_offset) * tgt_delta) / ref_delta) + tgt_offset | 30 // t = f(r) = (((r - ref_offset) * tgt_delta) / ref_delta) + tgt_offset |
31 // r = F(t) = (((t - tgt_offset) * ref_delta) / tgt_delta) + ref_offset | 31 // r = F(t) = (((t - tgt_offset) * ref_delta) / tgt_delta) + ref_offset |
32 // | 32 // |
33 // See also... | 33 // See also... |
34 // mojo/services/media/common/linear_transform.h | 34 // mojo/services/media/common/linear_transform.h |
35 // | 35 // |
| 36 // no-format |
36 struct TimelineQuad { | 37 struct TimelineQuad { |
37 int64 reference_offset = 0; | 38 int64 reference_offset = 0; |
38 int64 target_offset = 0; | 39 int64 target_offset = 0; |
39 int32 reference_delta = 0; | 40 int32 reference_delta = 0; |
40 uint32 target_delta = 1; | 41 uint32 target_delta = 1; |
41 }; | 42 }; |
| 43 // end-no-format |
42 | 44 |
43 // TimelineTransform | 45 // TimelineTransform |
44 // TODO(dalesat): Rename reference -> presentation. | 46 // TODO(dalesat): Rename reference -> presentation. |
45 // TODO(dalesat): Rename target -> reference. | 47 // TODO(dalesat): Rename target -> reference. |
46 // | 48 // |
47 // A structure which holds both a timeline quad, and a pair of identifiers which | 49 // A structure which holds both a timeline quad, and a pair of identifiers which |
48 // define the specific timelines which are the reference and target timelines. | 50 // define the specific timelines which are the reference and target timelines. |
49 struct TimelineTransform { | 51 struct TimelineTransform { |
50 // TODO: These constants should probably defined by a central time management | 52 // TODO: These constants should probably defined by a central time management |
51 // service, not here. | 53 // service, not here. |
52 const uint32 kLocalTimeID = 0xFFFFFFFF; | 54 const uint32 kLocalTimeID = 0xFFFFFFFF; |
53 const uint32 kContextual = 0xFFFFFFFE; | 55 const uint32 kContextual = 0xFFFFFFFE; |
54 | 56 |
55 TimelineQuad quad; | 57 TimelineQuad quad; |
56 uint32 reference_timeline_id = kContextual; | 58 uint32 reference_timeline_id = kContextual; |
57 uint32 target_timeline_id = kLocalTimeID; | 59 uint32 target_timeline_id = kLocalTimeID; |
58 }; | 60 }; |
59 | 61 |
60 // RateControl | 62 // RateControl |
61 // | 63 // |
62 // An interface typically exposed by media renderers which allow producers of | 64 // An interface typically exposed by media renderers which allow producers of |
63 // media to specify how the presentation time stamps of the media queued to the | 65 // media to specify how the presentation time stamps of the media queued to the |
64 // renderer relate to real time. Users may initialize the transformation with a | 66 // renderer relate to real time. Users may initialize the transformation with a |
65 // specific Quad, change the rate immediately in a first order contiguous | 67 // specific Quad, change the rate immediately in a first order contiguous |
66 // fashion, or schedule ranges in the rate at points in time on either the | 68 // fashion, or schedule ranges in the rate at points in time on either the |
67 // reference or target timelines. | 69 // reference or target timelines. |
(...skipping 23 matching lines...) Expand all Loading... |
91 int64 reference_time); | 93 int64 reference_time); |
92 | 94 |
93 // Schedule a first order continuous rate change at the specified target time. | 95 // Schedule a first order continuous rate change at the specified target time. |
94 SetRateAtTargetTime(int32 reference_delta, | 96 SetRateAtTargetTime(int32 reference_delta, |
95 uint32 target_delta, | 97 uint32 target_delta, |
96 int64 target_time); | 98 int64 target_time); |
97 | 99 |
98 // Cancel any pending rate changes | 100 // Cancel any pending rate changes |
99 CancelPendingChanges(); | 101 CancelPendingChanges(); |
100 }; | 102 }; |
OLD | NEW |