Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1006)

Unified Diff: media/renderers/video_renderer_impl.h

Issue 1955843002: Move Renderer permanent callbacks into RendererClient interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/renderers/renderer_impl_unittest.cc ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/video_renderer_impl.h
diff --git a/media/renderers/video_renderer_impl.h b/media/renderers/video_renderer_impl.h
index 3e2440bb6ddeaaf7cba915d1556e25ab9f7254c7..6a58949db8a31b309b7216f0529c601cc1014ee7 100644
--- a/media/renderers/video_renderer_impl.h
+++ b/media/renderers/video_renderer_impl.h
@@ -64,14 +64,10 @@ class MEDIA_EXPORT VideoRendererImpl
// VideoRenderer implementation.
void Initialize(DemuxerStream* stream,
- const PipelineStatusCB& init_cb,
CdmContext* cdm_context,
- const StatisticsCB& statistics_cb,
- const BufferingStateCB& buffering_state_cb,
- const base::Closure& ended_cb,
- const PipelineStatusCB& error_cb,
+ RendererClient* client,
const TimeSource::WallClockTimeCB& wall_clock_time_cb,
- const base::Closure& waiting_for_decryption_key_cb) override;
+ const PipelineStatusCB& init_cb) override;
void Flush(const base::Closure& callback) override;
void StartPlayingFrom(base::TimeDelta timestamp) override;
void OnTimeStateChanged(bool time_progressing) override;
@@ -93,6 +89,13 @@ class MEDIA_EXPORT VideoRendererImpl
// Callback for |video_frame_stream_| initialization.
void OnVideoFrameStreamInitialized(bool success);
+ // Functions to notify certain events to the RendererClient.
+ void OnPlaybackError(PipelineStatus error);
+ void OnPlaybackEnded();
+ void OnStatisticsUpdate(const PipelineStatistics& stats);
+ void OnBufferingStateChange(BufferingState state);
+ void OnWaitingForDecryptionKey();
+
// Callback for |video_frame_stream_| to deliver decoded video frames and
// report video decoding status. If a frame is available the planes will be
// copied asynchronously and FrameReady will be called once finished copying.
@@ -187,6 +190,8 @@ class MEDIA_EXPORT VideoRendererImpl
// Used for accessing data members.
base::Lock lock_;
+ RendererClient* client_;
+
// Provides video frames to VideoRendererImpl.
std::unique_ptr<VideoFrameStream> video_frame_stream_;
@@ -244,14 +249,8 @@ class MEDIA_EXPORT VideoRendererImpl
BufferingState buffering_state_;
// Playback operation callbacks.
- base::Closure flush_cb_;
-
- // Event callbacks.
PipelineStatusCB init_cb_;
- StatisticsCB statistics_cb_;
- BufferingStateCB buffering_state_cb_;
- base::Closure ended_cb_;
- PipelineStatusCB error_cb_;
+ base::Closure flush_cb_;
TimeSource::WallClockTimeCB wall_clock_time_cb_;
base::TimeDelta start_timestamp_;
« no previous file with comments | « media/renderers/renderer_impl_unittest.cc ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698