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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "media/base/cdm_callback_promise.h" | 10 #include "media/base/cdm_callback_promise.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, | 84 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, |
85 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35 | 85 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35 |
86 }; | 86 }; |
87 | 87 |
88 const int kAppendWholeFile = -1; | 88 const int kAppendWholeFile = -1; |
89 | 89 |
90 // Constants for the Media Source config change tests. | 90 // Constants for the Media Source config change tests. |
91 const int kAppendTimeSec = 1; | 91 const int kAppendTimeSec = 1; |
92 const int kAppendTimeMs = kAppendTimeSec * 1000; | 92 const int kAppendTimeMs = kAppendTimeSec * 1000; |
93 const int k320WebMFileDurationMs = 2736; | 93 const int k320WebMFileDurationMs = 2736; |
| 94 #if !defined(DISABLE_EME_TESTS) |
| 95 const int k320EncWebMFileDurationMs = 2737; |
| 96 #endif // !defined(DISABLE_EME_TESTS) |
94 const int k640WebMFileDurationMs = 2749; | 97 const int k640WebMFileDurationMs = 2749; |
95 const int kOpusEndTrimmingWebMFileDurationMs = 2741; | 98 const int kOpusEndTrimmingWebMFileDurationMs = 2741; |
96 const int kVP9WebMFileDurationMs = 2736; | 99 const int kVP9WebMFileDurationMs = 2736; |
97 const int kVP8AWebMFileDurationMs = 2733; | 100 const int kVP8AWebMFileDurationMs = 2734; |
98 | 101 |
99 #if defined(USE_PROPRIETARY_CODECS) | 102 #if defined(USE_PROPRIETARY_CODECS) |
100 #if !defined(DISABLE_EME_TESTS) | 103 #if !defined(DISABLE_EME_TESTS) |
101 const int k640IsoFileDurationMs = 2737; | 104 const int k640IsoFileDurationMs = 2737; |
102 const int k640IsoCencFileDurationMs = 2736; | 105 const int k640IsoCencFileDurationMs = 2736; |
103 #endif // !defined(DISABLE_EME_TESTS) | 106 #endif // !defined(DISABLE_EME_TESTS) |
104 const int k1280IsoFileDurationMs = 2736; | 107 const int k1280IsoFileDurationMs = 2736; |
105 const int k1280IsoAVC3FileDurationMs = 2736; | 108 const int k1280IsoAVC3FileDurationMs = 2736; |
106 #endif // defined(USE_PROPRIETARY_CODECS) | 109 #endif // defined(USE_PROPRIETARY_CODECS) |
107 | 110 |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 ReadTestDataFile("bear-640x360.webm"); | 1051 ReadTestDataFile("bear-640x360.webm"); |
1049 | 1052 |
1050 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), | 1053 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), |
1051 second_file->data(), second_file->data_size()); | 1054 second_file->data(), second_file->data_size()); |
1052 | 1055 |
1053 source.EndOfStream(); | 1056 source.EndOfStream(); |
1054 | 1057 |
1055 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 1058 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
1056 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 1059 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
1057 // The second video was not added, so its time has not been added. | 1060 // The second video was not added, so its time has not been added. |
1058 EXPECT_EQ(k320WebMFileDurationMs, | 1061 EXPECT_EQ(k320EncWebMFileDurationMs, |
1059 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 1062 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
1060 | 1063 |
1061 Play(); | 1064 Play(); |
1062 | 1065 |
1063 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); | 1066 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); |
1064 source.Abort(); | 1067 source.Abort(); |
1065 } | 1068 } |
1066 #endif // !defined(DISABLE_EME_TESTS) | 1069 #endif // !defined(DISABLE_EME_TESTS) |
1067 | 1070 |
1068 #if defined(USE_PROPRIETARY_CODECS) | 1071 #if defined(USE_PROPRIETARY_CODECS) |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 | 1737 |
1735 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 1738 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
1736 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 1739 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
1737 Play(); | 1740 Play(); |
1738 ASSERT_TRUE(WaitUntilOnEnded()); | 1741 ASSERT_TRUE(WaitUntilOnEnded()); |
1739 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 1742 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
1740 demuxer_->GetStartTime()); | 1743 demuxer_->GetStartTime()); |
1741 } | 1744 } |
1742 | 1745 |
1743 } // namespace media | 1746 } // namespace media |
OLD | NEW |