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

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

Issue 2491043003: MediaResource refactoring to support multiple streams (Closed)
Patch Set: Added a TODO about DemuxerStream enabled/set_enabled methods Created 3 years, 10 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
« no previous file with comments | « media/filters/decrypting_demuxer_stream.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Implements the Demuxer interface using FFmpeg's libavformat. At this time 5 // Implements the Demuxer interface using FFmpeg's libavformat. At this time
6 // will support demuxing any audio/video format thrown at it. The streams 6 // will support demuxing any audio/video format thrown at it. The streams
7 // output mime types audio/x-ffmpeg and video/x-ffmpeg and include an integer 7 // output mime types audio/x-ffmpeg and video/x-ffmpeg and include an integer
8 // key FFmpegCodecID which contains the CodecID enumeration value. The CodecIDs 8 // key FFmpegCodecID which contains the CodecID enumeration value. The CodecIDs
9 // can be used to create and initialize the corresponding FFmpeg decoder. 9 // can be used to create and initialize the corresponding FFmpeg decoder.
10 // 10 //
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 Type type() const override; 109 Type type() const override;
110 Liveness liveness() const override; 110 Liveness liveness() const override;
111 void Read(const ReadCB& read_cb) override; 111 void Read(const ReadCB& read_cb) override;
112 void EnableBitstreamConverter() override; 112 void EnableBitstreamConverter() override;
113 bool SupportsConfigChanges() override; 113 bool SupportsConfigChanges() override;
114 AudioDecoderConfig audio_decoder_config() override; 114 AudioDecoderConfig audio_decoder_config() override;
115 VideoDecoderConfig video_decoder_config() override; 115 VideoDecoderConfig video_decoder_config() override;
116 VideoRotation video_rotation() override; 116 VideoRotation video_rotation() override;
117 bool enabled() const override; 117 bool enabled() const override;
118 void set_enabled(bool enabled, base::TimeDelta timestamp) override; 118 void set_enabled(bool enabled, base::TimeDelta timestamp) override;
119 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) override; 119
120 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb);
120 121
121 void SetLiveness(Liveness liveness); 122 void SetLiveness(Liveness liveness);
122 123
123 // Returns the range of buffered data in this stream. 124 // Returns the range of buffered data in this stream.
124 Ranges<base::TimeDelta> GetBufferedRanges() const; 125 Ranges<base::TimeDelta> GetBufferedRanges() const;
125 126
126 // Returns true if this stream has capacity for additional data. 127 // Returns true if this stream has capacity for additional data.
127 bool HasAvailableCapacity(); 128 bool HasAvailableCapacity();
128 129
129 // Returns the total buffer size FFMpegDemuxerStream is holding onto. 130 // Returns the total buffer size FFMpegDemuxerStream is holding onto.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 std::string GetDisplayName() const override; 212 std::string GetDisplayName() const override;
212 void Initialize(DemuxerHost* host, 213 void Initialize(DemuxerHost* host,
213 const PipelineStatusCB& status_cb, 214 const PipelineStatusCB& status_cb,
214 bool enable_text_tracks) override; 215 bool enable_text_tracks) override;
215 void AbortPendingReads() override; 216 void AbortPendingReads() override;
216 void Stop() override; 217 void Stop() override;
217 void StartWaitingForSeek(base::TimeDelta seek_time) override; 218 void StartWaitingForSeek(base::TimeDelta seek_time) override;
218 void CancelPendingSeek(base::TimeDelta seek_time) override; 219 void CancelPendingSeek(base::TimeDelta seek_time) override;
219 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; 220 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override;
220 base::Time GetTimelineOffset() const override; 221 base::Time GetTimelineOffset() const override;
221 DemuxerStream* GetStream(DemuxerStream::Type type) override; 222 std::vector<DemuxerStream*> GetAllStreams() override;
223 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) override;
222 base::TimeDelta GetStartTime() const override; 224 base::TimeDelta GetStartTime() const override;
223 int64_t GetMemoryUsage() const override; 225 int64_t GetMemoryUsage() const override;
224 226
225 // Calls |encrypted_media_init_data_cb_| with the initialization data 227 // Calls |encrypted_media_init_data_cb_| with the initialization data
226 // encountered in the file. 228 // encountered in the file.
227 void OnEncryptedMediaInitData(EmeInitDataType init_data_type, 229 void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
228 const std::string& encryption_key_id); 230 const std::string& encryption_key_id);
229 231
230 // Allow FFmpegDemuxerStream to notify us when there is updated information 232 // Allow FFmpegDemuxerStream to notify us when there is updated information
231 // about capacity and what buffered data is available. 233 // about capacity and what buffered data is available.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 271
270 // Returns true if the maximum allowed memory usage has been reached. 272 // Returns true if the maximum allowed memory usage has been reached.
271 bool IsMaxMemoryUsageReached() const; 273 bool IsMaxMemoryUsageReached() const;
272 274
273 // Signal all FFmpegDemuxerStreams that the stream has ended. 275 // Signal all FFmpegDemuxerStreams that the stream has ended.
274 void StreamHasEnded(); 276 void StreamHasEnded();
275 277
276 // Called by |url_protocol_| whenever |data_source_| returns a read error. 278 // Called by |url_protocol_| whenever |data_source_| returns a read error.
277 void OnDataSourceError(); 279 void OnDataSourceError();
278 280
279 // Returns the stream from |streams_| that matches |type| as an 281 // Returns the first stream from |streams_| that matches |type| as an
280 // FFmpegDemuxerStream. 282 // FFmpegDemuxerStream and is enabled.
281 FFmpegDemuxerStream* GetFFmpegStream(DemuxerStream::Type type) const; 283 FFmpegDemuxerStream* GetFirstEnabledFFmpegStream(
284 DemuxerStream::Type type) const;
282 285
283 // Called after the streams have been collected from the media, to allow 286 // Called after the streams have been collected from the media, to allow
284 // the text renderer to bind each text stream to the cue rendering engine. 287 // the text renderer to bind each text stream to the cue rendering engine.
285 void AddTextStreams(); 288 void AddTextStreams();
286 289
287 void SetLiveness(DemuxerStream::Liveness liveness); 290 void SetLiveness(DemuxerStream::Liveness liveness);
288 291
289 DemuxerHost* host_; 292 DemuxerHost* host_;
290 293
291 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 294 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 base::WeakPtr<FFmpegDemuxer> weak_this_; 369 base::WeakPtr<FFmpegDemuxer> weak_this_;
367 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; 370 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_;
368 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; 371 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_;
369 372
370 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); 373 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer);
371 }; 374 };
372 375
373 } // namespace media 376 } // namespace media
374 377
375 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ 378 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_
OLDNEW
« no previous file with comments | « media/filters/decrypting_demuxer_stream.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698