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

Side by Side Diff: media/ffmpeg/ffmpeg_common_unittest.cc

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <cstring> 5 #include <cstring>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/memory_mapped_file.h" 8 #include "base/files/memory_mapped_file.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // During conversion this sample rate should be changed to 48kHz. 129 // During conversion this sample rate should be changed to 48kHz.
130 context.sample_rate = 44100; 130 context.sample_rate = 44100;
131 131
132 AudioDecoderConfig decoder_config; 132 AudioDecoderConfig decoder_config;
133 ASSERT_TRUE(AVCodecContextToAudioDecoderConfig(&context, false, 133 ASSERT_TRUE(AVCodecContextToAudioDecoderConfig(&context, false,
134 &decoder_config)); 134 &decoder_config));
135 EXPECT_EQ(48000, decoder_config.samples_per_second()); 135 EXPECT_EQ(48000, decoder_config.samples_per_second());
136 } 136 }
137 137
138 TEST_F(FFmpegCommonTest, TimeBaseConversions) { 138 TEST_F(FFmpegCommonTest, TimeBaseConversions) {
139 const int64 test_data[][5] = { 139 const int64_t test_data[][5] = {
140 {1, 2, 1, 500000, 1 }, 140 {1, 2, 1, 500000, 1}, {1, 3, 1, 333333, 1}, {1, 3, 2, 666667, 2},
141 {1, 3, 1, 333333, 1 },
142 {1, 3, 2, 666667, 2 },
143 }; 141 };
144 142
145 for (size_t i = 0; i < arraysize(test_data); ++i) { 143 for (size_t i = 0; i < arraysize(test_data); ++i) {
146 SCOPED_TRACE(i); 144 SCOPED_TRACE(i);
147 145
148 AVRational time_base; 146 AVRational time_base;
149 time_base.num = static_cast<int>(test_data[i][0]); 147 time_base.num = static_cast<int>(test_data[i][0]);
150 time_base.den = static_cast<int>(test_data[i][1]); 148 time_base.den = static_cast<int>(test_data[i][1]);
151 149
152 base::TimeDelta time_delta = 150 base::TimeDelta time_delta =
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // values; diff should verify. 260 // values; diff should verify.
263 #if 0 261 #if 0
264 printf("<enum name=\"FFmpegCodecHashes\" type=\"int\">\n"); 262 printf("<enum name=\"FFmpegCodecHashes\" type=\"int\">\n");
265 for (const auto& kv : sorted_hashes) 263 for (const auto& kv : sorted_hashes)
266 printf(" <int value=\"%d\" label=\"%s\"/>\n", kv.first, kv.second); 264 printf(" <int value=\"%d\" label=\"%s\"/>\n", kv.first, kv.second);
267 printf("</enum>\n"); 265 printf("</enum>\n");
268 #endif 266 #endif
269 } 267 }
270 268
271 } // namespace media 269 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698