| 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_IMPL_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ |
| 6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "media/base/renderer.h" | 10 #include "media/base/renderer.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class MojoRendererImpl : public Renderer, public mojo::MediaRendererClient { | 27 class MojoRendererImpl : public Renderer, public mojo::MediaRendererClient { |
| 28 public: | 28 public: |
| 29 // |task_runner| is the TaskRunner on which all methods are invoked. | 29 // |task_runner| is the TaskRunner on which all methods are invoked. |
| 30 MojoRendererImpl( | 30 MojoRendererImpl( |
| 31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 32 mojo::MediaRendererPtr remote_media_renderer); | 32 mojo::MediaRendererPtr remote_media_renderer); |
| 33 ~MojoRendererImpl() override; | 33 ~MojoRendererImpl() override; |
| 34 | 34 |
| 35 // Renderer implementation. | 35 // Renderer implementation. |
| 36 void Initialize(DemuxerStreamProvider* demuxer_stream_provider, | 36 void Initialize(DemuxerStreamProvider* demuxer_stream_provider, |
| 37 const base::Closure& init_cb, | 37 const PipelineStatusCB& init_cb, |
| 38 const StatisticsCB& statistics_cb, | 38 const StatisticsCB& statistics_cb, |
| 39 const BufferingStateCB& buffering_state_cb, | 39 const BufferingStateCB& buffering_state_cb, |
| 40 const PaintCB& paint_cb, | 40 const PaintCB& paint_cb, |
| 41 const base::Closure& ended_cb, | 41 const base::Closure& ended_cb, |
| 42 const PipelineStatusCB& error_cb) override; | 42 const PipelineStatusCB& error_cb) override; |
| 43 void SetCdm(CdmContext* cdm_context, | 43 void SetCdm(CdmContext* cdm_context, |
| 44 const CdmAttachedCB& cdm_attached_cb) override; | 44 const CdmAttachedCB& cdm_attached_cb) override; |
| 45 void Flush(const base::Closure& flush_cb) override; | 45 void Flush(const base::Closure& flush_cb) override; |
| 46 void StartPlayingFrom(base::TimeDelta time) override; | 46 void StartPlayingFrom(base::TimeDelta time) override; |
| 47 void SetPlaybackRate(float playback_rate) override; | 47 void SetPlaybackRate(float playback_rate) override; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 mojo::MediaRendererPtr remote_media_renderer_; | 67 mojo::MediaRendererPtr remote_media_renderer_; |
| 68 | 68 |
| 69 // Store a handle to the mojo message pipe. This object | 69 // Store a handle to the mojo message pipe. This object |
| 70 // temporary and is used as a springboard so that the | 70 // temporary and is used as a springboard so that the |
| 71 // |remote_media_renderer_| can be constructed on the | 71 // |remote_media_renderer_| can be constructed on the |
| 72 // correct thread. | 72 // correct thread. |
| 73 mojo::ScopedMessagePipeHandle remote_media_renderer_pipe_; | 73 mojo::ScopedMessagePipeHandle remote_media_renderer_pipe_; |
| 74 | 74 |
| 75 // Callbacks passed to Initialize() that we forward messages from | 75 // Callbacks passed to Initialize() that we forward messages from |
| 76 // |remote_media_renderer_| through. | 76 // |remote_media_renderer_| through. |
| 77 base::Closure init_cb_; | 77 PipelineStatusCB init_cb_; |
| 78 base::Closure ended_cb_; | 78 base::Closure ended_cb_; |
| 79 PipelineStatusCB error_cb_; | 79 PipelineStatusCB error_cb_; |
| 80 BufferingStateCB buffering_state_cb_; | 80 BufferingStateCB buffering_state_cb_; |
| 81 | 81 |
| 82 // Lock used to serialize access for the following data members. | 82 // Lock used to serialize access for the following data members. |
| 83 mutable base::Lock lock_; | 83 mutable base::Lock lock_; |
| 84 | 84 |
| 85 base::TimeDelta time_; | 85 base::TimeDelta time_; |
| 86 // TODO(xhwang): It seems we don't need |max_time_| now. Drop it! | 86 // TODO(xhwang): It seems we don't need |max_time_| now. Drop it! |
| 87 base::TimeDelta max_time_; | 87 base::TimeDelta max_time_; |
| 88 | 88 |
| 89 base::WeakPtrFactory<MojoRendererImpl> weak_factory_; | 89 base::WeakPtrFactory<MojoRendererImpl> weak_factory_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(MojoRendererImpl); | 91 DISALLOW_COPY_AND_ASSIGN(MojoRendererImpl); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace media | 94 } // namespace media |
| 95 | 95 |
| 96 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ | 96 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ |
| OLD | NEW |