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

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

Issue 2267963002: Add support for cancellation of demuxer reads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually abort the data. Created 4 years, 3 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 // 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Enters the end of stream state. After delivering remaining queued buffers 79 // Enters the end of stream state. After delivering remaining queued buffers
80 // only end of stream buffers will be delivered. 80 // only end of stream buffers will be delivered.
81 void SetEndOfStream(); 81 void SetEndOfStream();
82 82
83 // Drops queued buffers and clears end of stream state. 83 // Drops queued buffers and clears end of stream state.
84 void FlushBuffers(); 84 void FlushBuffers();
85 85
86 // Empties the queues and ignores any additional calls to Read(). 86 // Empties the queues and ignores any additional calls to Read().
87 void Stop(); 87 void Stop();
88 88
89 // Aborts any pending reads.
90 void Abort();
91
89 base::TimeDelta duration() const { return duration_; } 92 base::TimeDelta duration() const { return duration_; }
90 93
91 // Enables fixes for files with negative timestamps. Normally all timestamps 94 // Enables fixes for files with negative timestamps. Normally all timestamps
92 // are rebased against FFmpegDemuxer::start_time() whenever that value is 95 // are rebased against FFmpegDemuxer::start_time() whenever that value is
93 // negative. When this fix is enabled, only AUDIO stream packets will be 96 // negative. When this fix is enabled, only AUDIO stream packets will be
94 // rebased to time zero, all other stream types will use the muxed timestamp. 97 // rebased to time zero, all other stream types will use the muxed timestamp.
95 // 98 //
96 // Further, when no codec delay is present, all AUDIO packets which originally 99 // Further, when no codec delay is present, all AUDIO packets which originally
97 // had negative timestamps will be marked for post-decode discard. When codec 100 // had negative timestamps will be marked for post-decode discard. When codec
98 // delay is present, it is assumed the decoder will handle discard and does 101 // delay is present, it is assumed the decoder will handle discard and does
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, 201 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb,
199 const MediaTracksUpdatedCB& media_tracks_updated_cb, 202 const MediaTracksUpdatedCB& media_tracks_updated_cb,
200 const scoped_refptr<MediaLog>& media_log); 203 const scoped_refptr<MediaLog>& media_log);
201 ~FFmpegDemuxer() override; 204 ~FFmpegDemuxer() override;
202 205
203 // Demuxer implementation. 206 // Demuxer implementation.
204 std::string GetDisplayName() const override; 207 std::string GetDisplayName() const override;
205 void Initialize(DemuxerHost* host, 208 void Initialize(DemuxerHost* host,
206 const PipelineStatusCB& status_cb, 209 const PipelineStatusCB& status_cb,
207 bool enable_text_tracks) override; 210 bool enable_text_tracks) override;
211 void AbortPendingReads() override;
208 void Stop() override; 212 void Stop() override;
209 void StartWaitingForSeek(base::TimeDelta seek_time) override; 213 void StartWaitingForSeek(base::TimeDelta seek_time) override;
210 void CancelPendingSeek(base::TimeDelta seek_time) override; 214 void CancelPendingSeek(base::TimeDelta seek_time) override;
211 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; 215 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override;
212 base::Time GetTimelineOffset() const override; 216 base::Time GetTimelineOffset() const override;
213 DemuxerStream* GetStream(DemuxerStream::Type type) override; 217 DemuxerStream* GetStream(DemuxerStream::Type type) override;
214 base::TimeDelta GetStartTime() const override; 218 base::TimeDelta GetStartTime() const override;
215 int64_t GetMemoryUsage() const override; 219 int64_t GetMemoryUsage() const override;
216 220
217 // Calls |encrypted_media_init_data_cb_| with the initialization data 221 // Calls |encrypted_media_init_data_cb_| with the initialization data
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 354
351 // NOTE: Weak pointers must be invalidated before all other member variables. 355 // NOTE: Weak pointers must be invalidated before all other member variables.
352 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; 356 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_;
353 357
354 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); 358 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer);
355 }; 359 };
356 360
357 } // namespace media 361 } // namespace media
358 362
359 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ 363 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698