OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/filters/frame_processor.h" | 5 #include "media/filters/frame_processor.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cstdlib> | 9 #include <cstdlib> |
10 | 10 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 const scoped_refptr<StreamParserBuffer>& frame, | 452 const scoped_refptr<StreamParserBuffer>& frame, |
453 base::TimeDelta append_window_start, | 453 base::TimeDelta append_window_start, |
454 base::TimeDelta append_window_end, | 454 base::TimeDelta append_window_end, |
455 base::TimeDelta* timestamp_offset) { | 455 base::TimeDelta* timestamp_offset) { |
456 // Implements the loop within step 1 of the coded frame processing algorithm | 456 // Implements the loop within step 1 of the coded frame processing algorithm |
457 // for a single input frame per June 9, 2016 MSE spec editor's draft: | 457 // for a single input frame per June 9, 2016 MSE spec editor's draft: |
458 // https://rawgit.com/w3c/media-source/d8f901f22/ | 458 // https://rawgit.com/w3c/media-source/d8f901f22/ |
459 // index.html#sourcebuffer-coded-frame-processing | 459 // index.html#sourcebuffer-coded-frame-processing |
460 while (true) { | 460 while (true) { |
461 // 1. Loop Top: | 461 // 1. Loop Top: |
462 // Otherwise case: (See MediaSourceState's |auto_update_timestamp_offset_|, | 462 // Otherwise case: (See SourceBufferState's |auto_update_timestamp_offset_|, |
463 // too). | 463 // too). |
464 // 1.1. Let presentation timestamp be a double precision floating point | 464 // 1.1. Let presentation timestamp be a double precision floating point |
465 // representation of the coded frame's presentation timestamp in | 465 // representation of the coded frame's presentation timestamp in |
466 // seconds. | 466 // seconds. |
467 // 1.2. Let decode timestamp be a double precision floating point | 467 // 1.2. Let decode timestamp be a double precision floating point |
468 // representation of the coded frame's decode timestamp in seconds. | 468 // representation of the coded frame's decode timestamp in seconds. |
469 // 2. Let frame duration be a double precision floating point representation | 469 // 2. Let frame duration be a double precision floating point representation |
470 // of the coded frame's duration in seconds. | 470 // of the coded frame's duration in seconds. |
471 // We use base::TimeDelta and DecodeTimestamp instead of double. | 471 // We use base::TimeDelta and DecodeTimestamp instead of double. |
472 base::TimeDelta presentation_timestamp = frame->timestamp(); | 472 base::TimeDelta presentation_timestamp = frame->timestamp(); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 // timestamp. | 728 // timestamp. |
729 track_buffer->SetHighestPresentationTimestampIfIncreased( | 729 track_buffer->SetHighestPresentationTimestampIfIncreased( |
730 frame_end_timestamp); | 730 frame_end_timestamp); |
731 | 731 |
732 // 20. If frame end timestamp is greater than group end timestamp, then set | 732 // 20. If frame end timestamp is greater than group end timestamp, then set |
733 // group end timestamp equal to frame end timestamp. | 733 // group end timestamp equal to frame end timestamp. |
734 if (frame_end_timestamp > group_end_timestamp_) | 734 if (frame_end_timestamp > group_end_timestamp_) |
735 group_end_timestamp_ = frame_end_timestamp; | 735 group_end_timestamp_ = frame_end_timestamp; |
736 DCHECK(group_end_timestamp_ >= base::TimeDelta()); | 736 DCHECK(group_end_timestamp_ >= base::TimeDelta()); |
737 | 737 |
738 // Step 21 is currently handled differently. See MediaSourceState's | 738 // Step 21 is currently handled differently. See SourceBufferState's |
739 // |auto_update_timestamp_offset_|. | 739 // |auto_update_timestamp_offset_|. |
740 return true; | 740 return true; |
741 } | 741 } |
742 | 742 |
743 NOTREACHED(); | 743 NOTREACHED(); |
744 return false; | 744 return false; |
745 } | 745 } |
746 | 746 |
747 } // namespace media | 747 } // namespace media |
OLD | NEW |