summaryrefslogtreecommitdiffstats
path: root/media/base/stream_parser.h
diff options
context:
space:
mode:
authormatthewjheaney@chromium.org <matthewjheaney@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 01:19:31 +0000
committermatthewjheaney@chromium.org <matthewjheaney@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 01:19:31 +0000
commit8a5610641873c139760a68ab3bd05e20e62df3ae (patch)
tree793df094179d5c9db661876e62a17cd9ca0e750b /media/base/stream_parser.h
parent49728365a1847baa284259504aaade201bfdccb7 (diff)
downloadchromium_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/stream_parser.h')
-rw-r--r--media/base/stream_parser.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/media/base/stream_parser.h b/media/base/stream_parser.h
index 33a336d..101ce4e 100644
--- a/media/base/stream_parser.h
+++ b/media/base/stream_parser.h
@@ -6,6 +6,7 @@
#define MEDIA_BASE_STREAM_PARSER_H_
#include <deque>
+#include <map>
#include <string>
#include "base/callback_forward.h"
@@ -14,18 +15,19 @@
#include "base/time/time.h"
#include "media/base/media_export.h"
#include "media/base/media_log.h"
-#include "media/base/text_track.h"
namespace media {
class AudioDecoderConfig;
class StreamParserBuffer;
+class TextTrackConfig;
class VideoDecoderConfig;
// Abstract interface for parsing media byte streams.
class MEDIA_EXPORT StreamParser {
public:
typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue;
+ typedef std::map<int, TextTrackConfig> TextTrackConfigMap;
StreamParser();
virtual ~StreamParser();
@@ -43,11 +45,14 @@ class MEDIA_EXPORT StreamParser {
// then it means that there isn't an audio stream.
// Second parameter - The new video configuration. If the config is not valid
// then it means that there isn't an audio stream.
+ // Third parameter - The new text tracks configuration. If the map is empty,
+ // then no text tracks were parsed from the stream.
// Return value - True if the new configurations are accepted.
// False if the new configurations are not supported
// and indicates that a parsing error should be signalled.
typedef base::Callback<bool(const AudioDecoderConfig&,
- const VideoDecoderConfig&)> NewConfigCB;
+ const VideoDecoderConfig&,
+ const TextTrackConfigMap&)> NewConfigCB;
// New stream buffers have been parsed.
// First parameter - A queue of newly parsed audio buffers.
@@ -59,12 +64,13 @@ class MEDIA_EXPORT StreamParser {
const BufferQueue&)> NewBuffersCB;
// New stream buffers of inband text have been parsed.
- // First parameter - The text track to which these cues will be added.
+ // First parameter - The id of the text track to which these cues will
+ // be added.
// Second parameter - A queue of newly parsed buffers.
// Return value - True indicates that the buffers are accepted.
// False if something was wrong with the buffers and a parsing
// error should be signalled.
- typedef base::Callback<bool(TextTrack*, const BufferQueue&)> NewTextBuffersCB;
+ typedef base::Callback<bool(int, const BufferQueue&)> NewTextBuffersCB;
// Signals the beginning of a new media segment.
typedef base::Callback<void()> NewMediaSegmentCB;
@@ -85,7 +91,6 @@ class MEDIA_EXPORT StreamParser {
const NewBuffersCB& new_buffers_cb,
const NewTextBuffersCB& text_cb,
const NeedKeyCB& need_key_cb,
- const AddTextTrackCB& add_text_track_cb,
const NewMediaSegmentCB& new_segment_cb,
const base::Closure& end_of_segment_cb,
const LogCB& log_cb) = 0;