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

Unified Diff: media/filters/media_source_state.h

Issue 1727243002: Unify media track info reporting on a demuxer level (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tracks-impl-in-media
Patch Set: rebase Created 4 years, 10 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/filters/media_source_state.h
diff --git a/media/filters/media_source_state.h b/media/filters/media_source_state.h
index 1197015e2587111b40e55268e9d4c928dcebb260..e6878f6071ce9efe5ac11232970f01395d60a43a 100644
--- a/media/filters/media_source_state.h
+++ b/media/filters/media_source_state.h
@@ -28,8 +28,6 @@ class MEDIA_EXPORT MediaSourceState {
typedef base::Callback<ChunkDemuxerStream*(DemuxerStream::Type)>
CreateDemuxerStreamCB;
- typedef base::Callback<void(const MediaTracks&)> InitSegmentReceivedCB;
-
typedef base::Callback<void(ChunkDemuxerStream*, const TextTrackConfig&)>
NewTextTrackCB;
@@ -52,14 +50,12 @@ class MEDIA_EXPORT MediaSourceState {
// error occurred. |*timestamp_offset| is used and possibly updated by the
// append. |append_window_start| and |append_window_end| correspond to the MSE
// spec's similarly named source buffer attributes that are used in coded
- // frame processing. |init_segment_received_cb| is run for each new fully
- // parsed initialization segment.
+ // frame processing.
bool Append(const uint8_t* data,
size_t length,
TimeDelta append_window_start,
TimeDelta append_window_end,
- TimeDelta* timestamp_offset,
- const InitSegmentReceivedCB& init_segment_received_cb);
+ TimeDelta* timestamp_offset);
// Aborts the current append sequence and resets the parser.
void ResetParserState(TimeDelta append_window_start,
@@ -117,6 +113,8 @@ class MEDIA_EXPORT MediaSourceState {
const RangesList& activeRanges,
bool ended);
+ void SetTracksWatcher(const Demuxer::MediaTracksUpdatedCB& tracks_updated_cb);
wolenetz 2016/03/05 01:47:43 nit: document what this means; when it should be c
servolk 2016/03/05 01:56:19 Will do, but at this point there are three other C
+
private:
// Called by the |stream_parser_| when a new initialization segment is
// encountered.
@@ -195,11 +193,13 @@ class MEDIA_EXPORT MediaSourceState {
StreamParser::InitCB init_cb_;
// During Append(), OnNewConfigs() will trigger the initialization segment
- // received algorithm. This callback is only non-NULL during the lifetime of
- // an Append() call. Note, the MSE spec explicitly disallows this algorithm
+ // received algorithm. Note, the MSE spec explicitly disallows this algorithm
// during an Abort(), since Abort() is allowed only to emit coded frames, and
- // only if the parser is PARSING_MEDIA_SEGMENT (not an INIT segment).
- InitSegmentReceivedCB init_segment_received_cb_;
+ // only if the parser is PARSING_MEDIA_SEGMENT (not an INIT segment). So we
+ // also have a flag here that indicates if Append is in progress and we can
+ // invoke this callback.
+ Demuxer::MediaTracksUpdatedCB init_segment_received_cb_;
+ bool append_in_progress_ = false;
wolenetz 2016/03/05 01:47:43 this flag and associated comment and usage seem un
servolk 2016/03/05 01:56:19 Done.
// Indicates that timestampOffset should be updated automatically during
// OnNewBuffers() based on the earliest end timestamp of the buffers provided.

Powered by Google App Engine
This is Rietveld 408576698