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

Side by Side Diff: media/test/pipeline_integration_test.cc

Issue 1018373003: Improving WebM video duration estimation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding tests and fixing bug Created 5 years, 8 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
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 "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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 85 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
86 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35 86 0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35
87 }; 87 };
88 88
89 const int kAppendWholeFile = -1; 89 const int kAppendWholeFile = -1;
90 90
91 // Constants for the Media Source config change tests. 91 // Constants for the Media Source config change tests.
92 const int kAppendTimeSec = 1; 92 const int kAppendTimeSec = 1;
93 const int kAppendTimeMs = kAppendTimeSec * 1000; 93 const int kAppendTimeMs = kAppendTimeSec * 1000;
94 const int k320WebMFileDurationMs = 2736; 94 const int k320WebMFileDurationMs = 2736;
95 const int k320EncWebMFileDurationMs = 2737;
95 const int k640WebMFileDurationMs = 2749; 96 const int k640WebMFileDurationMs = 2749;
96 const int kOpusEndTrimmingWebMFileDurationMs = 2741; 97 const int kOpusEndTrimmingWebMFileDurationMs = 2741;
97 const int kVP9WebMFileDurationMs = 2736; 98 const int kVP9WebMFileDurationMs = 2736;
98 const int kVP8AWebMFileDurationMs = 2733; 99 const int kVP8AWebMFileDurationMs = 2734;
99 100
100 #if defined(USE_PROPRIETARY_CODECS) 101 #if defined(USE_PROPRIETARY_CODECS)
101 #if !defined(DISABLE_EME_TESTS) 102 #if !defined(DISABLE_EME_TESTS)
102 const int k640IsoFileDurationMs = 2737; 103 const int k640IsoFileDurationMs = 2737;
103 const int k640IsoCencFileDurationMs = 2736; 104 const int k640IsoCencFileDurationMs = 2736;
104 #endif // !defined(DISABLE_EME_TESTS) 105 #endif // !defined(DISABLE_EME_TESTS)
105 const int k1280IsoFileDurationMs = 2736; 106 const int k1280IsoFileDurationMs = 2736;
106 const int k1280IsoAVC3FileDurationMs = 2736; 107 const int k1280IsoAVC3FileDurationMs = 2736;
107 #endif // defined(USE_PROPRIETARY_CODECS) 108 #endif // defined(USE_PROPRIETARY_CODECS)
108 109
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 ReadTestDataFile("bear-640x360.webm"); 1059 ReadTestDataFile("bear-640x360.webm");
1059 1060
1060 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec), 1061 source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
1061 second_file->data(), second_file->data_size()); 1062 second_file->data(), second_file->data_size());
1062 1063
1063 source.EndOfStream(); 1064 source.EndOfStream();
1064 1065
1065 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 1066 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
1066 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 1067 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
1067 // The second video was not added, so its time has not been added. 1068 // The second video was not added, so its time has not been added.
1068 EXPECT_EQ(k320WebMFileDurationMs, 1069 EXPECT_EQ(k320EncWebMFileDurationMs,
1069 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 1070 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
1070 1071
1071 Play(); 1072 Play();
1072 1073
1073 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); 1074 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError());
1074 source.Abort(); 1075 source.Abort();
1075 } 1076 }
1076 #endif // !defined(DISABLE_EME_TESTS) 1077 #endif // !defined(DISABLE_EME_TESTS)
1077 1078
1078 #if defined(USE_PROPRIETARY_CODECS) 1079 #if defined(USE_PROPRIETARY_CODECS)
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 1745
1745 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 1746 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
1746 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 1747 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
1747 Play(); 1748 Play();
1748 ASSERT_TRUE(WaitUntilOnEnded()); 1749 ASSERT_TRUE(WaitUntilOnEnded());
1749 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 1750 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
1750 demuxer_->GetStartTime()); 1751 demuxer_->GetStartTime());
1751 } 1752 }
1752 1753
1753 } // namespace media 1754 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698