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

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

Issue 8341052: share all the needed linux code with OpenBSD in chrome and content (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/webrtc_audio_device_impl.h" 5 #include "content/renderer/media/webrtc_audio_device_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "content/common/view_messages.h" 9 #include "content/common/view_messages.h"
10 #include "content/renderer/render_thread_impl.h" 10 #include "content/renderer/render_thread_impl.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 // Use different buffer sizes depending on the current hardware sample rate. 359 // Use different buffer sizes depending on the current hardware sample rate.
360 if (output_sample_rate == 48000) { 360 if (output_sample_rate == 48000) {
361 input_buffer_size = 480; 361 input_buffer_size = 480;
362 output_buffer_size = 480; 362 output_buffer_size = 480;
363 } else { 363 } else {
364 // We do run at 44.1kHz at the actual audio layer, but ask for frames 364 // We do run at 44.1kHz at the actual audio layer, but ask for frames
365 // at 44.0kHz to ensure that we can feed them to the webrtc::VoiceEngine. 365 // at 44.0kHz to ensure that we can feed them to the webrtc::VoiceEngine.
366 input_buffer_size = 440; 366 input_buffer_size = 440;
367 output_buffer_size = 440; 367 output_buffer_size = 440;
368 } 368 }
369 #elif defined(OS_LINUX) 369 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
370 if (output_sample_rate != 48000) { 370 if (output_sample_rate != 48000) {
371 DLOG(ERROR) << "Only 48kHz sample rate is supported on Linux."; 371 DLOG(ERROR) << "Only 48kHz sample rate is supported on Linux.";
372 return -1; 372 return -1;
373 } 373 }
374 input_channels = 1; 374 input_channels = 1;
375 output_channels = 1; 375 output_channels = 1;
376 376
377 // Based on tests using the current ALSA implementation in Chrome, we have 377 // Based on tests using the current ALSA implementation in Chrome, we have
378 // found that the best combination is 20ms on the input side and 10ms on the 378 // found that the best combination is 20ms on the input side and 10ms on the
379 // output side. 379 // output side.
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 } 944 }
945 945
946 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { 946 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const {
947 NOTIMPLEMENTED(); 947 NOTIMPLEMENTED();
948 return -1; 948 return -1;
949 } 949 }
950 950
951 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) { 951 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) {
952 session_id_ = session_id; 952 session_id_ = session_id;
953 } 953 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698