| 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_MEDIA_PLAYER_IMPL_H_ | 5 #ifndef MOJO_SERVICES_MEDIA_FACTORY_MEDIA_PLAYER_IMPL_H_ |
| 6 #define MOJO_SERVICES_MEDIA_FACTORY_MEDIA_PLAYER_IMPL_H_ | 6 #define MOJO_SERVICES_MEDIA_FACTORY_MEDIA_PLAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 // Increments the status version and runs pending status request callbacks. | 97 // Increments the status version and runs pending status request callbacks. |
| 98 void StatusUpdated(); | 98 void StatusUpdated(); |
| 99 | 99 |
| 100 // Runs a status request callback. | 100 // Runs a status request callback. |
| 101 void RunStatusCallback(const GetStatusCallback& callback) const; | 101 void RunStatusCallback(const GetStatusCallback& callback) const; |
| 102 | 102 |
| 103 // Handles a status update from the source. When called with the default | 103 // Handles a status update from the source. When called with the default |
| 104 // argument values, initiates source status updates. | 104 // argument values, initiates source status updates. |
| 105 void HandleSourceStatusUpdates( | 105 void HandleSourceStatusUpdates( |
| 106 uint64_t version = 0, | 106 uint64_t version = MediaSource::kInitialStatus, |
| 107 MediaSourceStatusPtr status = nullptr); | 107 MediaSourceStatusPtr status = nullptr); |
| 108 | 108 |
| 109 // Handles a status update from a sink. When called with the default | 109 // Handles a status update from a sink. When called with the default |
| 110 // argument values, initiates sink status updates. | 110 // argument values, initiates sink status updates. |
| 111 void HandleSinkStatusUpdates( | 111 void HandleSinkStatusUpdates( |
| 112 const std::unique_ptr<Stream>& stream, | 112 const std::unique_ptr<Stream>& stream, |
| 113 uint64_t version = 0, | 113 uint64_t version = MediaSink::kInitialStatus, |
| 114 MediaSinkStatusPtr status = nullptr); | 114 MediaSinkStatusPtr status = nullptr); |
| 115 | 115 |
| 116 Event event_; | 116 Event event_; |
| 117 Binding<MediaPlayer> binding_; | 117 Binding<MediaPlayer> binding_; |
| 118 MediaFactoryPtr factory_; | 118 MediaFactoryPtr factory_; |
| 119 MediaSourcePtr source_; | 119 MediaSourcePtr source_; |
| 120 std::vector<std::unique_ptr<Stream>> streams_; | 120 std::vector<std::unique_ptr<Stream>> streams_; |
| 121 uint64_t status_version_ = 1u; | 121 uint64_t status_version_ = 1u; |
| 122 bool flushed_ = true; | 122 bool flushed_ = true; |
| 123 MediaState reported_media_state_ = MediaState::UNPREPARED; | 123 MediaState reported_media_state_ = MediaState::UNPREPARED; |
| 124 Watched<MediaState> target_state_; | 124 Watched<MediaState> target_state_; |
| 125 Watched<int64_t> target_position_; | 125 Watched<int64_t> target_position_; |
| 126 TimelineTransformPtr transform_; | 126 TimelineTransformPtr transform_; |
| 127 MediaMetadataPtr metadata_; | 127 MediaMetadataPtr metadata_; |
| 128 std::deque<GetStatusCallback> pending_status_requests_; | 128 std::deque<GetStatusCallback> pending_status_requests_; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace media | 131 } // namespace media |
| 132 } // namespace mojo | 132 } // namespace mojo |
| 133 | 133 |
| 134 #endif // MOJO_SERVICES_MEDIA_FACTORY_MEDIA_PLAYER_IMPL_H_ | 134 #endif // MOJO_SERVICES_MEDIA_FACTORY_MEDIA_PLAYER_IMPL_H_ |
| OLD | NEW |