| 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 "media/base/demuxer_stream.h" | 11 #include "media/base/demuxer_stream.h" |
| 12 #include "media/base/renderer.h" | 12 #include "media/base/renderer.h" |
| 13 #include "media/base/surface_manager.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" |
| 16 #include "url/gurl.h" |
| 15 | 17 |
| 16 namespace base { | 18 namespace base { |
| 17 class SingleThreadTaskRunner; | 19 class SingleThreadTaskRunner; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace media { | 22 namespace media { |
| 21 | 23 |
| 22 class DemuxerStreamProvider; | 24 class DemuxerStreamProvider; |
| 23 class MojoDemuxerStreamImpl; | 25 class MojoDemuxerStreamImpl; |
| 24 class VideoOverlayFactory; | 26 class VideoOverlayFactory; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // mojom::RendererClient implementation, dispatched on the | 62 // mojom::RendererClient implementation, dispatched on the |
| 61 // |task_runner_|. | 63 // |task_runner_|. |
| 62 void OnTimeUpdate(int64_t time_usec, int64_t max_time_usec) override; | 64 void OnTimeUpdate(int64_t time_usec, int64_t max_time_usec) override; |
| 63 void OnBufferingStateChange(mojom::BufferingState state) override; | 65 void OnBufferingStateChange(mojom::BufferingState state) override; |
| 64 void OnEnded() override; | 66 void OnEnded() override; |
| 65 void OnError() override; | 67 void OnError() override; |
| 66 void OnVideoNaturalSizeChange(const gfx::Size& size) override; | 68 void OnVideoNaturalSizeChange(const gfx::Size& size) override; |
| 67 void OnVideoOpacityChange(bool opaque) override; | 69 void OnVideoOpacityChange(bool opaque) override; |
| 68 void OnWaitingForDecryptionKey() override; | 70 void OnWaitingForDecryptionKey() override; |
| 69 void OnStatisticsUpdate(const PipelineStatistics& stats) override; | 71 void OnStatisticsUpdate(const PipelineStatistics& stats) override; |
| 72 void OnDurationChange(int64_t duration_usec) override; |
| 70 | 73 |
| 71 // Binds |remote_renderer_| to the mojo message pipe. Can be called multiple | 74 // Binds |remote_renderer_| to the mojo message pipe. Can be called multiple |
| 72 // times. If an error occurs during connection, OnConnectionError will be | 75 // times. If an error occurs during connection, OnConnectionError will be |
| 73 // called asynchronously. | 76 // called asynchronously. |
| 74 void BindRemoteRendererIfNeeded(); | 77 void BindRemoteRendererIfNeeded(); |
| 75 | 78 |
| 79 void InitializeRendererFromStreams(media::RendererClient* client); |
| 80 void InitializeRendererFromUrl(media::RendererClient* client); |
| 81 |
| 76 // Callback for connection error on |remote_renderer_|. | 82 // Callback for connection error on |remote_renderer_|. |
| 77 void OnConnectionError(); | 83 void OnConnectionError(); |
| 78 | 84 |
| 79 // Callback for connection error on |audio_stream_| and |video_stream_|. | 85 // Callback for connection error on |audio_stream_| and |video_stream_|. |
| 80 void OnDemuxerStreamConnectionError(DemuxerStream::Type type); | 86 void OnDemuxerStreamConnectionError(DemuxerStream::Type type); |
| 81 | 87 |
| 82 // Callbacks for |remote_renderer_| methods. | 88 // Callbacks for |remote_renderer_| methods. |
| 83 void OnInitialized(media::RendererClient* client, bool success); | 89 void OnInitialized(media::RendererClient* client, bool success); |
| 84 void OnFlushed(); | 90 void OnFlushed(); |
| 85 void OnCdmAttached(bool success); | 91 void OnCdmAttached(bool success); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // Lock used to serialize access for |time_|. | 140 // Lock used to serialize access for |time_|. |
| 135 mutable base::Lock lock_; | 141 mutable base::Lock lock_; |
| 136 base::TimeDelta time_; | 142 base::TimeDelta time_; |
| 137 | 143 |
| 138 DISALLOW_COPY_AND_ASSIGN(MojoRenderer); | 144 DISALLOW_COPY_AND_ASSIGN(MojoRenderer); |
| 139 }; | 145 }; |
| 140 | 146 |
| 141 } // namespace media | 147 } // namespace media |
| 142 | 148 |
| 143 #endif // MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ | 149 #endif // MEDIA_MOJO_CLIENTS_MOJO_RENDERER_H_ |
| OLD | NEW |