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

Side by Side Diff: media/mp4/track_run_iterator_unittest.cc

Issue 20123002: Add Chromium-side support for SourceBuffer.appendWindowStart and SourceBuffer.appendWindowEnd. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and remove URL in comment to make presubmit happy. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/mp4/track_run_iterator.cc ('k') | media/webm/webm_stream_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "media/mp4/box_definitions.h" 8 #include "media/mp4/box_definitions.h"
9 #include "media/mp4/rcheck.h" 9 #include "media/mp4/rcheck.h"
10 #include "media/mp4/track_run_iterator.h" 10 #include "media/mp4/track_run_iterator.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 moof.tracks[1].header.default_sample_flags = 244 moof.tracks[1].header.default_sample_flags =
245 kSampleIsDifferenceSampleFlagMask; 245 kSampleIsDifferenceSampleFlagMask;
246 moof.tracks[1].runs[0].sample_flags.resize(1); 246 moof.tracks[1].runs[0].sample_flags.resize(1);
247 ASSERT_TRUE(iter_->Init(moof)); 247 ASSERT_TRUE(iter_->Init(moof));
248 iter_->AdvanceRun(); 248 iter_->AdvanceRun();
249 EXPECT_TRUE(iter_->is_keyframe()); 249 EXPECT_TRUE(iter_->is_keyframe());
250 iter_->AdvanceSample(); 250 iter_->AdvanceSample();
251 EXPECT_FALSE(iter_->is_keyframe()); 251 EXPECT_FALSE(iter_->is_keyframe());
252 } 252 }
253 253
254 TEST_F(TrackRunIteratorTest, MinDecodeTest) {
255 iter_.reset(new TrackRunIterator(&moov_, log_cb_));
256 MovieFragment moof = CreateFragment();
257 moof.tracks[0].decode_time.decode_time = kAudioScale;
258 ASSERT_TRUE(iter_->Init(moof));
259 EXPECT_EQ(TimeDeltaFromRational(moof.tracks[1].decode_time.decode_time,
260 kVideoScale),
261 iter_->GetMinDecodeTimestamp());
262 }
263
264 TEST_F(TrackRunIteratorTest, ReorderingTest) { 254 TEST_F(TrackRunIteratorTest, ReorderingTest) {
265 // Test frame reordering and edit list support. The frames have the following 255 // Test frame reordering and edit list support. The frames have the following
266 // decode timestamps: 256 // decode timestamps:
267 // 257 //
268 // 0ms 40ms 120ms 240ms 258 // 0ms 40ms 120ms 240ms
269 // | 0 | 1 - | 2 - - | 259 // | 0 | 1 - | 2 - - |
270 // 260 //
271 // ...and these composition timestamps, after edit list adjustment: 261 // ...and these composition timestamps, after edit list adjustment:
272 // 262 //
273 // 0ms 40ms 160ms 240ms 263 // 0ms 40ms 160ms 240ms
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 EXPECT_EQ(iter_->track_id(), 1u); 428 EXPECT_EQ(iter_->track_id(), 1u);
439 EXPECT_EQ(iter_->aux_info_offset(), 201); 429 EXPECT_EQ(iter_->aux_info_offset(), 201);
440 EXPECT_EQ(iter_->sample_offset(), 10000); 430 EXPECT_EQ(iter_->sample_offset(), 10000);
441 EXPECT_EQ(iter_->GetMaxClearOffset(), 201); 431 EXPECT_EQ(iter_->GetMaxClearOffset(), 201);
442 EXPECT_TRUE(iter_->CacheAuxInfo(kAuxInfo, arraysize(kAuxInfo))); 432 EXPECT_TRUE(iter_->CacheAuxInfo(kAuxInfo, arraysize(kAuxInfo)));
443 EXPECT_EQ(iter_->GetMaxClearOffset(), 10000); 433 EXPECT_EQ(iter_->GetMaxClearOffset(), 10000);
444 } 434 }
445 435
446 } // namespace mp4 436 } // namespace mp4
447 } // namespace media 437 } // namespace media
OLDNEW
« no previous file with comments | « media/mp4/track_run_iterator.cc ('k') | media/webm/webm_stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698