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

Side by Side Diff: media/filters/chunk_demuxer_unittest.cc

Issue 180153003: Implement core of compliant MediaSource coded frame processing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A couple nits, still not ready for review. Created 6 years, 9 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/filters/chunk_demuxer.cc ('k') | media/filters/frame_processor.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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 dst += cluster_a->size(); 1640 dst += cluster_a->size();
1641 1641
1642 memcpy(dst, cluster_b->data(), cluster_b->size()); 1642 memcpy(dst, cluster_b->data(), cluster_b->size());
1643 dst += cluster_b->size(); 1643 dst += cluster_b->size();
1644 1644
1645 AppendDataInPieces(buffer.get(), buffer_size); 1645 AppendDataInPieces(buffer.get(), buffer_size);
1646 1646
1647 GenerateExpectedReads(0, 9); 1647 GenerateExpectedReads(0, 9);
1648 } 1648 }
1649 1649
1650 TEST_F(ChunkDemuxerTest, WebMFile_AudioAndVideo) { 1650 // TODO(acolwell/wolenetz): Re-enable for use with compliant coded frame
1651 // processor (see http://crbug.com/249422) once WebM stream parser fixed to
1652 // always emit frames with valid durations (see http://crbug.com/351166).
1653 TEST_F(ChunkDemuxerTest, DISABLED_WebMFile_AudioAndVideo) {
1651 struct BufferTimestamps buffer_timestamps[] = { 1654 struct BufferTimestamps buffer_timestamps[] = {
1652 {0, 0}, 1655 {0, 0},
1653 {33, 3}, 1656 {33, 3},
1654 {67, 6}, 1657 {67, 6},
1655 {100, 9}, 1658 {100, 9},
1656 {133, 12}, 1659 {133, 12},
1657 {kSkip, kSkip}, 1660 {kSkip, kSkip},
1658 }; 1661 };
1659 1662
1660 // TODO(wolenetz/acolwell): Remove this SetDuration expectation once the 1663 // TODO(wolenetz/acolwell): Remove this SetDuration expectation once the
1661 // file is fixed to have the correct duration in the init segment. 1664 // file is fixed to have the correct duration in the init segment.
1662 // See http://crbug.com/354284. 1665 // See http://crbug.com/354284.
1663 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2744))); 1666 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2744)));
1664 1667
1665 ASSERT_TRUE(ParseWebMFile("bear-320x240.webm", buffer_timestamps, 1668 ASSERT_TRUE(ParseWebMFile("bear-320x240.webm", buffer_timestamps,
1666 base::TimeDelta::FromMilliseconds(2768))); 1669 base::TimeDelta::FromMilliseconds(2768)));
1667 } 1670 }
1668 1671
1669 TEST_F(ChunkDemuxerTest, WebMFile_LiveAudioAndVideo) { 1672 // TODO(acolwell/wolenetz): Re-enable for use with compliant coded frame
1673 // processor (see http://crbug.com/249422) once WebM stream parser fixed to
1674 // always emit frames with valid durations (see http://crbug.com/351166).
1675 TEST_F(ChunkDemuxerTest, DISABLED_WebMFile_LiveAudioAndVideo) {
1670 struct BufferTimestamps buffer_timestamps[] = { 1676 struct BufferTimestamps buffer_timestamps[] = {
1671 {0, 0}, 1677 {0, 0},
1672 {33, 3}, 1678 {33, 3},
1673 {67, 6}, 1679 {67, 6},
1674 {100, 9}, 1680 {100, 9},
1675 {133, 12}, 1681 {133, 12},
1676 {kSkip, kSkip}, 1682 {kSkip, kSkip},
1677 }; 1683 };
1678 1684
1679 ASSERT_TRUE(ParseWebMFile("bear-320x240-live.webm", buffer_timestamps, 1685 ASSERT_TRUE(ParseWebMFile("bear-320x240-live.webm", buffer_timestamps,
1680 kInfiniteDuration())); 1686 kInfiniteDuration()));
1681 } 1687 }
1682 1688
1683 TEST_F(ChunkDemuxerTest, WebMFile_AudioOnly) { 1689 // TODO(acolwell/wolenetz): Re-enable for use with compliant coded frame
1690 // processor (see http://crbug.com/249422) once WebM stream parser fixed to
1691 // always emit frames with valid durations (see http://crbug.com/351166).
1692 TEST_F(ChunkDemuxerTest, DISABLED_WebMFile_AudioOnly) {
1684 struct BufferTimestamps buffer_timestamps[] = { 1693 struct BufferTimestamps buffer_timestamps[] = {
1685 {kSkip, 0}, 1694 {kSkip, 0},
1686 {kSkip, 3}, 1695 {kSkip, 3},
1687 {kSkip, 6}, 1696 {kSkip, 6},
1688 {kSkip, 9}, 1697 {kSkip, 9},
1689 {kSkip, 12}, 1698 {kSkip, 12},
1690 {kSkip, kSkip}, 1699 {kSkip, kSkip},
1691 }; 1700 };
1692 1701
1693 // TODO(wolenetz/acolwell): Remove this SetDuration expectation once the 1702 // TODO(wolenetz/acolwell): Remove this SetDuration expectation once the
1694 // file is fixed to have the correct duration in the init segment. 1703 // file is fixed to have the correct duration in the init segment.
1695 // See http://crbug.com/354284. 1704 // See http://crbug.com/354284.
1696 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2744))); 1705 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2744)));
1697 1706
1698 ASSERT_TRUE(ParseWebMFile("bear-320x240-audio-only.webm", buffer_timestamps, 1707 ASSERT_TRUE(ParseWebMFile("bear-320x240-audio-only.webm", buffer_timestamps,
1699 base::TimeDelta::FromMilliseconds(2768), 1708 base::TimeDelta::FromMilliseconds(2768),
1700 HAS_AUDIO)); 1709 HAS_AUDIO));
1701 } 1710 }
1702 1711
1703 TEST_F(ChunkDemuxerTest, WebMFile_VideoOnly) { 1712 // TODO(acolwell/wolenetz): Re-enable for use with compliant coded frame
1713 // processor (see http://crbug.com/249422) once WebM stream parser fixed to
1714 // always emit frames with valid durations (see http://crbug.com/351166).
1715 TEST_F(ChunkDemuxerTest, DISABLED_WebMFile_VideoOnly) {
1704 struct BufferTimestamps buffer_timestamps[] = { 1716 struct BufferTimestamps buffer_timestamps[] = {
1705 {0, kSkip}, 1717 {0, kSkip},
1706 {33, kSkip}, 1718 {33, kSkip},
1707 {67, kSkip}, 1719 {67, kSkip},
1708 {100, kSkip}, 1720 {100, kSkip},
1709 {133, kSkip}, 1721 {133, kSkip},
1710 {kSkip, kSkip}, 1722 {kSkip, kSkip},
1711 }; 1723 };
1712 1724
1713 // TODO(wolenetz/acolwell): Remove this SetDuration expectation once the 1725 // TODO(wolenetz/acolwell): Remove this SetDuration expectation once the
1714 // file is fixed to have the correct duration in the init segment. 1726 // file is fixed to have the correct duration in the init segment.
1715 // See http://crbug.com/354284. 1727 // See http://crbug.com/354284.
1716 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2703))); 1728 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2703)));
1717 1729
1718 ASSERT_TRUE(ParseWebMFile("bear-320x240-video-only.webm", buffer_timestamps, 1730 ASSERT_TRUE(ParseWebMFile("bear-320x240-video-only.webm", buffer_timestamps,
1719 base::TimeDelta::FromMilliseconds(2737), 1731 base::TimeDelta::FromMilliseconds(2737),
1720 HAS_VIDEO)); 1732 HAS_VIDEO));
1721 } 1733 }
1722 1734
1723 TEST_F(ChunkDemuxerTest, WebMFile_AltRefFrames) { 1735 // TODO(acolwell/wolenetz): Re-enable for use with compliant coded frame
1736 // processor (see http://crbug.com/249422) once WebM stream parser fixed to
1737 // always emit frames with valid durations (see http://crbug.com/351166).
1738 TEST_F(ChunkDemuxerTest, DISABLED_WebMFile_AltRefFrames) {
1724 struct BufferTimestamps buffer_timestamps[] = { 1739 struct BufferTimestamps buffer_timestamps[] = {
1725 {0, 0}, 1740 {0, 0},
1726 {33, 3}, 1741 {33, 3},
1727 {33, 6}, 1742 {33, 6},
1728 {67, 9}, 1743 {67, 9},
1729 {100, 12}, 1744 {100, 12},
1730 {kSkip, kSkip}, 1745 {kSkip, kSkip},
1731 }; 1746 };
1732 1747
1733 // TODO(wolenetz/acolwell): Remove this SetDuration expectation once the 1748 // TODO(wolenetz/acolwell): Remove this SetDuration expectation once the
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
2495 demuxer_->Seek(seek_time, NewExpectedStatusCB(PIPELINE_OK)); 2510 demuxer_->Seek(seek_time, NewExpectedStatusCB(PIPELINE_OK));
2496 2511
2497 GenerateExpectedReads(0, 4); 2512 GenerateExpectedReads(0, 4);
2498 GenerateExpectedReads(46, 66, 5); 2513 GenerateExpectedReads(46, 66, 5);
2499 2514
2500 EndOfStreamHelper end_of_stream_helper(demuxer_.get()); 2515 EndOfStreamHelper end_of_stream_helper(demuxer_.get());
2501 end_of_stream_helper.RequestReads(); 2516 end_of_stream_helper.RequestReads();
2502 end_of_stream_helper.CheckIfReadDonesWereCalled(true); 2517 end_of_stream_helper.CheckIfReadDonesWereCalled(true);
2503 } 2518 }
2504 2519
2505 TEST_F(ChunkDemuxerTest, ConfigChange_Video) { 2520 // TODO(acolwell/wolenetz): Re-enable for use with compliant coded frame
2521 // processor (see http://crbug.com/249422) once WebM stream parser fixed to
2522 // always emit frames with valid durations (see http://crbug.com/351166).
2523 TEST_F(ChunkDemuxerTest, DISABLED_ConfigChange_Video) {
2506 InSequence s; 2524 InSequence s;
2507 2525
2508 ASSERT_TRUE(InitDemuxerWithConfigChangeData()); 2526 ASSERT_TRUE(InitDemuxerWithConfigChangeData());
2509 2527
2510 DemuxerStream::Status status; 2528 DemuxerStream::Status status;
2511 base::TimeDelta last_timestamp; 2529 base::TimeDelta last_timestamp;
2512 2530
2513 DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO); 2531 DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
2514 2532
2515 // Fetch initial video config and verify it matches what we expect. 2533 // Fetch initial video config and verify it matches what we expect.
(...skipping 26 matching lines...) Expand all
2542 ASSERT_TRUE(video_config_1.Matches(video->video_decoder_config())); 2560 ASSERT_TRUE(video_config_1.Matches(video->video_decoder_config()));
2543 2561
2544 ExpectRead(DemuxerStream::VIDEO, 801); 2562 ExpectRead(DemuxerStream::VIDEO, 801);
2545 2563
2546 // Read until the end of the stream just to make sure there aren't any other 2564 // Read until the end of the stream just to make sure there aren't any other
2547 // config changes. 2565 // config changes.
2548 ReadUntilNotOkOrEndOfStream(DemuxerStream::VIDEO, &status, &last_timestamp); 2566 ReadUntilNotOkOrEndOfStream(DemuxerStream::VIDEO, &status, &last_timestamp);
2549 ASSERT_EQ(status, DemuxerStream::kOk); 2567 ASSERT_EQ(status, DemuxerStream::kOk);
2550 } 2568 }
2551 2569
2552 TEST_F(ChunkDemuxerTest, ConfigChange_Audio) { 2570 // TODO(acolwell/wolenetz): Re-enable for use with compliant coded frame
2571 // processor (see http://crbug.com/249422) once WebM stream parser fixed to
2572 // always emit frames with valid durations (see http://crbug.com/351166).
2573 TEST_F(ChunkDemuxerTest, DISABLED_ConfigChange_Audio) {
2553 InSequence s; 2574 InSequence s;
2554 2575
2555 ASSERT_TRUE(InitDemuxerWithConfigChangeData()); 2576 ASSERT_TRUE(InitDemuxerWithConfigChangeData());
2556 2577
2557 DemuxerStream::Status status; 2578 DemuxerStream::Status status;
2558 base::TimeDelta last_timestamp; 2579 base::TimeDelta last_timestamp;
2559 2580
2560 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); 2581 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
2561 2582
2562 // Fetch initial audio config and verify it matches what we expect. 2583 // Fetch initial audio config and verify it matches what we expect.
(...skipping 26 matching lines...) Expand all
2589 ASSERT_TRUE(audio_config_1.Matches(audio->audio_decoder_config())); 2610 ASSERT_TRUE(audio_config_1.Matches(audio->audio_decoder_config()));
2590 2611
2591 ExpectRead(DemuxerStream::AUDIO, 779); 2612 ExpectRead(DemuxerStream::AUDIO, 779);
2592 2613
2593 // Read until the end of the stream just to make sure there aren't any other 2614 // Read until the end of the stream just to make sure there aren't any other
2594 // config changes. 2615 // config changes.
2595 ReadUntilNotOkOrEndOfStream(DemuxerStream::AUDIO, &status, &last_timestamp); 2616 ReadUntilNotOkOrEndOfStream(DemuxerStream::AUDIO, &status, &last_timestamp);
2596 ASSERT_EQ(status, DemuxerStream::kOk); 2617 ASSERT_EQ(status, DemuxerStream::kOk);
2597 } 2618 }
2598 2619
2599 TEST_F(ChunkDemuxerTest, ConfigChange_Seek) { 2620 // TODO(acolwell/wolenetz): Re-enable for use with compliant coded frame
2621 // processor (see http://crbug.com/249422) once WebM stream parser fixed to
2622 // always emit frames with valid durations (see http://crbug.com/351166).
2623 TEST_F(ChunkDemuxerTest, DISABLED_ConfigChange_Seek) {
2600 InSequence s; 2624 InSequence s;
2601 2625
2602 ASSERT_TRUE(InitDemuxerWithConfigChangeData()); 2626 ASSERT_TRUE(InitDemuxerWithConfigChangeData());
2603 2627
2604 DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO); 2628 DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
2605 2629
2606 // Fetch initial video config and verify it matches what we expect. 2630 // Fetch initial video config and verify it matches what we expect.
2607 const VideoDecoderConfig& video_config_1 = video->video_decoder_config(); 2631 const VideoDecoderConfig& video_config_1 = video->video_decoder_config();
2608 ASSERT_TRUE(video_config_1.IsValidConfig()); 2632 ASSERT_TRUE(video_config_1.IsValidConfig());
2609 EXPECT_EQ(video_config_1.natural_size().width(), 320); 2633 EXPECT_EQ(video_config_1.natural_size().width(), 320);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
2746 // Add data leading up to the currently set duration. 2770 // Add data leading up to the currently set duration.
2747 AppendCluster(GenerateCluster(kStreamDuration - kAudioBlockDuration, 2771 AppendCluster(GenerateCluster(kStreamDuration - kAudioBlockDuration,
2748 kStreamDuration - kVideoBlockDuration, 2772 kStreamDuration - kVideoBlockDuration,
2749 2)); 2773 2));
2750 2774
2751 CheckExpectedRanges(kSourceId, "{ [201191,201224) }"); 2775 CheckExpectedRanges(kSourceId, "{ [201191,201224) }");
2752 2776
2753 // Add data beginning at the currently set duration and expect a new duration 2777 // Add data beginning at the currently set duration and expect a new duration
2754 // to be signaled. Note that the last video block will have a higher end 2778 // to be signaled. Note that the last video block will have a higher end
2755 // timestamp than the last audio block. 2779 // timestamp than the last audio block.
2756 // TODO(wolenetz): Compliant coded frame processor will emit a max of one
2757 // duration change per each ProcessFrames(). Remove the first expectation here
2758 // once compliant coded frame processor is used. See http://crbug.com/249422.
2759 const int kNewStreamDurationAudio = kStreamDuration + kAudioBlockDuration;
2760 EXPECT_CALL(host_, SetDuration(
2761 base::TimeDelta::FromMilliseconds(kNewStreamDurationAudio)));
2762 const int kNewStreamDurationVideo = kStreamDuration + kVideoBlockDuration; 2780 const int kNewStreamDurationVideo = kStreamDuration + kVideoBlockDuration;
2763 EXPECT_CALL(host_, SetDuration( 2781 EXPECT_CALL(host_, SetDuration(
2764 base::TimeDelta::FromMilliseconds(kNewStreamDurationVideo))); 2782 base::TimeDelta::FromMilliseconds(kNewStreamDurationVideo)));
2765 AppendCluster(GenerateCluster(kDefaultDuration().InMilliseconds(), 2)); 2783 AppendCluster(GenerateCluster(kDefaultDuration().InMilliseconds(), 2));
2766 2784
2767 CheckExpectedRanges(kSourceId, "{ [201191,201247) }"); 2785 CheckExpectedRanges(kSourceId, "{ [201191,201247) }");
2768 2786
2769 // Add more data to the end of each media type. Note that the last audio block 2787 // Add more data to the end of each media type. Note that the last audio block
2770 // will have a higher end timestamp than the last video block. 2788 // will have a higher end timestamp than the last video block.
2771 const int kFinalStreamDuration = kStreamDuration + kAudioBlockDuration * 3; 2789 const int kFinalStreamDuration = kStreamDuration + kAudioBlockDuration * 3;
2772 EXPECT_CALL(host_, SetDuration( 2790 EXPECT_CALL(host_, SetDuration(
2773 base::TimeDelta::FromMilliseconds(kFinalStreamDuration))); 2791 base::TimeDelta::FromMilliseconds(kFinalStreamDuration)));
2774 AppendCluster(GenerateCluster(kStreamDuration + kAudioBlockDuration, 2792 AppendCluster(GenerateCluster(kStreamDuration + kAudioBlockDuration,
2775 kStreamDuration + kVideoBlockDuration, 2793 kStreamDuration + kVideoBlockDuration,
2776 3)); 2794 3));
2777 2795
2778 // See that the range has increased appropriately (but not to the full 2796 // See that the range has increased appropriately (but not to the full
2779 // duration of 201293, since there is not enough video appended for that). 2797 // duration of 201293, since there is not enough video appended for that).
2780 CheckExpectedRanges(kSourceId, "{ [201191,201290) }"); 2798 CheckExpectedRanges(kSourceId, "{ [201191,201290) }");
2781 } 2799 }
2782 2800
2783 TEST_F(ChunkDemuxerTest, DurationChangeTimestampOffset) { 2801 TEST_F(ChunkDemuxerTest, DurationChangeTimestampOffset) {
2784 ASSERT_TRUE(InitDemuxer(HAS_AUDIO | HAS_VIDEO)); 2802 ASSERT_TRUE(InitDemuxer(HAS_AUDIO | HAS_VIDEO));
2785 2803
2786 ASSERT_TRUE(SetTimestampOffset(kSourceId, kDefaultDuration())); 2804 ASSERT_TRUE(SetTimestampOffset(kSourceId, kDefaultDuration()));
2787 2805
2788 // TODO(wolenetz): Compliant coded frame processor will emit a max of one
2789 // duration change per each ProcessFrames(). Remove the first expectation here
2790 // once compliant coded frame processor is used. See http://crbug.com/249422.
2791 EXPECT_CALL(host_, SetDuration(
2792 kDefaultDuration() + base::TimeDelta::FromMilliseconds(
2793 kAudioBlockDuration * 2)));
2794 EXPECT_CALL(host_, SetDuration( 2806 EXPECT_CALL(host_, SetDuration(
2795 kDefaultDuration() + base::TimeDelta::FromMilliseconds( 2807 kDefaultDuration() + base::TimeDelta::FromMilliseconds(
2796 kVideoBlockDuration * 2))); 2808 kVideoBlockDuration * 2)));
2797 AppendCluster(GenerateCluster(0, 4)); 2809 AppendCluster(GenerateCluster(0, 4));
2798 } 2810 }
2799 2811
2800 TEST_F(ChunkDemuxerTest, EndOfStreamTruncateDuration) { 2812 TEST_F(ChunkDemuxerTest, EndOfStreamTruncateDuration) {
2801 ASSERT_TRUE(InitDemuxer(HAS_AUDIO | HAS_VIDEO)); 2813 ASSERT_TRUE(InitDemuxer(HAS_AUDIO | HAS_VIDEO));
2802 2814
2803 AppendCluster(kDefaultFirstCluster()); 2815 AppendCluster(kDefaultFirstCluster());
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
3165 AppendSingleStreamCluster(kSourceId, kAudioTrackNum, 3177 AppendSingleStreamCluster(kSourceId, kAudioTrackNum,
3166 "0K 20K 40K 60K 80K 100K 120K 140K 160K 180K"); 3178 "0K 20K 40K 60K 80K 100K 120K 140K 160K 180K");
3167 AppendSingleStreamCluster(kSourceId, kVideoTrackNum, 3179 AppendSingleStreamCluster(kSourceId, kVideoTrackNum,
3168 "0K 30 60 90K 120K 150 180 210"); 3180 "0K 30 60 90K 120K 150 180 210");
3169 3181
3170 message_loop_.RunUntilIdle(); 3182 message_loop_.RunUntilIdle();
3171 EXPECT_TRUE(seek_cb_was_called); 3183 EXPECT_TRUE(seek_cb_was_called);
3172 EXPECT_FALSE(text_read_done); 3184 EXPECT_FALSE(text_read_done);
3173 3185
3174 // Read some audio & video buffers to further verify seek completion. 3186 // Read some audio & video buffers to further verify seek completion.
3175 CheckExpectedBuffers(audio_stream, "120 140"); 3187 // Note that audio frame duration is 23ms, so post-seek, the first audio
wolenetz 2014/03/20 19:36:40 acolwell@: Note, this is the interesting discrepan
wolenetz 2014/03/28 19:36:38 Once rebased onto my webm frame duration deriver/e
3176 CheckExpectedBuffers(video_stream, "120 150"); 3188 // frame returned is the one beginning at time 100 (that is end-overlapped
3189 // by the next frame at time 120). Similarly, the first video frame returned
3190 // is the one beginning at time 90 (that is end-overlapped by the next frame
3191 // at time 120).
3192 CheckExpectedBuffers(audio_stream, "100 120 140");
3193 CheckExpectedBuffers(video_stream, "90 120 150");
3177 3194
3178 EXPECT_FALSE(text_read_done); 3195 EXPECT_FALSE(text_read_done);
3179 3196
3180 // Append text cues that start after the seek point and verify that 3197 // Append text cues that start after the seek point and verify that
3181 // they are returned by Read() calls. 3198 // they are returned by Read() calls.
3182 AppendSingleStreamCluster(kSourceId, kTextTrackNum, "125K 175K 225K"); 3199 AppendSingleStreamCluster(kSourceId, kTextTrackNum, "125K 175K 225K");
3183 3200
3184 message_loop_.RunUntilIdle(); 3201 message_loop_.RunUntilIdle();
3185 EXPECT_TRUE(text_read_done); 3202 EXPECT_TRUE(text_read_done);
3186 3203
3187 // NOTE: we start at 175 here because the buffer at 125 was returned 3204 // NOTE: we start at 175 here because the buffer at 125 was returned
3188 // to the pending read initiated above. 3205 // to the pending read initiated above.
3189 CheckExpectedBuffers(text_stream, "175 225"); 3206 CheckExpectedBuffers(text_stream, "175 225");
3190 3207
3191 // Verify that audio & video streams continue to return expected values. 3208 // Verify that audio & video streams continue to return expected values.
3192 CheckExpectedBuffers(audio_stream, "160 180"); 3209 CheckExpectedBuffers(audio_stream, "160 180");
3193 CheckExpectedBuffers(video_stream, "180 210"); 3210 CheckExpectedBuffers(video_stream, "180 210");
3194 } 3211 }
3195 3212
3196 } // namespace media 3213 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/frame_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698