| 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 #ifndef MOJO_SERVICES_MEDIA_FACTORY_TIMELINE_CONTROLLER_IMPL_H_ | 5 #ifndef MOJO_SERVICES_MEDIA_FACTORY_TIMELINE_CONTROLLER_IMPL_H_ |
| 6 #define MOJO_SERVICES_MEDIA_FACTORY_TIMELINE_CONTROLLER_IMPL_H_ | 6 #define MOJO_SERVICES_MEDIA_FACTORY_TIMELINE_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const SetTimelineTransformCallback& callback) override; | 57 const SetTimelineTransformCallback& callback) override; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 static constexpr int64_t kDefaultLeadTime = Timeline::ns_from_ms(30); | 60 static constexpr int64_t kDefaultLeadTime = Timeline::ns_from_ms(30); |
| 61 | 61 |
| 62 // Relationship to subordinate control site. | 62 // Relationship to subordinate control site. |
| 63 struct SiteState { | 63 struct SiteState { |
| 64 SiteState(MediaTimelineControllerImpl* parent, | 64 SiteState(MediaTimelineControllerImpl* parent, |
| 65 MediaTimelineControlSitePtr site); | 65 MediaTimelineControlSitePtr site); |
| 66 | 66 |
| 67 SiteState(SiteState&& other); | |
| 68 | |
| 69 ~SiteState(); | 67 ~SiteState(); |
| 70 | 68 |
| 71 void HandleStatusUpdates( | 69 void HandleStatusUpdates( |
| 72 uint64_t version = MediaTimelineControlSite::kInitialStatus, | 70 uint64_t version = MediaTimelineControlSite::kInitialStatus, |
| 73 MediaTimelineControlSiteStatusPtr status = nullptr); | 71 MediaTimelineControlSiteStatusPtr status = nullptr); |
| 74 | 72 |
| 75 MediaTimelineControllerImpl* parent_; | 73 MediaTimelineControllerImpl* parent_; |
| 76 MediaTimelineControlSitePtr site_; | 74 MediaTimelineControlSitePtr site_; |
| 77 TimelineConsumerPtr consumer_; | 75 TimelineConsumerPtr consumer_; |
| 78 bool end_of_stream_ = false; | 76 bool end_of_stream_ = false; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 140 |
| 143 MediaTimelineControllerImpl(InterfaceRequest<MediaTimelineController> request, | 141 MediaTimelineControllerImpl(InterfaceRequest<MediaTimelineController> request, |
| 144 MediaFactoryService* owner); | 142 MediaFactoryService* owner); |
| 145 | 143 |
| 146 // Takes action when a site changes its end-of-stream value. | 144 // Takes action when a site changes its end-of-stream value. |
| 147 void HandleSiteEndOfStreamChange(); | 145 void HandleSiteEndOfStreamChange(); |
| 148 | 146 |
| 149 Binding<MediaTimelineControlSite> control_site_binding_; | 147 Binding<MediaTimelineControlSite> control_site_binding_; |
| 150 Binding<TimelineConsumer> consumer_binding_; | 148 Binding<TimelineConsumer> consumer_binding_; |
| 151 MojoPublisher<GetStatusCallback> status_publisher_; | 149 MojoPublisher<GetStatusCallback> status_publisher_; |
| 152 std::vector<SiteState> site_states_; | 150 std::vector<std::unique_ptr<SiteState>> site_states_; |
| 153 TimelineFunction current_timeline_function_; | 151 TimelineFunction current_timeline_function_; |
| 154 bool end_of_stream_ = false; | 152 bool end_of_stream_ = false; |
| 155 std::weak_ptr<TimelineTransition> pending_transition_; | 153 std::weak_ptr<TimelineTransition> pending_transition_; |
| 156 }; | 154 }; |
| 157 | 155 |
| 158 } // namespace media | 156 } // namespace media |
| 159 } // namespace mojo | 157 } // namespace mojo |
| 160 | 158 |
| 161 #endif // MOJO_SERVICES_MEDIA_FACTORY_TIMELINE_CONTROLLER_IMPL_H_ | 159 #endif // MOJO_SERVICES_MEDIA_FACTORY_TIMELINE_CONTROLLER_IMPL_H_ |
| OLD | NEW |