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

Unified Diff: media/filters/frame_processor.cc

Issue 1089873006: WIP - MSE: Drop non-keyframes that lack keyframe dependency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Checkpoint of WIP while I work on prereq https://codereview.chromium.org/1091293005/ Created 5 years, 8 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
« no previous file with comments | « media/filters/frame_processor.h ('k') | media/filters/source_buffer_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/frame_processor.cc
diff --git a/media/filters/frame_processor.cc b/media/filters/frame_processor.cc
index 0528ff7c806f25436991c875ce87abcb87b6289c..443a8be314ad62738fd90829acb6074cf2ccd03c 100644
--- a/media/filters/frame_processor.cc
+++ b/media/filters/frame_processor.cc
@@ -293,6 +293,55 @@ void FrameProcessor::OnPossibleAudioConfigUpdate(
1.0 / current_audio_config_.samples_per_second());
}
+bool FrameProcessor::OnRangeRemoval(StreamParser::TrackId track_id,
+ DecodeTimestamp start_dts,
+ DecodeTimestamp end_dts) {
+ DVLOG(2) << __FUNCTION__ << "(): track_id=" << track_id
+ << "start_dts=" << start_dts << "end_dts=" << end_dts;
+
+ if (start_dts < 0 || start_dts > end_dts) {
+ DVLOG(2) << __FUNCTION__ << "(): start_dts or end_dts out of range";
+ return false;
+ }
+
+ MseTrackBuffer* track_buffer = FindTrack(track_id);
+ DCHECK(track_buffer);
+ if (!track_buffer) {
+ DVLOG(2) << __FUNCTION__ << "(): unknown track_id " << track_id;
+ return false;
+ }
+
+ DecodeTimestamp last_dts = track_buffer->last_decode_timestamp();
+ if (last_dts != kNoDecodeTimestamp && start_dts <= last_dts &&
+ end_dts >= last_dts) {
+ // If mode equals "segments": Set group end timestamp to presentation
+ // timestamp.
+ // If mode equals "sequence": Set group start timestamp equal to the group
+ // end timestamp.
+ if (!sequence_mode_) {
+ group_end_timestamp_ = presentation_timestamp;
+
+ // BIG TODO: this needs fixing first!!! Will need to flush before further
+ // buffers are sent to the track buffer in ProcessFrames().
+ // Probably need to rework this to be new_coded_frame_group_, held here.
+
+ // This triggers a discontinuity so we need to treat the next frames
+ // appended within the append window as if they were the beginning of
+ // a new segment.
+ *new_media_segment = true;
+ } else {
+ DVLOG(3) << __FUNCTION__ << " : Sequence mode discontinuity, GETS: "
+ << group_end_timestamp_.InSecondsF();
+ DCHECK(kNoTimestamp() != group_end_timestamp_);
+ group_start_timestamp_ = group_end_timestamp_;
+ }
+
+ Reset();
+ }
+
+ return true;
+}
+
MseTrackBuffer* FrameProcessor::FindTrack(StreamParser::TrackId id) {
TrackBufferMap::iterator itr = track_buffers_.find(id);
if (itr == track_buffers_.end())
« no previous file with comments | « media/filters/frame_processor.h ('k') | media/filters/source_buffer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698