| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 CreateDemuxer("bear.ogv"); | 546 CreateDemuxer("bear.ogv"); |
| 547 InitializeDemuxer(); | 547 InitializeDemuxer(); |
| 548 | 548 |
| 549 // Attempt a read from the video stream and run the message loop until done. | 549 // Attempt a read from the video stream and run the message loop until done. |
| 550 DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO); | 550 DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO); |
| 551 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); | 551 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); |
| 552 | 552 |
| 553 // Run the test twice with a seek in between. | 553 // Run the test twice with a seek in between. |
| 554 for (int i = 0; i < 2; ++i) { | 554 for (int i = 0; i < 2; ++i) { |
| 555 audio->Read( | 555 audio->Read( |
| 556 NewReadCBWithCheckedDiscard(FROM_HERE, 40, 0, kInfiniteDuration(), | 556 NewReadCBWithCheckedDiscard(FROM_HERE, 40, 0, kInfiniteDuration, true)); |
| 557 true)); | |
| 558 base::RunLoop().Run(); | 557 base::RunLoop().Run(); |
| 559 audio->Read( | 558 audio->Read(NewReadCBWithCheckedDiscard(FROM_HERE, 41, 2903, |
| 560 NewReadCBWithCheckedDiscard(FROM_HERE, 41, 2903, kInfiniteDuration(), | 559 kInfiniteDuration, true)); |
| 561 true)); | |
| 562 base::RunLoop().Run(); | 560 base::RunLoop().Run(); |
| 563 audio->Read(NewReadCBWithCheckedDiscard( | 561 audio->Read(NewReadCBWithCheckedDiscard( |
| 564 FROM_HERE, 173, 5805, base::TimeDelta::FromMicroseconds(10159), true)); | 562 FROM_HERE, 173, 5805, base::TimeDelta::FromMicroseconds(10159), true)); |
| 565 base::RunLoop().Run(); | 563 base::RunLoop().Run(); |
| 566 | 564 |
| 567 audio->Read(NewReadCB(FROM_HERE, 148, 18866, true)); | 565 audio->Read(NewReadCB(FROM_HERE, 148, 18866, true)); |
| 568 base::RunLoop().Run(); | 566 base::RunLoop().Run(); |
| 569 EXPECT_EQ(base::TimeDelta::FromMicroseconds(-15964), | 567 EXPECT_EQ(base::TimeDelta::FromMicroseconds(-15964), |
| 570 demuxer_->start_time()); | 568 demuxer_->start_time()); |
| 571 | 569 |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1235 |
| 1238 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]); | 1236 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]); |
| 1239 EXPECT_EQ(audio_track.type(), MediaTrack::Audio); | 1237 EXPECT_EQ(audio_track.type(), MediaTrack::Audio); |
| 1240 EXPECT_EQ(audio_track.bytestream_track_id(), 2); | 1238 EXPECT_EQ(audio_track.bytestream_track_id(), 2); |
| 1241 EXPECT_EQ(audio_track.kind(), "main"); | 1239 EXPECT_EQ(audio_track.kind(), "main"); |
| 1242 EXPECT_EQ(audio_track.label(), ""); | 1240 EXPECT_EQ(audio_track.label(), ""); |
| 1243 EXPECT_EQ(audio_track.language(), ""); | 1241 EXPECT_EQ(audio_track.language(), ""); |
| 1244 } | 1242 } |
| 1245 | 1243 |
| 1246 } // namespace media | 1244 } // namespace media |
| OLD | NEW |