| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
| 14 #include "media/base/audio_decoder_config.h" | 14 #include "media/base/audio_decoder_config.h" |
| 15 #include "media/base/buffering_state.h" | 15 #include "media/base/buffering_state.h" |
| 16 #include "media/base/media_export.h" | 16 #include "media/base/media_export.h" |
| 17 #include "media/base/pipeline_status.h" | 17 #include "media/base/pipeline_status.h" |
| 18 #include "media/mojo/interfaces/media_renderer.mojom.h" | 18 #include "media/mojo/interfaces/media_renderer.mojom.h" |
| 19 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 19 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
| 20 | 20 |
| 21 namespace mojo { | 21 namespace mojo { |
| 22 class ApplicationConnection; | 22 class ApplicationConnection; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace media { | 25 namespace media { |
| 26 | 26 |
| 27 class AudioRendererSink; | 27 class AudioRendererSink; |
| 28 class DemuxerStreamProviderShim; | 28 class DemuxerStreamProviderShim; |
| 29 class CdmContextProvider; | 29 class CdmContextProvider; |
| 30 class MediaLog; |
| 30 class Renderer; | 31 class Renderer; |
| 32 class RendererFactory; |
| 31 class VideoRendererSink; | 33 class VideoRendererSink; |
| 32 | 34 |
| 33 // A mojo::MediaRenderer implementation that uses media::AudioRenderer to | 35 // A mojo::MediaRenderer implementation that uses media::AudioRenderer to |
| 34 // decode and render audio to a sink obtained from the ApplicationConnection. | 36 // decode and render audio to a sink obtained from the ApplicationConnection. |
| 35 class MEDIA_EXPORT MojoRendererService | 37 class MEDIA_EXPORT MojoRendererService |
| 36 : NON_EXPORTED_BASE(mojo::MediaRenderer) { | 38 : NON_EXPORTED_BASE(mojo::MediaRenderer) { |
| 37 public: | 39 public: |
| 38 // |cdm_context_provider| can be used to find the CdmContext to support | 40 // |cdm_context_provider| can be used to find the CdmContext to support |
| 39 // encrypted media. If null, encrypted media is not supported. | 41 // encrypted media. If null, encrypted media is not supported. |
| 40 MojoRendererService(CdmContextProvider* cdm_context_provider, | 42 MojoRendererService(CdmContextProvider* cdm_context_provider, |
| 43 RendererFactory* renderer_factory, |
| 44 const scoped_refptr<MediaLog>& media_log, |
| 41 mojo::InterfaceRequest<mojo::MediaRenderer> request); | 45 mojo::InterfaceRequest<mojo::MediaRenderer> request); |
| 42 ~MojoRendererService() final; | 46 ~MojoRendererService() final; |
| 43 | 47 |
| 44 // mojo::MediaRenderer implementation. | 48 // mojo::MediaRenderer implementation. |
| 45 void Initialize(mojo::MediaRendererClientPtr client, | 49 void Initialize(mojo::MediaRendererClientPtr client, |
| 46 mojo::DemuxerStreamPtr audio, | 50 mojo::DemuxerStreamPtr audio, |
| 47 mojo::DemuxerStreamPtr video, | 51 mojo::DemuxerStreamPtr video, |
| 48 const mojo::Closure& callback) final; | 52 const mojo::Closure& callback) final; |
| 49 void Flush(const mojo::Closure& callback) final; | 53 void Flush(const mojo::Closure& callback) final; |
| 50 void StartPlayingFrom(int64_t time_delta_usec) final; | 54 void StartPlayingFrom(int64_t time_delta_usec) final; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 120 |
| 117 base::WeakPtr<MojoRendererService> weak_this_; | 121 base::WeakPtr<MojoRendererService> weak_this_; |
| 118 base::WeakPtrFactory<MojoRendererService> weak_factory_; | 122 base::WeakPtrFactory<MojoRendererService> weak_factory_; |
| 119 | 123 |
| 120 DISALLOW_COPY_AND_ASSIGN(MojoRendererService); | 124 DISALLOW_COPY_AND_ASSIGN(MojoRendererService); |
| 121 }; | 125 }; |
| 122 | 126 |
| 123 } // namespace media | 127 } // namespace media |
| 124 | 128 |
| 125 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ | 129 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ |
| OLD | NEW |