OLD | NEW |
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/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 !base::StringToInt(base::UTF16ToUTF8( | 730 !base::StringToInt(base::UTF16ToUTF8( |
731 base::StringPiece16(input_device_id)), &session_id)) { | 731 base::StringPiece16(input_device_id)), &session_id)) { |
732 if (input_channels > 0) | 732 if (input_channels > 0) |
733 DLOG(WARNING) << "createAudioDevice(): request for audio input ignored"; | 733 DLOG(WARNING) << "createAudioDevice(): request for audio input ignored"; |
734 | 734 |
735 input_channels = 0; | 735 input_channels = 0; |
736 } | 736 } |
737 | 737 |
738 // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with | 738 // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with |
739 // the channel layout when creating an |AudioParameters| object. | 739 // the channel layout when creating an |AudioParameters| object. |
740 media::AudioParameters params( | 740 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
741 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 741 channels, layout, static_cast<int>(sample_rate), |
742 layout, channels, static_cast<int>(sample_rate), 16, buffer_size, | 742 16, buffer_size); |
743 media::AudioParameters::NO_EFFECTS); | |
744 | 743 |
745 return new RendererWebAudioDeviceImpl(params, callback, session_id); | 744 return new RendererWebAudioDeviceImpl(params, callback, session_id); |
746 } | 745 } |
747 | 746 |
748 #if defined(OS_ANDROID) | 747 #if defined(OS_ANDROID) |
749 bool RendererBlinkPlatformImpl::loadAudioResource( | 748 bool RendererBlinkPlatformImpl::loadAudioResource( |
750 blink::WebAudioBus* destination_bus, | 749 blink::WebAudioBus* destination_bus, |
751 const char* audio_file_data, | 750 const char* audio_file_data, |
752 size_t data_size) { | 751 size_t data_size) { |
753 return DecodeAudioFileData(destination_bus, | 752 return DecodeAudioFileData(destination_bus, |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 //------------------------------------------------------------------------------ | 1245 //------------------------------------------------------------------------------ |
1247 | 1246 |
1248 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1247 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
1249 const blink::WebBatteryStatus& status) { | 1248 const blink::WebBatteryStatus& status) { |
1250 if (!g_test_battery_status_listener) | 1249 if (!g_test_battery_status_listener) |
1251 return; | 1250 return; |
1252 g_test_battery_status_listener->updateBatteryStatus(status); | 1251 g_test_battery_status_listener->updateBatteryStatus(status); |
1253 } | 1252 } |
1254 | 1253 |
1255 } // namespace content | 1254 } // namespace content |
OLD | NEW |