OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHUNK_DEMUXER_H_ | 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // Returns the size of the buffered data in bytes. | 89 // Returns the size of the buffered data in bytes. |
90 size_t GetBufferedSize() const; | 90 size_t GetBufferedSize() const; |
91 | 91 |
92 // Signal to the stream that buffers handed in through subsequent calls to | 92 // Signal to the stream that buffers handed in through subsequent calls to |
93 // Append() belong to a coded frame group that starts at |start_timestamp|. | 93 // Append() belong to a coded frame group that starts at |start_timestamp|. |
94 void OnStartOfCodedFrameGroup(DecodeTimestamp start_timestamp); | 94 void OnStartOfCodedFrameGroup(DecodeTimestamp start_timestamp); |
95 | 95 |
96 // Called when midstream config updates occur. | 96 // Called when midstream config updates occur. |
97 // Returns true if the new config is accepted. | 97 // Returns true if the new config is accepted. |
98 // Returns false if the new config should trigger an error. | 98 // Returns false if the new config should trigger an error. |
99 bool UpdateAudioConfig(const AudioDecoderConfig& config, | 99 bool UpdateAudioConfig(const AudioDecoderConfig& config, MediaLog* media_log); |
100 const scoped_refptr<MediaLog>& media_log); | 100 bool UpdateVideoConfig(const VideoDecoderConfig& config, MediaLog* media_log); |
101 bool UpdateVideoConfig(const VideoDecoderConfig& config, | 101 void UpdateTextConfig(const TextTrackConfig& config, MediaLog* media_log); |
102 const scoped_refptr<MediaLog>& media_log); | |
103 void UpdateTextConfig(const TextTrackConfig& config, | |
104 const scoped_refptr<MediaLog>& media_log); | |
105 | 102 |
106 void MarkEndOfStream(); | 103 void MarkEndOfStream(); |
107 void UnmarkEndOfStream(); | 104 void UnmarkEndOfStream(); |
108 | 105 |
109 // DemuxerStream methods. | 106 // DemuxerStream methods. |
110 void Read(const ReadCB& read_cb) override; | 107 void Read(const ReadCB& read_cb) override; |
111 Type type() const override; | 108 Type type() const override; |
112 Liveness liveness() const override; | 109 Liveness liveness() const override; |
113 AudioDecoderConfig audio_decoder_config() override; | 110 AudioDecoderConfig audio_decoder_config() override; |
114 VideoDecoderConfig video_decoder_config() override; | 111 VideoDecoderConfig video_decoder_config() override; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. | 174 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. |
178 }; | 175 }; |
179 | 176 |
180 // |open_cb| Run when Initialize() is called to signal that the demuxer | 177 // |open_cb| Run when Initialize() is called to signal that the demuxer |
181 // is ready to receive media data via AppenData(). | 178 // is ready to receive media data via AppenData(). |
182 // |encrypted_media_init_data_cb| Run when the demuxer determines that an | 179 // |encrypted_media_init_data_cb| Run when the demuxer determines that an |
183 // encryption key is needed to decrypt the content. | 180 // encryption key is needed to decrypt the content. |
184 // |media_log| Used to report content and engine debug messages. | 181 // |media_log| Used to report content and engine debug messages. |
185 ChunkDemuxer(const base::Closure& open_cb, | 182 ChunkDemuxer(const base::Closure& open_cb, |
186 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, | 183 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, |
187 const scoped_refptr<MediaLog>& media_log); | 184 MediaLog* media_log); |
188 ~ChunkDemuxer() override; | 185 ~ChunkDemuxer() override; |
189 | 186 |
190 // Demuxer implementation. | 187 // Demuxer implementation. |
191 std::string GetDisplayName() const override; | 188 std::string GetDisplayName() const override; |
192 | 189 |
193 // |enable_text| Process inband text tracks in the normal way when true, | 190 // |enable_text| Process inband text tracks in the normal way when true, |
194 // otherwise ignore them. | 191 // otherwise ignore them. |
195 void Initialize(DemuxerHost* host, | 192 void Initialize(DemuxerHost* host, |
196 const PipelineStatusCB& init_cb, | 193 const PipelineStatusCB& init_cb, |
197 bool enable_text_tracks) override; | 194 bool enable_text_tracks) override; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 mutable base::Lock lock_; | 400 mutable base::Lock lock_; |
404 State state_; | 401 State state_; |
405 bool cancel_next_seek_; | 402 bool cancel_next_seek_; |
406 | 403 |
407 DemuxerHost* host_; | 404 DemuxerHost* host_; |
408 base::Closure open_cb_; | 405 base::Closure open_cb_; |
409 EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 406 EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
410 bool enable_text_; | 407 bool enable_text_; |
411 | 408 |
412 // MediaLog for reporting messages and properties to debug content and engine. | 409 // MediaLog for reporting messages and properties to debug content and engine. |
413 scoped_refptr<MediaLog> media_log_; | 410 MediaLog* media_log_; |
414 | 411 |
415 PipelineStatusCB init_cb_; | 412 PipelineStatusCB init_cb_; |
416 // Callback to execute upon seek completion. | 413 // Callback to execute upon seek completion. |
417 // TODO(wolenetz/acolwell): Protect against possible double-locking by first | 414 // TODO(wolenetz/acolwell): Protect against possible double-locking by first |
418 // releasing |lock_| before executing this callback. See | 415 // releasing |lock_| before executing this callback. See |
419 // http://crbug.com/308226 | 416 // http://crbug.com/308226 |
420 PipelineStatusCB seek_cb_; | 417 PipelineStatusCB seek_cb_; |
421 | 418 |
422 using OwnedChunkDemuxerStreamVector = | 419 using OwnedChunkDemuxerStreamVector = |
423 std::vector<std::unique_ptr<ChunkDemuxerStream>>; | 420 std::vector<std::unique_ptr<ChunkDemuxerStream>>; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 int detected_text_track_count_; | 453 int detected_text_track_count_; |
457 | 454 |
458 std::map<MediaTrack::Id, ChunkDemuxerStream*> track_id_to_demux_stream_map_; | 455 std::map<MediaTrack::Id, ChunkDemuxerStream*> track_id_to_demux_stream_map_; |
459 | 456 |
460 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 457 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
461 }; | 458 }; |
462 | 459 |
463 } // namespace media | 460 } // namespace media |
464 | 461 |
465 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 462 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |