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

Unified Diff: media/filters/source_buffer_stream.h

Issue 2343543002: MSE: Replace crossfade splicing overlap trimming. (Closed)
Patch Set: Merge and feedback. Created 4 years, 1 month 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/source_buffer_state_unittest.cc ('k') | media/filters/source_buffer_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_stream.h
diff --git a/media/filters/source_buffer_stream.h b/media/filters/source_buffer_stream.h
index 7322bd79df22f8d02385328835d3d5eff121ad91..566477b81bd1120654d65221e9bd2885727aabd8 100644
--- a/media/filters/source_buffer_stream.h
+++ b/media/filters/source_buffer_stream.h
@@ -57,14 +57,11 @@ class MEDIA_EXPORT SourceBufferStream {
};
SourceBufferStream(const AudioDecoderConfig& audio_config,
- const scoped_refptr<MediaLog>& media_log,
- bool splice_frames_enabled);
+ const scoped_refptr<MediaLog>& media_log);
SourceBufferStream(const VideoDecoderConfig& video_config,
- const scoped_refptr<MediaLog>& media_log,
- bool splice_frames_enabled);
+ const scoped_refptr<MediaLog>& media_log);
SourceBufferStream(const TextTrackConfig& text_config,
- const scoped_refptr<MediaLog>& media_log,
- bool splice_frames_enabled);
+ const scoped_refptr<MediaLog>& media_log);
~SourceBufferStream();
@@ -288,6 +285,10 @@ class MEDIA_EXPORT SourceBufferStream {
// stream, and "TEXT" for a text stream.
std::string GetStreamTypeName() const;
+ // (Audio only) If |new_buffers| overlap existing buffers, trims end of
+ // existing buffers to remove overlap. |new_buffers| are not modified.
+ void TrimSpliceOverlap(const BufferQueue& new_buffers);
+
// Returns true if end of stream has been reached, i.e. the
// following conditions are met:
// 1. end of stream is marked and there is nothing in the track_buffer.
@@ -333,11 +334,6 @@ class MEDIA_EXPORT SourceBufferStream {
Type GetType() const;
- // See GetNextBuffer() for additional details. This method handles splice
- // frame processing.
- Status HandleNextBufferWithSplice(
- scoped_refptr<StreamParserBuffer>* out_buffer);
-
// See GetNextBuffer() for additional details. This method handles preroll
// frame processing.
Status HandleNextBufferWithPreroll(
@@ -345,7 +341,7 @@ class MEDIA_EXPORT SourceBufferStream {
// See GetNextBuffer() for additional details. The internal method hands out
// single buffers from the |track_buffer_| and |selected_range_| without
- // additional processing for splice frame or preroll buffers.
+ // additional processing for preroll buffers.
Status GetNextBufferInternal(scoped_refptr<StreamParserBuffer>* out_buffer);
// If the next buffer's timestamp is significantly beyond the last output
@@ -356,14 +352,8 @@ class MEDIA_EXPORT SourceBufferStream {
void WarnIfTrackBufferExhaustionSkipsForward(
const scoped_refptr<StreamParserBuffer>& next_buffer);
- // Called by PrepareRangesForNextAppend() before pruning overlapped buffers to
- // generate a splice frame with a small portion of the overlapped buffers. If
- // a splice frame is generated, the first buffer in |new_buffers| will have
- // its timestamps, duration, and fade out preroll updated.
- void GenerateSpliceFrame(const BufferQueue& new_buffers);
-
- // If |out_buffer| has splice buffers or preroll, sets |pending_buffer_|
- // appropriately and returns true. Otherwise returns false.
+ // If |out_buffer| has preroll, sets |pending_buffer_| to feed out preroll and
+ // returns true. Otherwise returns false.
bool SetPendingBuffer(scoped_refptr<StreamParserBuffer>* out_buffer);
// Used to report log messages that can help the web developer figure out what
@@ -449,24 +439,15 @@ class MEDIA_EXPORT SourceBufferStream {
// GetCurrentXXXDecoderConfig() has been called.
bool config_change_pending_ = false;
- // Used by HandleNextBufferWithSplice() or HandleNextBufferWithPreroll() when
- // a splice frame buffer or buffer with preroll is returned from
- // GetNextBufferInternal().
+ // Used by HandleNextBufferWithPreroll() when a buffer with preroll is
+ // returned from GetNextBufferInternal().
scoped_refptr<StreamParserBuffer> pending_buffer_;
- // Indicates which of the splice buffers in |splice_buffer_| should be
- // handled out next.
- size_t splice_buffers_index_ = 0;
-
// Indicates that all buffers before |pending_buffer_| have been handed out.
bool pending_buffers_complete_ = false;
- // Indicates that splice frame generation is enabled.
- const bool splice_frames_enabled_;
-
- // To prevent log spam, count the number of warnings and successes logged.
- int num_splice_generation_warning_logs_ = 0;
- int num_splice_generation_success_logs_ = 0;
+ // To prevent log spam, count the number of logs for different log scenarios.
+ int num_splice_logs_ = 0;
int num_track_buffer_gap_warning_logs_ = 0;
int num_garbage_collect_algorithm_logs_ = 0;
int num_strange_same_timestamps_logs_ = 0;
« no previous file with comments | « media/filters/source_buffer_state_unittest.cc ('k') | media/filters/source_buffer_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698