| 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/nonce.h" |
| 11 #include "media/base/demuxer_stream.h" | 12 #include "media/base/demuxer_stream.h" |
| 12 #include "media/base/renderer.h" | 13 #include "media/base/renderer.h" |
| 13 #include "media/mojo/interfaces/renderer.mojom.h" | 14 #include "media/mojo/interfaces/renderer.mojom.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class SingleThreadTaskRunner; | 18 class SingleThreadTaskRunner; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace media { | 21 namespace media { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 49 void SetCdm(CdmContext* cdm_context, | 50 void SetCdm(CdmContext* cdm_context, |
| 50 const CdmAttachedCB& cdm_attached_cb) override; | 51 const CdmAttachedCB& cdm_attached_cb) override; |
| 51 void Flush(const base::Closure& flush_cb) override; | 52 void Flush(const base::Closure& flush_cb) override; |
| 52 void StartPlayingFrom(base::TimeDelta time) override; | 53 void StartPlayingFrom(base::TimeDelta time) override; |
| 53 void SetPlaybackRate(double playback_rate) override; | 54 void SetPlaybackRate(double playback_rate) override; |
| 54 void SetVolume(float volume) override; | 55 void SetVolume(float volume) override; |
| 55 base::TimeDelta GetMediaTime() override; | 56 base::TimeDelta GetMediaTime() override; |
| 56 bool HasAudio() override; | 57 bool HasAudio() override; |
| 57 bool HasVideo() override; | 58 bool HasVideo() override; |
| 58 | 59 |
| 60 using ReceiveSurfaceRequestTokenCB = |
| 61 base::Callback<void(bool, const base::Nonce&)>; |
| 62 |
| 63 // Asks |remote_renderer_| to register a request in the browser's |
| 64 // ScopedSurfaceRequestManager, and returns the request's token. |
| 65 void InitiateScopedSurfaceRequest( |
| 66 ReceiveSurfaceRequestTokenCB receive_request_token_cb); |
| 67 |
| 59 private: | 68 private: |
| 60 // mojom::RendererClient implementation, dispatched on the | 69 // mojom::RendererClient implementation, dispatched on the |
| 61 // |task_runner_|. | 70 // |task_runner_|. |
| 62 void OnTimeUpdate(base::TimeDelta time, base::TimeDelta max_time) override; | 71 void OnTimeUpdate(base::TimeDelta time, base::TimeDelta max_time) override; |
| 63 void OnBufferingStateChange(mojom::BufferingState state) override; | 72 void OnBufferingStateChange(mojom::BufferingState state) override; |
| 64 void OnEnded() override; | 73 void OnEnded() override; |
| 65 void OnError() override; | 74 void OnError() override; |
| 66 void OnVideoNaturalSizeChange(const gfx::Size& size) override; | 75 void OnVideoNaturalSizeChange(const gfx::Size& size) override; |
| 67 void OnVideoOpacityChange(bool opaque) override; | 76 void OnVideoOpacityChange(bool opaque) override; |
| 68 void OnWaitingForDecryptionKey() override; | 77 void OnWaitingForDecryptionKey() override; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Lock used to serialize access for |time_|. | 152 // Lock used to serialize access for |time_|. |
| 144 mutable base::Lock lock_; | 153 mutable base::Lock lock_; |
| 145 base::TimeDelta time_; | 154 base::TimeDelta time_; |
| 146 | 155 |
| 147 DISALLOW_COPY_AND_ASSIGN(MojoRenderer); | 156 DISALLOW_COPY_AND_ASSIGN(MojoRenderer); |
| 148 }; | 157 }; |
| 149 | 158 |
| 150 } // namespace media | 159 } // namespace media |
| 151 | 160 |
| 152 #endif // MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ | 161 #endif // MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ |
| OLD | NEW |