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

Unified Diff: media/filters/ffmpeg_demuxer.h

Issue 164233005: Cap the memory usage in FFMpegDemuxer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/ffmpeg_demuxer.h
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
index ea2b9085f5d9a9e73b31887f459c3cd2df7c917b..0a902b39da9a3d49f5a03adfa7b600fb48a6c27a 100644
--- a/media/filters/ffmpeg_demuxer.h
+++ b/media/filters/ffmpeg_demuxer.h
@@ -94,6 +94,9 @@ class FFmpegDemuxerStream : public DemuxerStream {
// Returns true if this stream has capacity for additional data.
bool HasAvailableCapacity();
+ // Returns the total buffer size FFMpegDemuxerStream is holding onto.
+ int MemoryUsage() const;
+
TextKind GetTextKind() const;
// Returns the value associated with |key| in the metadata for the avstream.
@@ -182,6 +185,9 @@ class MEDIA_EXPORT FFmpegDemuxer : public Demuxer {
// go over capacity depending on how the file is muxed.
bool StreamsHaveAvailableCapacity();
+ // Returns true if any stream has reached its maximum memory usage.
+ bool IsMaxMemoryReached();
+
// Signal all FFmpegDemuxerStreams that the stream has ended.
void StreamHasEnded();

Powered by Google App Engine
This is Rietveld 408576698