| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_FILTERS_MEDIA_SOURCE_STATE_H_ | 5 #ifndef MEDIA_FILTERS_MEDIA_SOURCE_STATE_H_ |
| 6 #define MEDIA_FILTERS_MEDIA_SOURCE_STATE_H_ | 6 #define MEDIA_FILTERS_MEDIA_SOURCE_STATE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "media/base/demuxer_stream.h" | 12 #include "media/base/demuxer_stream.h" |
| 13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
| 14 #include "media/base/stream_parser.h" | 14 #include "media/base/stream_parser.h" |
| 15 #include "media/base/stream_parser_buffer.h" | 15 #include "media/base/stream_parser_buffer.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 using base::TimeDelta; | 19 using base::TimeDelta; |
| 20 | 20 |
| 21 class ChunkDemuxerStream; | 21 class ChunkDemuxerStream; |
| 22 class FrameProcessor; | 22 class FrameProcessor; |
| 23 class MediaTrack; |
| 23 | 24 |
| 24 // Contains state belonging to a source id. | 25 // Contains state belonging to a source id. |
| 25 class MEDIA_EXPORT MediaSourceState { | 26 class MEDIA_EXPORT MediaSourceState { |
| 26 public: | 27 public: |
| 27 // Callback signature used to create ChunkDemuxerStreams. | 28 // Callback signature used to create ChunkDemuxerStreams. |
| 28 typedef base::Callback<ChunkDemuxerStream*(DemuxerStream::Type)> | 29 typedef base::Callback<ChunkDemuxerStream*(const MediaTrack&)> |
| 29 CreateDemuxerStreamCB; | 30 CreateDemuxerStreamCB; |
| 30 | 31 |
| 31 typedef base::Callback<void(ChunkDemuxerStream*, const TextTrackConfig&)> | 32 typedef base::Callback<void(ChunkDemuxerStream*, const TextTrackConfig&)> |
| 32 NewTextTrackCB; | 33 NewTextTrackCB; |
| 33 | 34 |
| 34 MediaSourceState(scoped_ptr<StreamParser> stream_parser, | 35 MediaSourceState(scoped_ptr<StreamParser> stream_parser, |
| 35 scoped_ptr<FrameProcessor> frame_processor, | 36 scoped_ptr<FrameProcessor> frame_processor, |
| 36 const CreateDemuxerStreamCB& create_demuxer_stream_cb, | 37 const CreateDemuxerStreamCB& create_demuxer_stream_cb, |
| 37 const scoped_refptr<MediaLog>& media_log); | 38 const scoped_refptr<MediaLog>& media_log); |
| 38 | 39 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 184 |
| 184 // Valid only while |parsing_media_segment_| is true. These flags enable | 185 // Valid only while |parsing_media_segment_| is true. These flags enable |
| 185 // warning when at least one frame for each A/V track is not in a parsed media | 186 // warning when at least one frame for each A/V track is not in a parsed media |
| 186 // segment. | 187 // segment. |
| 187 bool media_segment_contained_audio_frame_; | 188 bool media_segment_contained_audio_frame_; |
| 188 bool media_segment_contained_video_frame_; | 189 bool media_segment_contained_video_frame_; |
| 189 | 190 |
| 190 // The object used to parse appended data. | 191 // The object used to parse appended data. |
| 191 scoped_ptr<StreamParser> stream_parser_; | 192 scoped_ptr<StreamParser> stream_parser_; |
| 192 | 193 |
| 193 scoped_ptr<MediaTracks> media_tracks_; | |
| 194 | |
| 195 ChunkDemuxerStream* audio_; // Not owned by |this|. | 194 ChunkDemuxerStream* audio_; // Not owned by |this|. |
| 196 ChunkDemuxerStream* video_; // Not owned by |this|. | 195 ChunkDemuxerStream* video_; // Not owned by |this|. |
| 197 | 196 |
| 198 typedef std::map<StreamParser::TrackId, ChunkDemuxerStream*> TextStreamMap; | 197 typedef std::map<StreamParser::TrackId, ChunkDemuxerStream*> TextStreamMap; |
| 199 TextStreamMap text_stream_map_; // |this| owns the map's stream pointers. | 198 TextStreamMap text_stream_map_; // |this| owns the map's stream pointers. |
| 200 | 199 |
| 201 scoped_ptr<FrameProcessor> frame_processor_; | 200 scoped_ptr<FrameProcessor> frame_processor_; |
| 202 scoped_refptr<MediaLog> media_log_; | 201 scoped_refptr<MediaLog> media_log_; |
| 203 StreamParser::InitCB init_cb_; | 202 StreamParser::InitCB init_cb_; |
| 204 | 203 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 218 // TODO(wolenetz): Refactor this function while integrating April 29, 2014 | 217 // TODO(wolenetz): Refactor this function while integrating April 29, 2014 |
| 219 // changes to MSE spec. See http://crbug.com/371499. | 218 // changes to MSE spec. See http://crbug.com/371499. |
| 220 bool auto_update_timestamp_offset_; | 219 bool auto_update_timestamp_offset_; |
| 221 | 220 |
| 222 DISALLOW_COPY_AND_ASSIGN(MediaSourceState); | 221 DISALLOW_COPY_AND_ASSIGN(MediaSourceState); |
| 223 }; | 222 }; |
| 224 | 223 |
| 225 } // namespace media | 224 } // namespace media |
| 226 | 225 |
| 227 #endif // MEDIA_FILTERS_MEDIA_SOURCE_STATE_H_ | 226 #endif // MEDIA_FILTERS_MEDIA_SOURCE_STATE_H_ |
| OLD | NEW |