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

Unified 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: Fix and add tests. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.h
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
index 1e90bad723642f80d2c8573c5a1363a78d65920f..7e65cb49cd2c24488ec30d1d6879fe09e0540406 100644
--- a/media/filters/ffmpeg_demuxer.h
+++ b/media/filters/ffmpeg_demuxer.h
@@ -86,6 +86,9 @@ class FFmpegDemuxerStream : public DemuxerStream {
// Empties the queues and ignores any additional calls to Read().
void Stop();
+ // Aborts any pending reads.
+ void Abort();
+
base::TimeDelta duration() const { return duration_; }
// Enables fixes for files with negative timestamps. Normally all timestamps
@@ -211,6 +214,7 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
void Initialize(DemuxerHost* host,
const PipelineStatusCB& status_cb,
bool enable_text_tracks) override;
+ void AbortPendingReads() override;
void Stop() override;
void StartWaitingForSeek(base::TimeDelta seek_time) override;
void CancelPendingSeek(base::TimeDelta seek_time) override;
@@ -250,7 +254,7 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
void OnFindStreamInfoDone(const PipelineStatusCB& status_cb, int result);
// FFmpeg callbacks during seeking.
- void OnSeekFrameDone(const PipelineStatusCB& cb, int result);
+ void OnSeekFrameDone(int result);
// FFmpeg callbacks during reading + helper method to initiate reads.
void ReadFrameIfNeeded();
@@ -294,7 +298,7 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
// Tracks if there's an outstanding av_seek_frame() operation. Used to discard
// results of pre-seek av_read_frame() operations.
- bool pending_seek_;
+ PipelineStatusCB pending_seek_cb_;
// |streams_| mirrors the AVStream array in AVFormatContext. It contains
// FFmpegDemuxerStreams encapsluating AVStream objects at the same index.
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698