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

Unified Diff: media/base/stream_parser.h

Issue 23702007: Render inband text tracks in the media pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: incorporate aaron's comments (10/12) Created 7 years, 2 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/stream_parser.h
diff --git a/media/base/stream_parser.h b/media/base/stream_parser.h
index 33a336def8bc4e418750fc5f472856469b54dece..806d959babf101360ba651330b55d900237d654a 100644
--- a/media/base/stream_parser.h
+++ b/media/base/stream_parser.h
@@ -59,12 +59,14 @@ 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 (number 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 track_number,
+ const BufferQueue&)> NewTextBuffersCB;
// Signals the beginning of a new media segment.
typedef base::Callback<void()> NewMediaSegmentCB;
@@ -76,6 +78,16 @@ class MEDIA_EXPORT StreamParser {
typedef base::Callback<void(const std::string&,
const std::vector<uint8>&)> NeedKeyCB;
+ // New text track has been parsed.
+ // First parameter - The track number (from the Track element).
+ // Second parameter - The track kind (inferred from the CodecID).
+ // Third parameter - The track name sub-element value.
+ // Fourth parameter - The track language sub-element value.
+ typedef base::Callback<void(int track_number,
+ TextKind kind,
+ const std::string& name,
+ const std::string& language)> NewTextTrackCB;
+
// Initialize 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
@@ -85,7 +97,7 @@ 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 NewTextTrackCB& new_text_track_cb,
const NewMediaSegmentCB& new_segment_cb,
const base::Closure& end_of_segment_cb,
const LogCB& log_cb) = 0;

Powered by Google App Engine
This is Rietveld 408576698