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

Unified Diff: media/ffmpeg/ffmpeg_common_unittest.cc

Issue 1422113002: Enable pcm_s32le audio decoding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: DEPS roll Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/ffmpeg/ffmpeg_common_unittest.cc
diff --git a/media/ffmpeg/ffmpeg_common_unittest.cc b/media/ffmpeg/ffmpeg_common_unittest.cc
index aa8a06d9de7d9b90657ca2cd542ba487b83a7619..9a735872cf3ca4fb796bc1292414870bcd35a94d 100644
--- a/media/ffmpeg/ffmpeg_common_unittest.cc
+++ b/media/ffmpeg/ffmpeg_common_unittest.cc
@@ -161,17 +161,24 @@ TEST_F(FFmpegCommonTest, VerifyFormatSizes) {
for (AVSampleFormat format = AV_SAMPLE_FMT_NONE;
format < AV_SAMPLE_FMT_NB;
format = static_cast<AVSampleFormat>(format + 1)) {
- SampleFormat sample_format = AVSampleFormatToSampleFormat(format);
- if (sample_format == kUnknownSampleFormat) {
- // This format not supported, so skip it.
- continue;
+ std::vector<AVCodecID> codec_ids(1, AV_CODEC_ID_NONE);
+ if (format == AV_SAMPLE_FMT_S32)
+ codec_ids.push_back(AV_CODEC_ID_PCM_S24LE);
+ for (const auto& codec_id : codec_ids) {
+ SampleFormat sample_format =
+ AVSampleFormatToSampleFormat(format, codec_id);
+ if (sample_format == kUnknownSampleFormat) {
+ // This format not supported, so skip it.
+ continue;
+ }
+
+ // Have FFMpeg compute the size of a buffer of 1 channel / 1 frame
+ // with 1 byte alignment to make sure the sizes match.
+ int single_buffer_size =
+ av_samples_get_buffer_size(NULL, 1, 1, format, 1);
+ int bytes_per_channel = SampleFormatToBytesPerChannel(sample_format);
+ EXPECT_EQ(bytes_per_channel, single_buffer_size);
}
-
- // Have FFMpeg compute the size of a buffer of 1 channel / 1 frame
- // with 1 byte alignment to make sure the sizes match.
- int single_buffer_size = av_samples_get_buffer_size(NULL, 1, 1, format, 1);
- int bytes_per_channel = SampleFormatToBytesPerChannel(sample_format);
- EXPECT_EQ(bytes_per_channel, single_buffer_size);
}
}
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/ffmpeg_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698