Index: media/filters/frame_processor.h |
diff --git a/media/filters/frame_processor.h b/media/filters/frame_processor.h |
index fc6de696543df7a9d74ffc9ce6daa78cfd198fbd..f1dcc39c83ba4a1b8c795886af28b769345e6559 100644 |
--- a/media/filters/frame_processor.h |
+++ b/media/filters/frame_processor.h |
@@ -49,9 +49,6 @@ class MEDIA_EXPORT FrameProcessor { |
// |append_window_start| and |append_window_end| correspond to the MSE spec's |
// similarly named source buffer attributes that are used in coded frame |
// processing. |
- // |*new_media_segment| tracks whether the next buffers processed within the |
- // append window represent the start of a new media segment. This method may |
- // both use and update this flag. |
// Uses |*timestamp_offset| according to the coded frame processing algorithm, |
// including updating it as required in 'sequence' mode frame processing. |
bool ProcessFrames(const StreamParser::BufferQueue& audio_buffers, |
@@ -59,7 +56,6 @@ class MEDIA_EXPORT FrameProcessor { |
const StreamParser::TextBufferQueueMap& text_map, |
base::TimeDelta append_window_start, |
base::TimeDelta append_window_end, |
- bool* new_media_segment, |
base::TimeDelta* timestamp_offset); |
// Signals the frame processor to update its group start timestamp to be |
@@ -93,15 +89,17 @@ class MEDIA_EXPORT FrameProcessor { |
void OnPossibleAudioConfigUpdate(const AudioDecoderConfig& config); |
private: |
+ friend class FrameProcessorTest; |
+ |
typedef std::map<StreamParser::TrackId, MseTrackBuffer*> TrackBufferMap; |
// If |track_buffers_| contains |id|, returns a pointer to the associated |
// MseTrackBuffer. Otherwise, returns NULL. |
MseTrackBuffer* FindTrack(StreamParser::TrackId id); |
- // Signals all track buffers' streams that a new media segment is starting |
- // with decode timestamp |segment_timestamp|. |
- void NotifyNewMediaSegmentStarting(DecodeTimestamp segment_timestamp); |
+ // Signals all track buffers' streams that a coded frame group is starting |
+ // with decode timestamp |start_timestamp|. |
+ void NotifyStartOfCodedFrameGroup(DecodeTimestamp start_timestamp); |
// Helper that signals each track buffer to append any processed, but not yet |
// appended, frames to its stream. Returns true on success, or false if one or |
@@ -134,8 +132,7 @@ class MEDIA_EXPORT FrameProcessor { |
bool ProcessFrame(const scoped_refptr<StreamParserBuffer>& frame, |
base::TimeDelta append_window_start, |
base::TimeDelta append_window_end, |
- base::TimeDelta* timestamp_offset, |
- bool* new_media_segment); |
+ base::TimeDelta* timestamp_offset); |
// TrackId-indexed map of each track's stream. |
TrackBufferMap track_buffers_; |
@@ -155,6 +152,12 @@ class MEDIA_EXPORT FrameProcessor { |
// set to false ("segments"). |
bool sequence_mode_ = false; |
+ // Flag to track whether or not the next processed frame is a continuation of |
+ // a coded frame group. This flag resets to false upon detection of |
+ // discontinuity, and becomes true once a processed coded frame for the |
+ // current coded frame group is sent to its track buffer. |
+ bool in_coded_frame_group_ = false; |
+ |
// Tracks the MSE coded frame processing variable of same name. |
// Initially kNoTimestamp(), meaning "unset". |
base::TimeDelta group_start_timestamp_; |
@@ -165,6 +168,12 @@ class MEDIA_EXPORT FrameProcessor { |
// and gets updated by ProcessFrames(). |
base::TimeDelta group_end_timestamp_; |
+ // Chromium allows relaxed enforcement; not all tracks must exist in each |
+ // media segment in a muxed stream. This variable allows detecting decreasing |
+ // last decode timestamp across all track buffers to trigger coded frame group |
+ // discontinuity. |
+ DecodeTimestamp last_processed_decode_timestamp_; |
+ |
UpdateDurationCB update_duration_cb_; |
// MediaLog for reporting messages and properties to debug content and engine. |