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

Side by Side Diff: media/filters/chunk_demuxer.h

Issue 1235793005: Deprecate LogCB in favor of using MediaLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
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 <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Returns base::TimeDelta() if the stream has no buffered data. 66 // Returns base::TimeDelta() if the stream has no buffered data.
67 base::TimeDelta GetBufferedDuration() const; 67 base::TimeDelta GetBufferedDuration() const;
68 68
69 // Signal to the stream that buffers handed in through subsequent calls to 69 // Signal to the stream that buffers handed in through subsequent calls to
70 // Append() belong to a media segment that starts at |start_timestamp|. 70 // Append() belong to a media segment that starts at |start_timestamp|.
71 void OnNewMediaSegment(DecodeTimestamp start_timestamp); 71 void OnNewMediaSegment(DecodeTimestamp start_timestamp);
72 72
73 // Called when midstream config updates occur. 73 // Called when midstream config updates occur.
74 // Returns true if the new config is accepted. 74 // Returns true if the new config is accepted.
75 // Returns false if the new config should trigger an error. 75 // Returns false if the new config should trigger an error.
76 bool UpdateAudioConfig(const AudioDecoderConfig& config, const LogCB& log_cb); 76 bool UpdateAudioConfig(const AudioDecoderConfig& config,
77 bool UpdateVideoConfig(const VideoDecoderConfig& config, const LogCB& log_cb); 77 const scoped_refptr<MediaLog>& media_log);
78 void UpdateTextConfig(const TextTrackConfig& config, const LogCB& log_cb); 78 bool UpdateVideoConfig(const VideoDecoderConfig& config,
79 const scoped_refptr<MediaLog>& media_log);
80 void UpdateTextConfig(const TextTrackConfig& config,
81 const scoped_refptr<MediaLog>& media_log);
79 82
80 void MarkEndOfStream(); 83 void MarkEndOfStream();
81 void UnmarkEndOfStream(); 84 void UnmarkEndOfStream();
82 85
83 // DemuxerStream methods. 86 // DemuxerStream methods.
84 void Read(const ReadCB& read_cb) override; 87 void Read(const ReadCB& read_cb) override;
85 Type type() const override; 88 Type type() const override;
86 Liveness liveness() const override; 89 Liveness liveness() const override;
87 AudioDecoderConfig audio_decoder_config() override; 90 AudioDecoderConfig audio_decoder_config() override;
88 VideoDecoderConfig video_decoder_config() override; 91 VideoDecoderConfig video_decoder_config() override;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 kNotSupported, // Type specified is not supported. 145 kNotSupported, // Type specified is not supported.
143 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. 146 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs.
144 }; 147 };
145 148
146 typedef base::Closure InitSegmentReceivedCB; 149 typedef base::Closure InitSegmentReceivedCB;
147 150
148 // |open_cb| Run when Initialize() is called to signal that the demuxer 151 // |open_cb| Run when Initialize() is called to signal that the demuxer
149 // is ready to receive media data via AppenData(). 152 // is ready to receive media data via AppenData().
150 // |encrypted_media_init_data_cb| Run when the demuxer determines that an 153 // |encrypted_media_init_data_cb| Run when the demuxer determines that an
151 // encryption key is needed to decrypt the content. 154 // encryption key is needed to decrypt the content.
152 // |enable_text| Process inband text tracks in the normal way when true, 155 // |media_log| Used to report content and engine debug messages.
153 // otherwise ignore them.
154 // |log_cb| Run when the demuxer needs to emit MediaLog messages.
155 // |splice_frames_enabled| Indicates that it's okay to generate splice frames 156 // |splice_frames_enabled| Indicates that it's okay to generate splice frames
156 // per the MSE specification. Renderers must understand DecoderBuffer's 157 // per the MSE specification. Renderers must understand DecoderBuffer's
157 // splice_timestamp() field. 158 // splice_timestamp() field.
158 ChunkDemuxer(const base::Closure& open_cb, 159 ChunkDemuxer(const base::Closure& open_cb,
159 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, 160 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb,
160 const LogCB& log_cb,
161 const scoped_refptr<MediaLog>& media_log, 161 const scoped_refptr<MediaLog>& media_log,
162 bool splice_frames_enabled); 162 bool splice_frames_enabled);
163 ~ChunkDemuxer() override; 163 ~ChunkDemuxer() override;
164 164
165 // Demuxer implementation. 165 // Demuxer implementation.
166 std::string GetDisplayName() const override; 166 std::string GetDisplayName() const override;
167
168 // |enable_text| Process inband text tracks in the normal way when true,
wolenetz 2015/07/13 22:25:29 This was just a drive-by fix. This comment was pre
169 // otherwise ignore them.
167 void Initialize(DemuxerHost* host, 170 void Initialize(DemuxerHost* host,
168 const PipelineStatusCB& cb, 171 const PipelineStatusCB& cb,
169 bool enable_text_tracks) override; 172 bool enable_text_tracks) override;
170 void Stop() override; 173 void Stop() override;
171 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; 174 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override;
172 base::Time GetTimelineOffset() const override; 175 base::Time GetTimelineOffset() const override;
173 DemuxerStream* GetStream(DemuxerStream::Type type) override; 176 DemuxerStream* GetStream(DemuxerStream::Type type) override;
174 base::TimeDelta GetStartTime() const override; 177 base::TimeDelta GetStartTime() const override;
175 178
176 // Methods used by an external object to control this demuxer. 179 // Methods used by an external object to control this demuxer.
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 void ShutdownAllStreams(); 356 void ShutdownAllStreams();
354 357
355 mutable base::Lock lock_; 358 mutable base::Lock lock_;
356 State state_; 359 State state_;
357 bool cancel_next_seek_; 360 bool cancel_next_seek_;
358 361
359 DemuxerHost* host_; 362 DemuxerHost* host_;
360 base::Closure open_cb_; 363 base::Closure open_cb_;
361 EncryptedMediaInitDataCB encrypted_media_init_data_cb_; 364 EncryptedMediaInitDataCB encrypted_media_init_data_cb_;
362 bool enable_text_; 365 bool enable_text_;
363 // Callback used to report log messages that can help the web developer 366
364 // figure out what is wrong with the content. 367 // MediaLog for reporting messages and properties to debug content and engine.
365 LogCB log_cb_;
366 scoped_refptr<MediaLog> media_log_; 368 scoped_refptr<MediaLog> media_log_;
367 369
368 PipelineStatusCB init_cb_; 370 PipelineStatusCB init_cb_;
369 // Callback to execute upon seek completion. 371 // Callback to execute upon seek completion.
370 // TODO(wolenetz/acolwell): Protect against possible double-locking by first 372 // TODO(wolenetz/acolwell): Protect against possible double-locking by first
371 // releasing |lock_| before executing this callback. See 373 // releasing |lock_| before executing this callback. See
372 // http://crbug.com/308226 374 // http://crbug.com/308226
373 PipelineStatusCB seek_cb_; 375 PipelineStatusCB seek_cb_;
374 376
375 scoped_ptr<ChunkDemuxerStream> audio_; 377 scoped_ptr<ChunkDemuxerStream> audio_;
(...skipping 22 matching lines...) Expand all
398 400
399 // Indicates that splice frame generation is enabled. 401 // Indicates that splice frame generation is enabled.
400 const bool splice_frames_enabled_; 402 const bool splice_frames_enabled_;
401 403
402 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 404 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
403 }; 405 };
404 406
405 } // namespace media 407 } // namespace media
406 408
407 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 409 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698