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

Unified Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 2362193003: Add FLAC audio codec support (Closed)
Patch Set: Enabled the test in media_browsertest.cc on Chromium Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/ffmpeg_demuxer_unittest.cc
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc
index 13b58cea65f57eaee6b93ee970e367bf9428bf60..3a6047296a14d9febf4b08e309cc52a4275be3e5 100644
--- a/media/filters/ffmpeg_demuxer_unittest.cc
+++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -1396,4 +1396,24 @@ TEST_F(FFmpegDemuxerTest, Read_Webm_Media_Track_Info) {
EXPECT_EQ(audio_track.language(), "");
}
+TEST_F(FFmpegDemuxerTest, Read_Flac) {
+ CreateDemuxer("sfx.flac");
+ InitializeDemuxer();
+
+ // Video stream should not be present.
+ EXPECT_EQ(nullptr, demuxer_->GetStream(DemuxerStream::VIDEO));
+
+ // Audio stream should be present.
+ DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::AUDIO);
+ ASSERT_TRUE(stream);
+ EXPECT_EQ(DemuxerStream::AUDIO, stream->type());
+
+ const AudioDecoderConfig& audio_config = stream->audio_decoder_config();
+ EXPECT_EQ(kCodecFLAC, audio_config.codec());
+ EXPECT_EQ(32, audio_config.bits_per_channel());
+ EXPECT_EQ(CHANNEL_LAYOUT_MONO, audio_config.channel_layout());
+ EXPECT_EQ(44100, audio_config.samples_per_second());
+ EXPECT_EQ(kSampleFormatS32, audio_config.sample_format());
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698