Chromium Code Reviews| Index: media/filters/frame_processor_base.h |
| diff --git a/media/filters/frame_processor_base.h b/media/filters/frame_processor_base.h |
| index 8841998885dea83a44db041cee6885baa40a01df..596b8f96e1de04f8b7a7dbf7223999ddbc48406a 100644 |
| --- a/media/filters/frame_processor_base.h |
| +++ b/media/filters/frame_processor_base.h |
| @@ -25,6 +25,27 @@ class MseTrackBuffer { |
| explicit MseTrackBuffer(ChunkDemuxerStream* stream); |
| ~MseTrackBuffer(); |
| + // Get/set |last_decode_timestamp_|. |
| + base::TimeDelta last_decode_timestamp() const { |
| + return last_decode_timestamp_; |
| + } |
| + void set_last_decode_timestamp(base::TimeDelta timestamp) { |
| + last_decode_timestamp_ = timestamp; |
| + } |
| + |
| + // Get/set |last_frame_duration_|. |
| + base::TimeDelta last_frame_duration() const { |
| + return last_frame_duration_; |
| + } |
| + void set_last_frame_duration(base::TimeDelta duration) { |
| + last_frame_duration_ = duration; |
| + } |
| + |
| + // Gets |highest_presentation_timestamp_|. |
| + base::TimeDelta highest_presentation_timestamp() const { |
| + return highest_presentation_timestamp_; |
| + } |
| + |
| // Get/set |needs_random_access_point_|. |
| bool needs_random_access_point() const { |
| return needs_random_access_point_; |
| @@ -36,12 +57,33 @@ class MseTrackBuffer { |
| // Gets a pointer to this track's ChunkDemuxerStream. |
| ChunkDemuxerStream* stream() const { return stream_; } |
| - // Sets |needs_random_access_point_| to true. |
| - // TODO(wolenetz): Add the rest of the new coded frame processing algorithm |
| - // track buffer attributes and reset them here. See http://crbug.com/249422. |
| + // Unsets |last_decode_timestamp_|, unsets |last_frame_duration_|, |
| + // unsets |highest_presentation_timestamp_|, and sets |
| + // |needs_random_access_point_| to true. |
| void Reset(); |
| + // If |highest_presentation_timestamp_| is unset or |timestamp| is greater |
| + // than |highest_presentation_timestamp_|, sets |
| + // |highest_presentation_timestamp_| to |timestamp|. Note that bidirectional |
| + // prediction between coded frames can cause |timestamp| to not be |
| + // monotonically increasing even though the decode timestamps are |
| + // monotonically increasing. |
| + void SetHighestPresentationTimestampIfIncreased(base::TimeDelta timestamp); |
| + |
| private: |
| + // The decode timestamp of the last coded frame appended in the current coded |
| + // frame group. Initially kNoTimestamp(), meaning "unset". |
| + base::TimeDelta last_decode_timestamp_; |
| + |
| + // The coded frame duration of the last coded frame appended in the current |
| + // coded frame group. Initially kNoTimestamp(), meaning "unset". |
| + base::TimeDelta last_frame_duration_; |
| + |
| + // The highest presentation timestamp encountered in a coded frame appended |
| + // in the current coded frame group. Initially kNoTimestamp(), meaning |
| + // "unset". |
| + base::TimeDelta highest_presentation_timestamp_; |
| + |
| // Keeps track of whether the track buffer is waiting for a random access |
| // point coded frame. Initially set to true to indicate that a random access |
| // point coded frame is needed before anything can be added to the track |
| @@ -79,6 +121,11 @@ class MEDIA_EXPORT FrameProcessorBase { |
| bool sequence_mode() { return sequence_mode_; } |
| virtual void SetSequenceMode(bool sequence_mode) = 0; |
| + // Signals the frame processor to update its group start timestamp to be |
| + // |timestamp_offset| if it is in sequence append mode. |
| + virtual void SetGroupStartTimestampIfInSequenceMode( |
|
acolwell GONE FROM CHROMIUM
2014/05/08 00:06:43
Does this really need to be virtual? I don't think
wolenetz
2014/05/08 02:35:28
WSBI/ChunkDemuxer/SourceState calls this regardles
acolwell GONE FROM CHROMIUM
2014/05/08 17:32:22
You could simply lift group_start_timestamp_ into
wolenetz
2014/05/08 19:59:01
Done.
|
| + base::TimeDelta timestamp_offset) = 0; |
| + |
| // Processes buffers in |audio_buffers|, |video_buffers|, and |text_map|. |
| // Returns true on success or false on failure which indicates decode error. |
| // |append_window_start| and |append_window_end| correspond to the MSE spec's |
| @@ -117,6 +164,10 @@ class MEDIA_EXPORT FrameProcessorBase { |
| // MseTrackBuffer. Otherwise, returns NULL. |
| MseTrackBuffer* FindTrack(StreamParser::TrackId id); |
| + // Signals all track buffers' streams that a new media segment is starting |
| + // with timestamp |segment_timestamp|. |
| + void NotifyNewMediaSegmentStarting(base::TimeDelta segment_timestamp); |
| + |
| // The AppendMode of the associated SourceBuffer. |
| // See SetSequenceMode() for interpretation of |sequence_mode_|. |
| // Per http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode: |