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

Unified Diff: media/renderers/renderer_impl.h

Issue 2684103005: Allow media track switching. (Closed)
Patch Set: CR feedback Created 3 years, 9 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
Index: media/renderers/renderer_impl.h
diff --git a/media/renderers/renderer_impl.h b/media/renderers/renderer_impl.h
index f55a7635e22707644c5b818813542d23a49544c0..4206a90311498c1e2b43e31967589264c1d3d3f9 100644
--- a/media/renderers/renderer_impl.h
+++ b/media/renderers/renderer_impl.h
@@ -106,8 +106,29 @@ class MEDIA_EXPORT RendererImpl : public Renderer {
void FlushVideoRenderer();
void OnVideoRendererFlushDone();
- void RestartAudioRenderer(base::TimeDelta time);
- void RestartVideoRenderer(base::TimeDelta time);
+ // Reinitialize audio/video renderer during a media track switching. The
+ // renderer must be flushed first, and when the re-init is completed the
+ // corresponding callback will be invoked to restart playback.
+ // The |stream| parameter specifies the demuxer stream representing the new
+ // media track. And the |time| parameter specifies the time on media timeline
+ // where the switch occured.
xhwang 2017/03/29 00:16:47 nit: At this level, we are dealing with DemuxerStr
servolk 2017/03/29 01:49:33 Done.
+ void ReinitializeAudioRenderer(DemuxerStream* stream, base::TimeDelta time);
+ void OnAudioRendererReinitialized(DemuxerStream* stream,
+ base::TimeDelta time,
+ PipelineStatus status);
+ void ReinitializeVideoRenderer(DemuxerStream* stream, base::TimeDelta time);
+ void OnVideoRendererReinitialized(DemuxerStream* stream,
+ base::TimeDelta time,
+ PipelineStatus status);
+
+ // Restart audio/video renderer playback after a media track switch or after a
+ // media track has been disabled and re-enabled. The |stream| parameter
xhwang 2017/03/29 00:16:47 ditto about "media track"
servolk 2017/03/29 01:49:33 Done.
+ // specifies which stream needs to be restarted. The |time| parameter
+ // specifies the position on the media timeline where the playback needs to be
+ // restarted. It is necessary for demuxers with independent streams (e.g. MSE
+ // / ChunkDemuxer) to synchronize data reading between those streams.
+ void RestartAudioRenderer(DemuxerStream* stream, base::TimeDelta time);
+ void RestartVideoRenderer(DemuxerStream* stream, base::TimeDelta time);
// Callback executed by filters to update statistics.
void OnStatisticsUpdate(const PipelineStatistics& stats);
@@ -166,6 +187,9 @@ class MEDIA_EXPORT RendererImpl : public Renderer {
std::unique_ptr<AudioRenderer> audio_renderer_;
std::unique_ptr<VideoRenderer> video_renderer_;
+ DemuxerStream* current_audio_stream_;
+ DemuxerStream* current_video_stream_;
+
// Renderer-provided time source used to control playback.
TimeSource* time_source_;
std::unique_ptr<WallClockTimeSource> wall_clock_time_source_;

Powered by Google App Engine
This is Rietveld 408576698