summaryrefslogtreecommitdiff
path: root/chromium/media/base/renderer.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/base/renderer.h')
-rw-r--r--chromium/media/base/renderer.h43
1 files changed, 27 insertions, 16 deletions
diff --git a/chromium/media/base/renderer.h b/chromium/media/base/renderer.h
index 78ae043ee30..75372fba3a1 100644
--- a/chromium/media/base/renderer.h
+++ b/chromium/media/base/renderer.h
@@ -6,18 +6,21 @@
#define MEDIA_BASE_RENDERER_H_
#include "base/callback.h"
+#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "media/base/buffering_state.h"
+#include "media/base/cdm_context.h"
#include "media/base/media_export.h"
#include "media/base/pipeline_status.h"
namespace media {
-class MediaKeys;
class DemuxerStreamProvider;
+class VideoFrame;
class MEDIA_EXPORT Renderer {
public:
+ typedef base::Callback<void(const scoped_refptr<VideoFrame>&)> PaintCB;
typedef base::Callback<base::TimeDelta()> TimeDeltaCB;
Renderer();
@@ -26,21 +29,32 @@ class MEDIA_EXPORT Renderer {
virtual ~Renderer();
// Initializes the Renderer with |demuxer_stream_provider|, executing
- // |init_cb| upon completion. If initialization failed, fires |error_cb|
- // before |init_cb|. |demuxer_stream_provider| must be valid throughout the
- // lifetime of the Renderer object.
+ // |init_cb| upon completion. If initialization fails, only |init_cb| (not
+ // |error_cb|) should be called. |demuxer_stream_provider| must be valid for
+ // the lifetime of the Renderer object. |init_cb| must only be run after this
+ // method has returned. Firing |init_cb| may result in the immediate
+ // destruction of the caller, so it must be run only prior to returning.
//
// Permanent callbacks:
// - |statistics_cb|: Executed periodically with rendering statistics.
- // - |time_cb|: Executed whenever time has advanced through rendering.
+ // - |buffering_state_cb|: Executed when buffering state is changed.
// - |ended_cb|: Executed when rendering has reached the end of stream.
- // - |error_cb|: Executed if any error was encountered during rendering.
- virtual void Initialize(DemuxerStreamProvider* demuxer_stream_provider,
- const base::Closure& init_cb,
- const StatisticsCB& statistics_cb,
- const base::Closure& ended_cb,
- const PipelineStatusCB& error_cb,
- const BufferingStateCB& buffering_state_cb) = 0;
+ // - |error_cb|: Executed if any error was encountered after initialization.
+ // - |waiting_for_decryption_key_cb|: Executed whenever the key needed to
+ // decrypt the stream is not available.
+ virtual void Initialize(
+ DemuxerStreamProvider* demuxer_stream_provider,
+ const PipelineStatusCB& init_cb,
+ const StatisticsCB& statistics_cb,
+ const BufferingStateCB& buffering_state_cb,
+ const base::Closure& ended_cb,
+ const PipelineStatusCB& error_cb,
+ const base::Closure& waiting_for_decryption_key_cb) = 0;
+
+ // Associates the |cdm_context| with this Renderer for decryption (and
+ // decoding) of media data, then fires |cdm_attached_cb| with the result.
+ virtual void SetCdm(CdmContext* cdm_context,
+ const CdmAttachedCB& cdm_attached_cb) = 0;
// The following functions must be called after Initialize().
@@ -51,7 +65,7 @@ class MEDIA_EXPORT Renderer {
virtual void StartPlayingFrom(base::TimeDelta time) = 0;
// Updates the current playback rate. The default playback rate should be 1.
- virtual void SetPlaybackRate(float playback_rate) = 0;
+ virtual void SetPlaybackRate(double playback_rate) = 0;
// Sets the output volume. The default volume should be 1.
virtual void SetVolume(float volume) = 0;
@@ -65,9 +79,6 @@ class MEDIA_EXPORT Renderer {
// Returns whether |this| renders video.
virtual bool HasVideo() = 0;
- // Associates the |cdm| with this Renderer.
- virtual void SetCdm(MediaKeys* cdm) = 0;
-
private:
DISALLOW_COPY_AND_ASSIGN(Renderer);
};