Chromium Code Reviews| Index: media/mojo/services/mojo_renderer_client_impl.h |
| diff --git a/media/mojo/services/mojo_renderer_client_impl.h b/media/mojo/services/mojo_renderer_client_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..56261a53473c8ec2abc0d1fae78bfa20753e5866 |
| --- /dev/null |
| +++ b/media/mojo/services/mojo_renderer_client_impl.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ |
| +#define MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ |
| + |
| +#include "base/macros.h" |
| +#include "media/base/renderer.h" |
| +#include "media/mojo/interfaces/media_renderer.mojom.h" |
| +#include "mojo/public/interfaces/application/service_provider.mojom.h" |
| + |
| +namespace media { |
| + |
| +// A media::Renderer that proxies to a mojo::MediaRenderer. |
| +class MojoRendererClientImpl : public Renderer, |
|
xhwang
2014/09/02 17:05:52
From media pipeline's perspective, this is a mojo
tim (not reviewing)
2014/09/02 18:20:05
Yeah, I had it named that way before... I think th
|
| + public mojo::MediaRendererClient { |
| + public: |
| + // |media_renderer_provider| is the ServiceProvider for an Application |
| + // that is hosting a mojo::MediaRenderer. |
| + explicit MojoRendererClientImpl( |
| + mojo::ServiceProvider* media_renderer_provider); |
|
xhwang
2014/09/02 17:05:53
This can also take a DemuxerStreamProvider* demuxe
tim (not reviewing)
2014/09/02 18:20:05
cool!
|
| + virtual ~MojoRendererClientImpl(); |
| + |
| + // Renderer implementation. |
| + virtual void Initialize(const PipelineStatusCB& init_cb, |
| + const StatisticsCB& statistics_cb, |
| + const base::Closure& ended_cb, |
| + const PipelineStatusCB& error_cb, |
| + const BufferingStateCB& buffering_state_cb, |
| + const TimeDeltaCB& get_duration_cb) OVERRIDE; |
| + virtual void Flush(const base::Closure& flush_cb) OVERRIDE; |
| + virtual void StartPlayingFrom(base::TimeDelta time) OVERRIDE; |
| + virtual void SetPlaybackRate(float playback_rate) OVERRIDE; |
| + virtual void SetVolume(float volume) OVERRIDE; |
| + virtual base::TimeDelta GetMediaTime() OVERRIDE; |
| + virtual bool HasAudio() OVERRIDE; |
| + virtual bool HasVideo() OVERRIDE; |
| + virtual void SetCdm(MediaKeys* cdm) OVERRIDE; |
| + |
| + // mojo::MediaRendererClient implementation. |
| + virtual void OnTimeUpdate(int64_t time_delta_usec) MOJO_OVERRIDE; |
| + virtual void OnBufferingStateChange( |
| + mojo::BufferingState state) MOJO_OVERRIDE; |
| + virtual void OnEnded() MOJO_OVERRIDE; |
| + virtual void OnError() MOJO_OVERRIDE; |
| + |
| + private: |
| + mojo::MediaRendererPtr remote_renderer_; |
| + DISALLOW_COPY_AND_ASSIGN(MojoRendererClientImpl); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_IMPL_H_ |