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 const int k320EncWebMFileDurationMs = 2737; |
94 const int k640WebMFileDurationMs = 2749; | 95 const int k640WebMFileDurationMs = 2749; |
95 const int kOpusEndTrimmingWebMFileDurationMs = 2741; | 96 const int kOpusEndTrimmingWebMFileDurationMs = 2741; |
96 const int kVP9WebMFileDurationMs = 2736; | 97 const int kVP9WebMFileDurationMs = 2736; |
97 const int kVP8AWebMFileDurationMs = 2733; | 98 const int kVP8AWebMFileDurationMs = 2734; |
98 | 99 |
99 #if defined(USE_PROPRIETARY_CODECS) | 100 #if defined(USE_PROPRIETARY_CODECS) |
100 #if !defined(DISABLE_EME_TESTS) | 101 #if !defined(DISABLE_EME_TESTS) |
101 const int k640IsoFileDurationMs = 2737; | 102 const int k640IsoFileDurationMs = 2737; |
102 const int k640IsoCencFileDurationMs = 2736; | 103 const int k640IsoCencFileDurationMs = 2736; |
103 #endif // !defined(DISABLE_EME_TESTS) | 104 #endif // !defined(DISABLE_EME_TESTS) |
104 const int k1280IsoFileDurationMs = 2736; | 105 const int k1280IsoFileDurationMs = 2736; |
105 const int k1280IsoAVC3FileDurationMs = 2736; | 106 const int k1280IsoAVC3FileDurationMs = 2736; |
106 #endif // defined(USE_PROPRIETARY_CODECS) | 107 #endif // defined(USE_PROPRIETARY_CODECS) |
107 | 108 |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 ReadTestDataFile("bear-640x360.webm"); | 1054 ReadTestDataFile("bear-640x360.webm"); |
1054 | 1055 |
1055 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), | 1056 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), |
1056 second_file->data(), second_file->data_size()); | 1057 second_file->data(), second_file->data_size()); |
1057 | 1058 |
1058 source.EndOfStream(); | 1059 source.EndOfStream(); |
1059 | 1060 |
1060 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 1061 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
1061 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 1062 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
1062 // The second video was not added, so its time has not been added. | 1063 // The second video was not added, so its time has not been added. |
1063 EXPECT_EQ(k320WebMFileDurationMs, | 1064 EXPECT_EQ(k320EncWebMFileDurationMs, |
1064 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 1065 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
1065 | 1066 |
1066 Play(); | 1067 Play(); |
1067 | 1068 |
1068 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); | 1069 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); |
1069 source.Abort(); | 1070 source.Abort(); |
1070 } | 1071 } |
1071 #endif // !defined(DISABLE_EME_TESTS) | 1072 #endif // !defined(DISABLE_EME_TESTS) |
1072 | 1073 |
1073 #if defined(USE_PROPRIETARY_CODECS) | 1074 #if defined(USE_PROPRIETARY_CODECS) |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 | 1740 |
1740 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 1741 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
1741 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 1742 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
1742 Play(); | 1743 Play(); |
1743 ASSERT_TRUE(WaitUntilOnEnded()); | 1744 ASSERT_TRUE(WaitUntilOnEnded()); |
1744 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 1745 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
1745 demuxer_->GetStartTime()); | 1746 demuxer_->GetStartTime()); |
1746 } | 1747 } |
1747 | 1748 |
1748 } // namespace media | 1749 } // namespace media |
OLD | NEW |