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

Unified Diff: media/base/pipeline.h

Issue 23702007: Render inband text tracks in the media pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 4 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/base/pipeline.h
diff --git a/media/base/pipeline.h b/media/base/pipeline.h
index 09ff90416390fc8a3cc5d1f5071ee515df939c58..843c15ee4eb01721bcc669d50f680caf2c1bee14 100644
--- a/media/base/pipeline.h
+++ b/media/base/pipeline.h
@@ -30,6 +30,7 @@ namespace media {
class Clock;
class FilterCollection;
class MediaLog;
+class TextRenderer;
class VideoRenderer;
// Pipeline runs the media pipeline. Filters are created and called on the
@@ -138,6 +139,9 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
// Returns true if the media has video.
bool HasVideo() const;
+ // Returns true if the media has text.
+ bool HasText() const;
acolwell GONE FROM CHROMIUM 2013/09/12 00:15:15 nit: This only appears to be used by test code. Do
Matthew Heaney (Chromium) 2013/09/13 19:51:54 I don't think so. We can replace it with some alt
Matthew Heaney (Chromium) 2013/09/20 23:53:54 I finally removed it.
+
// Gets the current playback rate of the pipeline. When the pipeline is
// started, the playback rate will be 0.0f. A rate of 1.0f indicates
// that the pipeline is rendering the media at the standard rate. Valid
@@ -205,6 +209,7 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
kInitDemuxer,
kInitAudioRenderer,
kInitVideoRenderer,
+ kInitTextRenderer,
kInitPrerolling,
kSeeking,
kStarting,
@@ -244,6 +249,7 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
// Callbacks executed when a renderer has ended.
void OnAudioRendererEnded();
void OnVideoRendererEnded();
+ void OnTextRendererEnded();
// Callback executed by filters to update statistics.
void OnUpdateStatistics(const PipelineStatistics& stats);
@@ -283,9 +289,10 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
// Carries out notifying filters that we are seeking to a new timestamp.
void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb);
- // Handles audio/video ended logic and running |ended_cb_|.
+ // Handles audio/video/text ended logic and running |ended_cb_|.
void DoAudioRendererEnded();
void DoVideoRendererEnded();
+ void DoTextRendererEnded();
void RunEndedCallbackIfNeeded();
// Carries out disabling the audio renderer.
@@ -296,6 +303,7 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
void InitializeDemuxer(const PipelineStatusCB& done_cb);
void InitializeAudioRenderer(const PipelineStatusCB& done_cb);
void InitializeVideoRenderer(const PipelineStatusCB& done_cb);
+ void InitializeTextRenderer(const PipelineStatusCB& done_cb);
// Kicks off destroying filters. Called by StopTask() and ErrorChangedTask().
// When we start to tear down the pipeline, we will consider two cases:
@@ -392,12 +400,13 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
// reset the pipeline state, and restore this to PIPELINE_OK.
PipelineStatus status_;
- // Whether the media contains rendered audio and video streams.
+ // Whether the media contains rendered audio, video, and text streams.
// TODO(fischman,scherkus): replace these with checks for
// {audio,video}_decoder_ once extraction of {Audio,Video}Decoder from the
// Filter heirarchy is done.
bool has_audio_;
bool has_video_;
+ bool has_text_;
// The following data members are only accessed by tasks posted to
// |message_loop_|.
@@ -405,9 +414,10 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
// Member that tracks the current state.
State state_;
- // Whether we've received the audio/video ended events.
+ // Whether we've received the audio/video/text ended events.
bool audio_ended_;
bool video_ended_;
+ bool text_ended_;
// Set to true in DisableAudioRendererTask().
bool audio_disabled_;
@@ -434,6 +444,7 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost {
// playback rate, and determining when playback has finished.
scoped_ptr<AudioRenderer> audio_renderer_;
scoped_ptr<VideoRenderer> video_renderer_;
+ scoped_ptr<TextRenderer> text_renderer_;
PipelineStatistics statistics_;

Powered by Google App Engine
This is Rietveld 408576698