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 #include <limits> | 5 #include <limits> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "mojo/public/cpp/environment/logging.h" | 8 #include "mojo/public/cpp/environment/logging.h" |
9 #include "mojo/services/media/common/cpp/timeline_function.h" | 9 #include "mojo/services/media/common/cpp/timeline_function.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // static | 23 // static |
24 TimelineFunction TimelineFunction::Compose(const TimelineFunction& bc, | 24 TimelineFunction TimelineFunction::Compose(const TimelineFunction& bc, |
25 const TimelineFunction& ab, | 25 const TimelineFunction& ab, |
26 bool exact) { | 26 bool exact) { |
27 return TimelineFunction(ab.reference_time(), bc.Apply(ab.subject_time()), | 27 return TimelineFunction(ab.reference_time(), bc.Apply(ab.subject_time()), |
28 TimelineRate::Product(ab.rate(), bc.rate(), exact)); | 28 TimelineRate::Product(ab.rate(), bc.rate(), exact)); |
29 } | 29 } |
30 | 30 |
31 } // namespace media | 31 } // namespace media |
| 32 |
| 33 TimelineTransformPtr |
| 34 TypeConverter<TimelineTransformPtr, media::TimelineFunction>::Convert( |
| 35 const media::TimelineFunction& input) { |
| 36 TimelineTransformPtr result = TimelineTransform::New(); |
| 37 result->reference_time = input.reference_time(); |
| 38 result->subject_time = input.subject_time(); |
| 39 result->reference_delta = input.reference_delta(); |
| 40 result->subject_delta = input.subject_delta(); |
| 41 return result; |
| 42 } |
| 43 |
| 44 media::TimelineFunction |
| 45 TypeConverter<media::TimelineFunction, TimelineTransformPtr>::Convert( |
| 46 const TimelineTransformPtr& input) { |
| 47 return input ? media::TimelineFunction( |
| 48 input->reference_time, input->subject_time, |
| 49 input->reference_delta, input->subject_delta) |
| 50 : media::TimelineFunction(); |
| 51 } |
| 52 |
32 } // namespace mojo | 53 } // namespace mojo |
OLD | NEW |