diff options
author | matthewjheaney@chromium.org <matthewjheaney@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 01:19:31 +0000 |
---|---|---|
committer | matthewjheaney@chromium.org <matthewjheaney@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 01:19:31 +0000 |
commit | 8a5610641873c139760a68ab3bd05e20e62df3ae (patch) | |
tree | 793df094179d5c9db661876e62a17cd9ca0e750b /media/base/pipeline.h | |
parent | 49728365a1847baa284259504aaade201bfdccb7 (diff) | |
download | chromium_src-8a5610641873c139760a68ab3bd05e20e62df3ae.zip chromium_src-8a5610641873c139760a68ab3bd05e20e62df3ae.tar.gz chromium_src-8a5610641873c139760a68ab3bd05e20e62df3ae.tar.bz2 |
Render inband text tracks in the media pipeline
This change modifies the FFmpeg demuxer to recognize text
streams embedded in the source media (Webm). Text decoder
and text renderer filters have been added to the pipeline,
to process the text frames as they are pulled downstream.
BUG=230708
Review URL: https://codereview.chromium.org/23702007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236660 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline.h')
-rw-r--r-- | media/base/pipeline.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/media/base/pipeline.h b/media/base/pipeline.h index 09ff904..222091f 100644 --- a/media/base/pipeline.h +++ b/media/base/pipeline.h @@ -30,6 +30,8 @@ namespace media { class Clock; class FilterCollection; class MediaLog; +class TextRenderer; +class TextTrackConfig; class VideoRenderer; // Pipeline runs the media pipeline. Filters are created and called on the @@ -232,6 +234,9 @@ class MEDIA_EXPORT Pipeline : public DemuxerHost { // DemuxerHost implementaion. virtual void SetDuration(base::TimeDelta duration) OVERRIDE; virtual void OnDemuxerError(PipelineStatus error) OVERRIDE; + virtual void AddTextStream(DemuxerStream* text_stream, + const TextTrackConfig& config) OVERRIDE; + virtual void RemoveTextStream(DemuxerStream* text_stream) OVERRIDE; // Initiates teardown sequence in response to a runtime error. // @@ -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,14 +289,22 @@ 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. void AudioDisabledTask(); + // Carries out adding a new text stream to the text renderer. + void AddTextStreamTask(DemuxerStream* text_stream, + const TextTrackConfig& config); + + // Carries out removing a text stream from the text renderer. + void RemoveTextStreamTask(DemuxerStream* text_stream); + // Kicks off initialization for each media object, executing |done_cb| with // the result when completed. void InitializeDemuxer(const PipelineStatusCB& done_cb); @@ -392,7 +406,7 @@ 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 or video streams. // TODO(fischman,scherkus): replace these with checks for // {audio,video}_decoder_ once extraction of {Audio,Video}Decoder from the // Filter heirarchy is done. @@ -405,9 +419,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 +449,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_; |