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

Unified Diff: media/base/stream_parser.h

Issue 143973009: SourceState: Coalesce OnNewBuffers() CB to include OnTextBuffers() behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address PS2 comments Created 6 years, 11 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 | « no previous file | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/stream_parser.h
diff --git a/media/base/stream_parser.h b/media/base/stream_parser.h
index 101ce4eee0e0c1d6d66f495730fde2badde3c940..39dbc34f928b6b321d533065b912472d08616dd0 100644
--- a/media/base/stream_parser.h
+++ b/media/base/stream_parser.h
@@ -27,8 +27,13 @@ class VideoDecoderConfig;
class MEDIA_EXPORT StreamParser {
public:
typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue;
+
+ // Map of text track number to the track configuration.
typedef std::map<int, TextTrackConfig> TextTrackConfigMap;
+ // Map of text track number to decode-timestamp-ordered buffers for the track.
+ typedef std::map<int, const BufferQueue> TextBufferQueueMap;
+
StreamParser();
virtual ~StreamParser();
@@ -57,20 +62,16 @@ class MEDIA_EXPORT StreamParser {
// New stream buffers have been parsed.
// First parameter - A queue of newly parsed audio buffers.
// Second parameter - A queue of newly parsed video buffers.
+ // Third parameter - A map of text track ids to queues of newly parsed inband
+ // text buffers. If the map is not empty, it must contain
+ // at least one track with a non-empty queue of text
+ // 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(const BufferQueue&,
- const BufferQueue&)> NewBuffersCB;
-
- // New stream buffers of inband text have been parsed.
- // 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(int, const BufferQueue&)> NewTextBuffersCB;
+ const BufferQueue&,
+ const TextBufferQueueMap&)> NewBuffersCB;
// Signals the beginning of a new media segment.
typedef base::Callback<void()> NewMediaSegmentCB;
@@ -82,14 +83,15 @@ class MEDIA_EXPORT StreamParser {
typedef base::Callback<void(const std::string&,
const std::vector<uint8>&)> NeedKeyCB;
- // Initialize the parser with necessary callbacks. Must be called before any
+ // Initializes the parser with necessary callbacks. Must be called before any
// data is passed to Parse(). |init_cb| will be called once enough data has
// been parsed to determine the initial stream configurations, presentation
- // start time, and duration.
+ // start time, and duration. If |ignore_text_track| is true, then no text
+ // buffers should be passed later by the parser to |new_buffers_cb|.
virtual void Init(const InitCB& init_cb,
const NewConfigCB& config_cb,
const NewBuffersCB& new_buffers_cb,
- const NewTextBuffersCB& text_cb,
+ bool ignore_text_track,
const NeedKeyCB& need_key_cb,
const NewMediaSegmentCB& new_segment_cb,
const base::Closure& end_of_segment_cb,
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698