| 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_SOURCE_BUFFER_STATE_H_ |
| 6 #define MEDIA_FILTERS_MEDIA_SOURCE_STATE_H_ | 6 #define MEDIA_FILTERS_SOURCE_BUFFER_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/audio_codecs.h" | 12 #include "media/base/audio_codecs.h" |
| 13 #include "media/base/demuxer.h" | 13 #include "media/base/demuxer.h" |
| 14 #include "media/base/demuxer_stream.h" | 14 #include "media/base/demuxer_stream.h" |
| 15 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
| 16 #include "media/base/media_log.h" | 16 #include "media/base/media_log.h" |
| 17 #include "media/base/stream_parser.h" | 17 #include "media/base/stream_parser.h" |
| 18 #include "media/base/stream_parser_buffer.h" | 18 #include "media/base/stream_parser_buffer.h" |
| 19 #include "media/base/video_codecs.h" | 19 #include "media/base/video_codecs.h" |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| 22 | 22 |
| 23 using base::TimeDelta; | 23 using base::TimeDelta; |
| 24 | 24 |
| 25 class ChunkDemuxerStream; | 25 class ChunkDemuxerStream; |
| 26 class FrameProcessor; | 26 class FrameProcessor; |
| 27 | 27 |
| 28 // Contains state belonging to a source id. | 28 // Contains state belonging to a source id. |
| 29 class MEDIA_EXPORT MediaSourceState { | 29 class MEDIA_EXPORT SourceBufferState { |
| 30 public: | 30 public: |
| 31 // Callback signature used to create ChunkDemuxerStreams. | 31 // Callback signature used to create ChunkDemuxerStreams. |
| 32 typedef base::Callback<ChunkDemuxerStream*(DemuxerStream::Type)> | 32 typedef base::Callback<ChunkDemuxerStream*(DemuxerStream::Type)> |
| 33 CreateDemuxerStreamCB; | 33 CreateDemuxerStreamCB; |
| 34 | 34 |
| 35 typedef base::Callback<void(ChunkDemuxerStream*, const TextTrackConfig&)> | 35 typedef base::Callback<void(ChunkDemuxerStream*, const TextTrackConfig&)> |
| 36 NewTextTrackCB; | 36 NewTextTrackCB; |
| 37 | 37 |
| 38 MediaSourceState(std::unique_ptr<StreamParser> stream_parser, | 38 SourceBufferState(std::unique_ptr<StreamParser> stream_parser, |
| 39 std::unique_ptr<FrameProcessor> frame_processor, | 39 std::unique_ptr<FrameProcessor> frame_processor, |
| 40 const CreateDemuxerStreamCB& create_demuxer_stream_cb, | 40 const CreateDemuxerStreamCB& create_demuxer_stream_cb, |
| 41 const scoped_refptr<MediaLog>& media_log); | 41 const scoped_refptr<MediaLog>& media_log); |
| 42 | 42 |
| 43 ~MediaSourceState(); | 43 ~SourceBufferState(); |
| 44 | 44 |
| 45 void Init(const StreamParser::InitCB& init_cb, | 45 void Init(const StreamParser::InitCB& init_cb, |
| 46 const std::string& expected_codecs, | 46 const std::string& expected_codecs, |
| 47 const StreamParser::EncryptedMediaInitDataCB& | 47 const StreamParser::EncryptedMediaInitDataCB& |
| 48 encrypted_media_init_data_cb, | 48 encrypted_media_init_data_cb, |
| 49 const NewTextTrackCB& new_text_track_cb); | 49 const NewTextTrackCB& new_text_track_cb); |
| 50 | 50 |
| 51 // Appends new data to the StreamParser. | 51 // Appends new data to the StreamParser. |
| 52 // Returns true if the data was successfully appended. Returns false if an | 52 // Returns true if the data was successfully appended. Returns false if an |
| 53 // error occurred. |*timestamp_offset| is used and possibly updated by the | 53 // error occurred. |*timestamp_offset| is used and possibly updated by the |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 215 std::vector<AudioCodec> expected_audio_codecs_; | 215 std::vector<AudioCodec> expected_audio_codecs_; |
| 216 std::vector<VideoCodec> expected_video_codecs_; | 216 std::vector<VideoCodec> expected_video_codecs_; |
| 217 | 217 |
| 218 // Indicates that timestampOffset should be updated automatically during | 218 // Indicates that timestampOffset should be updated automatically during |
| 219 // OnNewBuffers() based on the earliest end timestamp of the buffers provided. | 219 // OnNewBuffers() based on the earliest end timestamp of the buffers provided. |
| 220 // TODO(wolenetz): Refactor this function while integrating April 29, 2014 | 220 // TODO(wolenetz): Refactor this function while integrating April 29, 2014 |
| 221 // changes to MSE spec. See http://crbug.com/371499. | 221 // changes to MSE spec. See http://crbug.com/371499. |
| 222 bool auto_update_timestamp_offset_; | 222 bool auto_update_timestamp_offset_; |
| 223 | 223 |
| 224 DISALLOW_COPY_AND_ASSIGN(MediaSourceState); | 224 DISALLOW_COPY_AND_ASSIGN(SourceBufferState); |
| 225 }; | 225 }; |
| 226 | 226 |
| 227 } // namespace media | 227 } // namespace media |
| 228 | 228 |
| 229 #endif // MEDIA_FILTERS_MEDIA_SOURCE_STATE_H_ | 229 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STATE_H_ |
| OLD | NEW |