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