| Index: media/filters/media_source_state.h
|
| diff --git a/media/filters/media_source_state.h b/media/filters/media_source_state.h
|
| index 1a8e42adb409f36dc86095b39794d4c96a730ded..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::Closure 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);
|
| +
|
| private:
|
| // Called by the |stream_parser_| when a new initialization segment is
|
| // encountered.
|
| @@ -124,8 +122,7 @@ class MEDIA_EXPORT MediaSourceState {
|
| // processing decoder configurations.
|
| bool OnNewConfigs(bool allow_audio,
|
| bool allow_video,
|
| - const AudioDecoderConfig& audio_config,
|
| - const VideoDecoderConfig& video_config,
|
| + scoped_ptr<MediaTracks> tracks,
|
| const StreamParser::TextTrackConfigMap& text_configs);
|
|
|
| // Called by the |stream_parser_| at the beginning of a new media segment.
|
| @@ -183,6 +180,8 @@ class MEDIA_EXPORT MediaSourceState {
|
| // The object used to parse appended data.
|
| scoped_ptr<StreamParser> stream_parser_;
|
|
|
| + scoped_ptr<MediaTracks> media_tracks_;
|
| +
|
| ChunkDemuxerStream* audio_; // Not owned by |this|.
|
| ChunkDemuxerStream* video_; // Not owned by |this|.
|
|
|
| @@ -194,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;
|
|
|
| // Indicates that timestampOffset should be updated automatically during
|
| // OnNewBuffers() based on the earliest end timestamp of the buffers provided.
|
|
|