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 14 matching lines...) Expand all Loading... |
25 // mojo::MediaRenderer proxies back to the MojoRendererImpl via the | 25 // mojo::MediaRenderer proxies back to the MojoRendererImpl via the |
26 // mojo::MediaRendererClient interface. | 26 // mojo::MediaRendererClient interface. |
27 // | 27 // |
28 // MojoRendererImpl implements media::Renderer for use as either an audio | 28 // MojoRendererImpl implements media::Renderer for use as either an audio |
29 // or video renderer. | 29 // or video renderer. |
30 // | 30 // |
31 // TODO(tim): Only audio is currently supported. http://crbug.com/410451. | 31 // TODO(tim): Only audio is currently supported. http://crbug.com/410451. |
32 class MojoRendererImpl : public Renderer, public mojo::MediaRendererClient { | 32 class MojoRendererImpl : public Renderer, public mojo::MediaRendererClient { |
33 public: | 33 public: |
34 // |task_runner| is the TaskRunner on which all methods are invoked. | 34 // |task_runner| is the TaskRunner on which all methods are invoked. |
35 // |demuxer_stream_provider| provides encoded streams for decoding and | |
36 // rendering. | |
37 // |audio_renderer_provider| is a ServiceProvider from a connected | 35 // |audio_renderer_provider| is a ServiceProvider from a connected |
38 // Application that is hosting a mojo::MediaRenderer. | 36 // Application that is hosting a mojo::MediaRenderer. |
39 MojoRendererImpl( | 37 MojoRendererImpl( |
40 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 38 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
41 DemuxerStreamProvider* demuxer_stream_provider, | |
42 mojo::ServiceProvider* audio_renderer_provider); | 39 mojo::ServiceProvider* audio_renderer_provider); |
43 virtual ~MojoRendererImpl(); | 40 virtual ~MojoRendererImpl(); |
44 | 41 |
45 // Renderer implementation. | 42 // Renderer implementation. |
46 virtual void Initialize(const base::Closure& init_cb, | 43 virtual void Initialize(DemuxerStreamProvider* demuxer_stream_provider, |
| 44 const base::Closure& init_cb, |
47 const StatisticsCB& statistics_cb, | 45 const StatisticsCB& statistics_cb, |
48 const base::Closure& ended_cb, | 46 const base::Closure& ended_cb, |
49 const PipelineStatusCB& error_cb, | 47 const PipelineStatusCB& error_cb, |
50 const BufferingStateCB& buffering_state_cb) override; | 48 const BufferingStateCB& buffering_state_cb) override; |
51 virtual void Flush(const base::Closure& flush_cb) override; | 49 virtual void Flush(const base::Closure& flush_cb) override; |
52 virtual void StartPlayingFrom(base::TimeDelta time) override; | 50 virtual void StartPlayingFrom(base::TimeDelta time) override; |
53 virtual void SetPlaybackRate(float playback_rate) override; | 51 virtual void SetPlaybackRate(float playback_rate) override; |
54 virtual void SetVolume(float volume) override; | 52 virtual void SetVolume(float volume) override; |
55 virtual base::TimeDelta GetMediaTime() override; | 53 virtual base::TimeDelta GetMediaTime() override; |
56 virtual bool HasAudio() override; | 54 virtual bool HasAudio() override; |
(...skipping 24 matching lines...) Expand all Loading... |
81 PipelineStatusCB error_cb_; | 79 PipelineStatusCB error_cb_; |
82 BufferingStateCB buffering_state_cb_; | 80 BufferingStateCB buffering_state_cb_; |
83 | 81 |
84 base::WeakPtrFactory<MojoRendererImpl> weak_factory_; | 82 base::WeakPtrFactory<MojoRendererImpl> weak_factory_; |
85 DISALLOW_COPY_AND_ASSIGN(MojoRendererImpl); | 83 DISALLOW_COPY_AND_ASSIGN(MojoRendererImpl); |
86 }; | 84 }; |
87 | 85 |
88 } // namespace media | 86 } // namespace media |
89 | 87 |
90 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ | 88 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ |
OLD | NEW |