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

Side by Side Diff: content/renderer/media/audio_renderer_mixer_manager.cc

Issue 2752323002: Support Opus Ambisonics playback (Closed)
Patch Set: +pipeline integration tests, +test media, minor fixes Created 3 years, 8 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 "content/renderer/media/audio_renderer_mixer_manager.h" 5 #include "content/renderer/media/audio_renderer_mixer_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 output_sample_rate, preferred_high_latency_output_buffer_size); 63 output_sample_rate, preferred_high_latency_output_buffer_size);
64 break; 64 break;
65 case media::AudioLatency::LATENCY_EXACT_MS: 65 case media::AudioLatency::LATENCY_EXACT_MS:
66 // TODO(olka): add support when WebAudio requires it. 66 // TODO(olka): add support when WebAudio requires it.
67 default: 67 default:
68 NOTREACHED(); 68 NOTREACHED();
69 } 69 }
70 70
71 DCHECK_NE(output_buffer_size, 0); 71 DCHECK_NE(output_buffer_size, 0);
72 72
73 // If the input has discrete channel layout, the hardware channel mapping is
74 // unknown. Default to the hardware channel layout instead. Any input
75 // channels beyond the hardware channel count will not be played out.
76 media::ChannelLayout channel_layout =
77 input_params.channel_layout() == media::CHANNEL_LAYOUT_DISCRETE
78 ? hardware_params.channel_layout()
79 : input_params.channel_layout();
80
DaleCurtis 2017/03/31 19:06:53 Needs set_channels.
flim-chromium 2017/04/05 18:19:34 I ended up removing this.
73 // Force to 16-bit output for now since we know that works everywhere; 81 // Force to 16-bit output for now since we know that works everywhere;
74 // ChromeOS does not support other bit depths. 82 // ChromeOS does not support other bit depths.
75 media::AudioParameters params(input_params.format(), 83 media::AudioParameters params(input_params.format(), channel_layout,
76 input_params.channel_layout(),
77 output_sample_rate, 16, output_buffer_size); 84 output_sample_rate, 16, output_buffer_size);
78 85
79 // Specify the latency info to be passed to the browser side. 86 // Specify the latency info to be passed to the browser side.
80 params.set_latency_tag(latency); 87 params.set_latency_tag(latency);
81 return params; 88 return params;
82 } 89 }
83 90
84 void LogMixerUmaHistogram(media::AudioLatency::LatencyType latency, int value) { 91 void LogMixerUmaHistogram(media::AudioLatency::LatencyType latency, int value) {
85 switch (latency) { 92 switch (latency) {
86 case media::AudioLatency::LATENCY_EXACT_MS: 93 case media::AudioLatency::LATENCY_EXACT_MS:
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 const url::Origin& security_origin) 254 const url::Origin& security_origin)
248 : source_render_frame_id(source_render_frame_id), 255 : source_render_frame_id(source_render_frame_id),
249 params(params), 256 params(params),
250 latency(latency), 257 latency(latency),
251 device_id(device_id), 258 device_id(device_id),
252 security_origin(security_origin) {} 259 security_origin(security_origin) {}
253 260
254 AudioRendererMixerManager::MixerKey::MixerKey(const MixerKey& other) = default; 261 AudioRendererMixerManager::MixerKey::MixerKey(const MixerKey& other) = default;
255 262
256 } // namespace content 263 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698