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

Unified Diff: content/renderer/media/webrtc_audio_renderer.cc

Issue 14347002: Adds support for 192kHz native output sample rate for WebRTC clients (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_audio_renderer.cc
diff --git a/content/renderer/media/webrtc_audio_renderer.cc b/content/renderer/media/webrtc_audio_renderer.cc
index f22b9cd7f77f78e812f777fc194e021a9cd0917e..c85b2df25c943846fa9e1420472e3d11310e2993 100644
--- a/content/renderer/media/webrtc_audio_renderer.cc
+++ b/content/renderer/media/webrtc_audio_renderer.cc
@@ -123,6 +123,17 @@ bool WebRtcAudioRenderer::Initialize(WebRtcAudioRendererSource* source) {
RenderThreadImpl::current()->GetAudioHardwareConfig();
int sample_rate = hardware_config->GetOutputSampleRate();
DVLOG(1) << "Audio output hardware sample rate: " << sample_rate;
+
+ // WebRTC does not yet support higher rates than 96000 on the client side
+ // and 48000 is the preferred sample rate. Therefore, if 192000 is detected,
+ // we change the rate to 48000 instead. The consequence is that the native
+ // layer will be opened up at 192kHz but WebRTC will provide data at 48kHz
+ // which will then be resampled by the audio converted on the browser side
+ // to match the native audio layer.
+ if (sample_rate == 192000) {
+ DVLOG(1) << "Resampling from 48000 to 192000 is required";
+ sample_rate = 48000;
+ }
UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioOutputSampleRate",
sample_rate, media::kUnexpectedAudioSampleRate);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698