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 "media/filters/pipeline_integration_test_base.h" | 5 #include "media/filters/pipeline_integration_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 }; | 54 }; |
55 | 55 |
56 const int kAppendWholeFile = -1; | 56 const int kAppendWholeFile = -1; |
57 | 57 |
58 // Constants for the Media Source config change tests. | 58 // Constants for the Media Source config change tests. |
59 const int kAppendTimeSec = 1; | 59 const int kAppendTimeSec = 1; |
60 const int kAppendTimeMs = kAppendTimeSec * 1000; | 60 const int kAppendTimeMs = kAppendTimeSec * 1000; |
61 const int k320WebMFileDurationMs = 2737; | 61 const int k320WebMFileDurationMs = 2737; |
62 const int k640WebMFileDurationMs = 2763; | 62 const int k640WebMFileDurationMs = 2763; |
63 const int kOpusEndTrimmingWebMFileDurationMs = 2771; | 63 const int kOpusEndTrimmingWebMFileDurationMs = 2771; |
64 const int kVP9WebMFileDurationMs = 2703; | 64 const int kVP9WebMFileDurationMs = 2737; |
65 const int kVP8AWebMFileDurationMs = 2700; | 65 const int kVP8AWebMFileDurationMs = 2734; |
66 | 66 |
67 #if defined(USE_PROPRIETARY_CODECS) | 67 #if defined(USE_PROPRIETARY_CODECS) |
68 const int k640IsoFileDurationMs = 2737; | 68 const int k640IsoFileDurationMs = 2737; |
69 const int k640IsoCencFileDurationMs = 2736; | 69 const int k640IsoCencFileDurationMs = 2736; |
70 const int k1280IsoFileDurationMs = 2736; | 70 const int k1280IsoFileDurationMs = 2736; |
71 const int k1280IsoAVC3FileDurationMs = 2735; | 71 const int k1280IsoAVC3FileDurationMs = 2736; |
72 #endif // defined(USE_PROPRIETARY_CODECS) | 72 #endif // defined(USE_PROPRIETARY_CODECS) |
73 | 73 |
74 // Note: Tests using this class only exercise the DecryptingDemuxerStream path. | 74 // Note: Tests using this class only exercise the DecryptingDemuxerStream path. |
75 // They do not exercise the Decrypting{Audio|Video}Decoder path. | 75 // They do not exercise the Decrypting{Audio|Video}Decoder path. |
76 class FakeEncryptedMedia { | 76 class FakeEncryptedMedia { |
77 public: | 77 public: |
78 // Defines the behavior of the "app" that responds to EME events. | 78 // Defines the behavior of the "app" that responds to EME events. |
79 class AppBase { | 79 class AppBase { |
80 public: | 80 public: |
81 virtual ~AppBase() {} | 81 virtual ~AppBase() {} |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 | 566 |
567 TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_Opus_WebM) { | 567 TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_Opus_WebM) { |
568 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); | 568 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); |
569 MockMediaSource source("bear-opus-end-trimming.webm", kOpusAudioOnlyWebM, | 569 MockMediaSource source("bear-opus-end-trimming.webm", kOpusAudioOnlyWebM, |
570 kAppendWholeFile); | 570 kAppendWholeFile); |
571 StartPipelineWithMediaSource(&source); | 571 StartPipelineWithMediaSource(&source); |
572 source.EndOfStream(); | 572 source.EndOfStream(); |
573 | 573 |
574 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 574 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
575 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 575 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
576 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs, | 576 // TODO(acolwell/wolenetz): Drop the "+ 1" once WebM stream parser always |
| 577 // emits frames with valid durations (see http://crbug.com/351166) and |
| 578 // compliant coded frame processor's "highest presentation end timestamp" is |
| 579 // used to update duration (see http://crbug.com/249422). |
| 580 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs + 1, |
577 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 581 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
578 Play(); | 582 Play(); |
579 | 583 |
580 ASSERT_TRUE(WaitUntilOnEnded()); | 584 ASSERT_TRUE(WaitUntilOnEnded()); |
581 source.Abort(); | 585 source.Abort(); |
582 Stop(); | 586 Stop(); |
583 } | 587 } |
584 | 588 |
585 // Flaky. http://crbug.com/304776 | 589 // Flaky. http://crbug.com/304776 |
586 TEST_F(PipelineIntegrationTest, DISABLED_MediaSource_Opus_Seeking_WebM) { | 590 TEST_F(PipelineIntegrationTest, DISABLED_MediaSource_Opus_Seeking_WebM) { |
587 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); | 591 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); |
588 MockMediaSource source("bear-opus-end-trimming.webm", kOpusAudioOnlyWebM, | 592 MockMediaSource source("bear-opus-end-trimming.webm", kOpusAudioOnlyWebM, |
589 kAppendWholeFile); | 593 kAppendWholeFile); |
590 StartHashedPipelineWithMediaSource(&source); | 594 StartHashedPipelineWithMediaSource(&source); |
591 | 595 |
592 | 596 |
593 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 597 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
594 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 598 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
595 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs, | 599 // TODO(acolwell/wolenetz): Drop the "+ 1" once WebM stream parser always |
| 600 // emits frames with valid durations (see http://crbug.com/351166) and |
| 601 // compliant coded frame processor's "highest presentation end timestamp" is |
| 602 // used to update duration (see http://crbug.com/249422). |
| 603 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs + 1, |
596 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 604 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
597 | 605 |
598 base::TimeDelta start_seek_time = base::TimeDelta::FromMilliseconds(1000); | 606 base::TimeDelta start_seek_time = base::TimeDelta::FromMilliseconds(1000); |
599 base::TimeDelta seek_time = base::TimeDelta::FromMilliseconds(2000); | 607 base::TimeDelta seek_time = base::TimeDelta::FromMilliseconds(2000); |
600 | 608 |
601 Play(); | 609 Play(); |
602 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); | 610 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); |
603 source.Seek(seek_time, 0x1D5, 34017); | 611 source.Seek(seek_time, 0x1D5, 34017); |
604 source.EndOfStream(); | 612 source.EndOfStream(); |
605 ASSERT_TRUE(Seek(seek_time)); | 613 ASSERT_TRUE(Seek(seek_time)); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 // Verify that VP8 video with inband text track can be played back. | 1189 // Verify that VP8 video with inband text track can be played back. |
1182 TEST_F(PipelineIntegrationTest, | 1190 TEST_F(PipelineIntegrationTest, |
1183 BasicPlayback_VP8_WebVTT_WebM) { | 1191 BasicPlayback_VP8_WebVTT_WebM) { |
1184 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), | 1192 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), |
1185 PIPELINE_OK)); | 1193 PIPELINE_OK)); |
1186 Play(); | 1194 Play(); |
1187 ASSERT_TRUE(WaitUntilOnEnded()); | 1195 ASSERT_TRUE(WaitUntilOnEnded()); |
1188 } | 1196 } |
1189 | 1197 |
1190 } // namespace media | 1198 } // namespace media |
OLD | NEW |