OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ |
6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Called when the DemuxerStreamProviderShim is ready to go (has a config, | 81 // Called when the DemuxerStreamProviderShim is ready to go (has a config, |
82 // pipe handle, etc) and can be handed off to a renderer for use. | 82 // pipe handle, etc) and can be handed off to a renderer for use. |
83 void OnStreamReady(const base::Callback<void(bool)>& callback); | 83 void OnStreamReady(const base::Callback<void(bool)>& callback); |
84 | 84 |
85 // Called when |audio_renderer_| initialization has completed. | 85 // Called when |audio_renderer_| initialization has completed. |
86 void OnRendererInitializeDone(const base::Callback<void(bool)>& callback, | 86 void OnRendererInitializeDone(const base::Callback<void(bool)>& callback, |
87 PipelineStatus status); | 87 PipelineStatus status); |
88 | 88 |
89 // Periodically polls the media time from the renderer and notifies the client | 89 // Periodically polls the media time from the renderer and notifies the client |
90 // if the media time has changed since the last update. If |force| is true, | 90 // if the media time has changed since the last update. |
91 // the client is notified even if the time is unchanged. | 91 // If |force| is true, the client is notified even if the time is unchanged. |
| 92 // If |range| is true, an interpolation time range is reported. |
92 void UpdateMediaTime(bool force); | 93 void UpdateMediaTime(bool force); |
93 void CancelPeriodicMediaTimeUpdates(); | 94 void CancelPeriodicMediaTimeUpdates(); |
94 void SchedulePeriodicMediaTimeUpdates(); | 95 void SchedulePeriodicMediaTimeUpdates(); |
95 | 96 |
96 // Callback executed once Flush() completes. | 97 // Callback executed once Flush() completes. |
97 void OnFlushCompleted(const FlushCallback& callback); | 98 void OnFlushCompleted(const FlushCallback& callback); |
98 | 99 |
99 // Callback executed once SetCdm() completes. | 100 // Callback executed once SetCdm() completes. |
100 void OnCdmAttached(scoped_refptr<MediaKeys> cdm, | 101 void OnCdmAttached(scoped_refptr<MediaKeys> cdm, |
101 const base::Callback<void(bool)>& callback, | 102 const base::Callback<void(bool)>& callback, |
102 bool success); | 103 bool success); |
103 | 104 |
104 mojo::StrongBinding<mojom::Renderer> binding_; | 105 mojo::StrongBinding<mojom::Renderer> binding_; |
105 | 106 |
106 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context_; | 107 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context_; |
107 | 108 |
108 State state_; | 109 State state_; |
| 110 double playback_rate_; |
109 | 111 |
110 std::unique_ptr<DemuxerStreamProvider> stream_provider_; | 112 std::unique_ptr<DemuxerStreamProvider> stream_provider_; |
111 | 113 |
112 base::RepeatingTimer time_update_timer_; | 114 base::RepeatingTimer time_update_timer_; |
113 base::TimeDelta last_media_time_; | 115 base::TimeDelta last_media_time_; |
114 | 116 |
115 mojom::RendererClientPtr client_; | 117 mojom::RendererClientPtr client_; |
116 | 118 |
117 // Hold a reference to the CDM set on the |renderer_| so that the CDM won't be | 119 // Hold a reference to the CDM set on the |renderer_| so that the CDM won't be |
118 // destructed while the |renderer_| is still using it. | 120 // destructed while the |renderer_| is still using it. |
(...skipping 12 matching lines...) Expand all Loading... |
131 | 133 |
132 base::WeakPtr<MojoRendererService> weak_this_; | 134 base::WeakPtr<MojoRendererService> weak_this_; |
133 base::WeakPtrFactory<MojoRendererService> weak_factory_; | 135 base::WeakPtrFactory<MojoRendererService> weak_factory_; |
134 | 136 |
135 DISALLOW_COPY_AND_ASSIGN(MojoRendererService); | 137 DISALLOW_COPY_AND_ASSIGN(MojoRendererService); |
136 }; | 138 }; |
137 | 139 |
138 } // namespace media | 140 } // namespace media |
139 | 141 |
140 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ | 142 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ |
OLD | NEW |