Index: media/filters/source_buffer_stream.h |
diff --git a/media/filters/source_buffer_stream.h b/media/filters/source_buffer_stream.h |
index 8a7ac85957087c40d89d42d62a6a3453b8afdea1..7559a443963732bac6db8e2e96a45d6ccf01b659 100644 |
--- a/media/filters/source_buffer_stream.h |
+++ b/media/filters/source_buffer_stream.h |
@@ -16,6 +16,7 @@ |
#include <utility> |
#include <vector> |
+#include "base/callback_forward.h" |
#include "base/memory/ref_counted.h" |
#include "media/base/audio_decoder_config.h" |
#include "media/base/media_export.h" |
@@ -34,6 +35,8 @@ class MEDIA_EXPORT SourceBufferStream { |
public: |
typedef StreamParser::BufferQueue BufferQueue; |
typedef std::list<SourceBufferRange*> RangeList; |
+ typedef base::Callback<bool(DecodeTimestamp start_dts, |
+ DecodeTimestamp end_dts)> NotifyRangeRemovalCB; |
// Status returned by GetNextBuffer(). |
// kSuccess: Indicates that the next buffer was returned. |
@@ -65,6 +68,15 @@ class MEDIA_EXPORT SourceBufferStream { |
~SourceBufferStream(); |
+ // Allows callers to register for notification of range removal. The |
+ // registration must be valid during any range removal algorithm execution, as |
+ // can result from duration truncation, explicit Remove(), or garbage |
+ // collection. Coded frame removals done during Append are not included (nor |
+ // should they be according to MSE spec.) |
+ void set_range_removal_cb(const NotifyRangeRemovalCB& range_removal_cb) { |
+ range_removal_cb_ = range_removal_cb; |
+ } |
+ |
// Signals that the next buffers appended are part of a new media segment |
// starting at |media_segment_start_time|. |
// TODO(acolwell/wolenetz): This should be changed to a presentation |
@@ -329,6 +341,11 @@ class MEDIA_EXPORT SourceBufferStream { |
// out what is wrong with the content. |
LogCB log_cb_; |
+ // Callback used to report range removal to support detection and processing |
+ // by the MSE Coded Frame Processing Algorithm's of an append discontinuity |
+ // that may have been introduced by the range's removal. |
+ NotifyRangeRemovalCB range_removal_cb_; |
+ |
// List of disjoint buffered ranges, ordered by start time. |
RangeList ranges_; |