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_CLIENTS_MOJO_RENDERER_H_ | 5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ |
6 #define MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ | 6 #define MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/time/default_tick_clock.h" | 11 #include "base/time/default_tick_clock.h" |
12 #include "base/unguessable_token.h" | |
12 #include "media/base/demuxer_stream.h" | 13 #include "media/base/demuxer_stream.h" |
13 #include "media/base/renderer.h" | 14 #include "media/base/renderer.h" |
14 #include "media/base/time_delta_interpolator.h" | 15 #include "media/base/time_delta_interpolator.h" |
15 #include "media/mojo/interfaces/renderer.mojom.h" | 16 #include "media/mojo/interfaces/renderer.mojom.h" |
16 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class SingleThreadTaskRunner; | 20 class SingleThreadTaskRunner; |
20 } | 21 } |
21 | 22 |
(...skipping 29 matching lines...) Expand all Loading... | |
51 void SetCdm(CdmContext* cdm_context, | 52 void SetCdm(CdmContext* cdm_context, |
52 const CdmAttachedCB& cdm_attached_cb) override; | 53 const CdmAttachedCB& cdm_attached_cb) override; |
53 void Flush(const base::Closure& flush_cb) override; | 54 void Flush(const base::Closure& flush_cb) override; |
54 void StartPlayingFrom(base::TimeDelta time) override; | 55 void StartPlayingFrom(base::TimeDelta time) override; |
55 void SetPlaybackRate(double playback_rate) override; | 56 void SetPlaybackRate(double playback_rate) override; |
56 void SetVolume(float volume) override; | 57 void SetVolume(float volume) override; |
57 base::TimeDelta GetMediaTime() override; | 58 base::TimeDelta GetMediaTime() override; |
58 bool HasAudio() override; | 59 bool HasAudio() override; |
59 bool HasVideo() override; | 60 bool HasVideo() override; |
60 | 61 |
62 using ReceiveSurfaceRequestTokenCB = | |
63 base::Callback<void(const base::Optional<base::UnguessableToken>&)>; | |
64 | |
65 // Asks |remote_renderer_| to register a request in the browser's | |
66 // ScopedSurfaceRequestManager, and returns the request's token. | |
67 void InitiateScopedSurfaceRequest( | |
68 ReceiveSurfaceRequestTokenCB receive_request_token_cb); | |
69 | |
61 private: | 70 private: |
62 // mojom::RendererClient implementation, dispatched on the | 71 // mojom::RendererClient implementation, dispatched on the |
63 // |task_runner_|. | 72 // |task_runner_|. |
64 void OnTimeUpdate(base::TimeDelta time, | 73 void OnTimeUpdate(base::TimeDelta time, |
65 base::TimeDelta max_time, | 74 base::TimeDelta max_time, |
66 base::TimeTicks capture_time) override; | 75 base::TimeTicks capture_time) override; |
67 void OnBufferingStateChange(mojom::BufferingState state) override; | 76 void OnBufferingStateChange(mojom::BufferingState state) override; |
68 void OnEnded() override; | 77 void OnEnded() override; |
69 void OnError() override; | 78 void OnError() override; |
70 void OnVideoNaturalSizeChange(const gfx::Size& size) override; | 79 void OnVideoNaturalSizeChange(const gfx::Size& size) override; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 | 146 |
138 // Binding for RendererClient, bound to the |task_runner_|. | 147 // Binding for RendererClient, bound to the |task_runner_|. |
139 mojo::Binding<RendererClient> binding_; | 148 mojo::Binding<RendererClient> binding_; |
140 | 149 |
141 bool encountered_error_ = false; | 150 bool encountered_error_ = false; |
142 | 151 |
143 PipelineStatusCB init_cb_; | 152 PipelineStatusCB init_cb_; |
144 base::Closure flush_cb_; | 153 base::Closure flush_cb_; |
145 CdmAttachedCB cdm_attached_cb_; | 154 CdmAttachedCB cdm_attached_cb_; |
146 | 155 |
147 // Lock used to serialize access for |time_interpolator_|. | 156 // Lock used to serialize access for |time_interpolator_|. |
liberato (no reviews please)
2016/09/21 14:33:28
time_interpolator_ => media_time_interpolator_. a
tguilbert
2016/09/21 20:26:59
I think you may have been looking at the patch-pat
| |
148 mutable base::Lock lock_; | 157 mutable base::Lock lock_; |
149 base::DefaultTickClock media_clock_; | 158 base::DefaultTickClock media_clock_; |
150 media::TimeDeltaInterpolator media_time_interpolator_; | 159 media::TimeDeltaInterpolator media_time_interpolator_; |
151 | 160 |
152 DISALLOW_COPY_AND_ASSIGN(MojoRenderer); | 161 DISALLOW_COPY_AND_ASSIGN(MojoRenderer); |
153 }; | 162 }; |
154 | 163 |
155 } // namespace media | 164 } // namespace media |
156 | 165 |
157 #endif // MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ | 166 #endif // MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ |
OLD | NEW |