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

Unified Diff: media/renderers/audio_renderer_impl_unittest.cc

Issue 2752323002: Support Opus Ambisonics playback (Closed)
Patch Set: another fix for unreliable ffmpeg channels vs layout Created 3 years, 7 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
« no previous file with comments | « media/renderers/audio_renderer_impl.cc ('k') | media/test/data/bear-opus-11ch-channelmapping2.ogg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/audio_renderer_impl_unittest.cc
diff --git a/media/renderers/audio_renderer_impl_unittest.cc b/media/renderers/audio_renderer_impl_unittest.cc
index 123ec32059c372d56e0e560a3b1eae754bfe0119..cb0210d47990c333d14a26e7a423f3f568faa80e 100644
--- a/media/renderers/audio_renderer_impl_unittest.cc
+++ b/media/renderers/audio_renderer_impl_unittest.cc
@@ -679,6 +679,29 @@ TEST_F(AudioRendererImplTest, ChannelMask) {
ASSERT_TRUE(mask[ch]);
}
+// Verify that the proper channel mask is configured when downmixing is applied
+// to the input with discrete layout. The default hardware layout is stereo.
+TEST_F(AudioRendererImplTest, ChannelMask_DownmixDiscreteLayout) {
+ int audio_channels = 9;
+
+ AudioDecoderConfig audio_config(
+ kCodecOpus, kSampleFormat, CHANNEL_LAYOUT_DISCRETE,
+ kInputSamplesPerSecond, EmptyExtraData(), Unencrypted());
+ audio_config.SetChannelsForDiscrete(audio_channels);
+ demuxer_stream_.set_audio_decoder_config(audio_config);
+ ConfigureDemuxerStream(true);
+
+ // Fake an attached webaudio client.
+ sink_->SetIsOptimizedForHardwareParameters(false);
+
+ Initialize();
+ std::vector<bool> mask = channel_mask();
+ EXPECT_FALSE(mask.empty());
+ ASSERT_EQ(mask.size(), static_cast<size_t>(audio_channels));
+ for (int ch = 0; ch < audio_channels; ++ch)
+ ASSERT_TRUE(mask[ch]);
+}
+
TEST_F(AudioRendererImplTest, Underflow_Flush) {
Initialize();
Preroll();
« no previous file with comments | « media/renderers/audio_renderer_impl.cc ('k') | media/test/data/bear-opus-11ch-channelmapping2.ogg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698