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

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

Issue 1786733004: Revert of media config: expand is_encrypted to a struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/audio_decoder_selector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/files/memory_mapped_file.h" 11 #include "base/files/memory_mapped_file.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "media/base/audio_decoder_config.h" 15 #include "media/base/audio_decoder_config.h"
16 #include "media/base/media.h" 16 #include "media/base/media.h"
17 #include "media/base/media_util.h"
18 #include "media/base/test_data_util.h" 17 #include "media/base/test_data_util.h"
19 #include "media/base/video_decoder_config.h" 18 #include "media/base/video_decoder_config.h"
20 #include "media/ffmpeg/ffmpeg_common.h" 19 #include "media/ffmpeg/ffmpeg_common.h"
21 #include "media/filters/ffmpeg_glue.h" 20 #include "media/filters/ffmpeg_glue.h"
22 #include "media/filters/in_memory_url_protocol.h" 21 #include "media/filters/in_memory_url_protocol.h"
23 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
24 23
25 namespace media { 24 namespace media {
26 25
27 class FFmpegCommonTest : public testing::Test { 26 class FFmpegCommonTest : public testing::Test {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 context.codec_type = AVMEDIA_TYPE_AUDIO; 127 context.codec_type = AVMEDIA_TYPE_AUDIO;
129 context.codec_id = AV_CODEC_ID_OPUS; 128 context.codec_id = AV_CODEC_ID_OPUS;
130 context.channel_layout = CHANNEL_LAYOUT_STEREO; 129 context.channel_layout = CHANNEL_LAYOUT_STEREO;
131 context.channels = 2; 130 context.channels = 2;
132 context.sample_fmt = AV_SAMPLE_FMT_FLT; 131 context.sample_fmt = AV_SAMPLE_FMT_FLT;
133 132
134 // During conversion this sample rate should be changed to 48kHz. 133 // During conversion this sample rate should be changed to 48kHz.
135 context.sample_rate = 44100; 134 context.sample_rate = 44100;
136 135
137 AudioDecoderConfig decoder_config; 136 AudioDecoderConfig decoder_config;
138 ASSERT_TRUE(AVCodecContextToAudioDecoderConfig(&context, Unencrypted(), 137 ASSERT_TRUE(AVCodecContextToAudioDecoderConfig(&context, false,
139 &decoder_config)); 138 &decoder_config));
140 EXPECT_EQ(48000, decoder_config.samples_per_second()); 139 EXPECT_EQ(48000, decoder_config.samples_per_second());
141 } 140 }
142 141
143 TEST_F(FFmpegCommonTest, TimeBaseConversions) { 142 TEST_F(FFmpegCommonTest, TimeBaseConversions) {
144 const int64_t test_data[][5] = { 143 const int64_t test_data[][5] = {
145 {1, 2, 1, 500000, 1}, {1, 3, 1, 333333, 1}, {1, 3, 2, 666667, 2}, 144 {1, 2, 1, 500000, 1}, {1, 3, 1, 333333, 1}, {1, 3, 2, 666667, 2},
146 }; 145 };
147 146
148 for (size_t i = 0; i < arraysize(test_data); ++i) { 147 for (size_t i = 0; i < arraysize(test_data); ++i) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // values; diff should verify. 264 // values; diff should verify.
266 #if 0 265 #if 0
267 printf("<enum name=\"FFmpegCodecHashes\" type=\"int\">\n"); 266 printf("<enum name=\"FFmpegCodecHashes\" type=\"int\">\n");
268 for (const auto& kv : sorted_hashes) 267 for (const auto& kv : sorted_hashes)
269 printf(" <int value=\"%d\" label=\"%s\"/>\n", kv.first, kv.second); 268 printf(" <int value=\"%d\" label=\"%s\"/>\n", kv.first, kv.second);
270 printf("</enum>\n"); 269 printf("</enum>\n");
271 #endif 270 #endif
272 } 271 }
273 272
274 } // namespace media 273 } // namespace media
OLDNEW
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/audio_decoder_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698