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

Side by Side 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, 2 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 EXPECT_EQ(video_track.language(), ""); 1389 EXPECT_EQ(video_track.language(), "");
1390 1390
1391 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]); 1391 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]);
1392 EXPECT_EQ(audio_track.type(), MediaTrack::Audio); 1392 EXPECT_EQ(audio_track.type(), MediaTrack::Audio);
1393 EXPECT_EQ(audio_track.bytestream_track_id(), 2); 1393 EXPECT_EQ(audio_track.bytestream_track_id(), 2);
1394 EXPECT_EQ(audio_track.kind(), "main"); 1394 EXPECT_EQ(audio_track.kind(), "main");
1395 EXPECT_EQ(audio_track.label(), ""); 1395 EXPECT_EQ(audio_track.label(), "");
1396 EXPECT_EQ(audio_track.language(), ""); 1396 EXPECT_EQ(audio_track.language(), "");
1397 } 1397 }
1398 1398
1399 TEST_F(FFmpegDemuxerTest, Read_Flac) {
1400 CreateDemuxer("sfx.flac");
1401 InitializeDemuxer();
1402
1403 // Video stream should not be present.
1404 EXPECT_EQ(nullptr, demuxer_->GetStream(DemuxerStream::VIDEO));
1405
1406 // Audio stream should be present.
1407 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::AUDIO);
1408 ASSERT_TRUE(stream);
1409 EXPECT_EQ(DemuxerStream::AUDIO, stream->type());
1410
1411 const AudioDecoderConfig& audio_config = stream->audio_decoder_config();
1412 EXPECT_EQ(kCodecFLAC, audio_config.codec());
1413 EXPECT_EQ(32, audio_config.bits_per_channel());
1414 EXPECT_EQ(CHANNEL_LAYOUT_MONO, audio_config.channel_layout());
1415 EXPECT_EQ(44100, audio_config.samples_per_second());
1416 EXPECT_EQ(kSampleFormatS32, audio_config.sample_format());
1417 }
1418
1399 } // namespace media 1419 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698