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

Unified Diff: media/mp4/track_run_iterator_unittest.cc

Issue 10832176: Add initial support for edit lists in MSE BMFF. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Counting? Who needs counting? Created 8 years, 4 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
« media/mp4/track_run_iterator.cc ('K') | « media/mp4/track_run_iterator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp4/track_run_iterator_unittest.cc
diff --git a/media/mp4/track_run_iterator_unittest.cc b/media/mp4/track_run_iterator_unittest.cc
index e1c1a03e53c4b8535fd29efa6d7f590277f49325..2abca66e09278006f18c4ced68f3e45d0ab26786 100644
--- a/media/mp4/track_run_iterator_unittest.cc
+++ b/media/mp4/track_run_iterator_unittest.cc
@@ -261,23 +261,45 @@ TEST_F(TrackRunIteratorTest, MinDecodeTest) {
}
TEST_F(TrackRunIteratorTest, ReorderingTest) {
+ // Test frame reordering and edit list support. The frames have the following
+ // decode timestamps:
+ //
+ // 0ms 40ms 120ms 240ms
+ // | 0 | 1 - | 2 - - |
+ //
+ // ...and these composition timestamps, after edit list adjustment:
+ //
+ // 0ms 40ms 160ms 240ms
+ // | 0 | 2 - - | 1 - |
+ //
iter_.reset(new TrackRunIterator(&moov_));
+ EditListEntry entry;
acolwell GONE FROM CHROMIUM 2012/08/07 20:12:13 I don't really understand what is happening here.
strobe_ 2012/08/07 22:54:39 Done.
+ entry.segment_duration = 0;
+ entry.media_time = 2;
+ entry.media_rate_integer = 1;
+ entry.media_rate_fraction = 0;
+ moov_.tracks[1].edit.list.edits.push_back(entry);
MovieFragment moof = CreateFragment();
std::vector<int32>& cts_offsets =
moof.tracks[1].runs[0].sample_composition_time_offsets;
cts_offsets.resize(10);
cts_offsets[0] = 2;
acolwell GONE FROM CHROMIUM 2012/08/07 20:12:13 Documenting these values would be nice as well. It
strobe_ 2012/08/07 22:54:39 Done.
- cts_offsets[1] = -1;
+ cts_offsets[1] = 5;
+ cts_offsets[2] = 0;
moof.tracks[1].decode_time.decode_time = 0;
ASSERT_TRUE(iter_->Init(moof));
iter_->AdvanceRun();
EXPECT_EQ(iter_->dts(), TimeDeltaFromRational(0, kVideoScale));
- EXPECT_EQ(iter_->cts(), TimeDeltaFromRational(2, kVideoScale));
+ EXPECT_EQ(iter_->cts(), TimeDeltaFromRational(0, kVideoScale));
EXPECT_EQ(iter_->duration(), TimeDeltaFromRational(1, kVideoScale));
iter_->AdvanceSample();
EXPECT_EQ(iter_->dts(), TimeDeltaFromRational(1, kVideoScale));
- EXPECT_EQ(iter_->cts(), TimeDeltaFromRational(0, kVideoScale));
+ EXPECT_EQ(iter_->cts(), TimeDeltaFromRational(4, kVideoScale));
EXPECT_EQ(iter_->duration(), TimeDeltaFromRational(2, kVideoScale));
+ iter_->AdvanceSample();
+ EXPECT_EQ(iter_->dts(), TimeDeltaFromRational(3, kVideoScale));
+ EXPECT_EQ(iter_->cts(), TimeDeltaFromRational(1, kVideoScale));
+ EXPECT_EQ(iter_->duration(), TimeDeltaFromRational(3, kVideoScale));
}
TEST_F(TrackRunIteratorTest, IgnoreUnknownAuxInfoTest) {
« media/mp4/track_run_iterator.cc ('K') | « media/mp4/track_run_iterator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698