Chromium Code Reviews| 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 "media/audio/audio_manager_base.h" | 5 #include "media/audio/audio_manager_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 const std::string& device_id) { | 338 const std::string& device_id) { |
| 339 NOTREACHED(); | 339 NOTREACHED(); |
| 340 return AudioParameters(); | 340 return AudioParameters(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 std::string AudioManagerBase::GetAssociatedOutputDeviceID( | 343 std::string AudioManagerBase::GetAssociatedOutputDeviceID( |
| 344 const std::string& input_device_id) { | 344 const std::string& input_device_id) { |
| 345 return ""; | 345 return ""; |
| 346 } | 346 } |
| 347 | 347 |
| 348 std::string AudioManagerBase::GetGroupIDOutput(std::string output_device_id) { | |
| 349 if (output_device_id == AudioDeviceDescription::kDefaultDeviceId) { | |
| 350 std::string real_device_id = GetDefaultOutputDeviceID(); | |
| 351 if (!real_device_id.empty()) { | |
| 352 return real_device_id; | |
| 353 } | |
| 354 } | |
| 355 return output_device_id; | |
| 356 } | |
| 357 | |
| 358 std::string AudioManagerBase::GetGroupIDInput(std::string input_device_id) { | |
| 359 std::string output_device_id = GetAssociatedOutputDeviceID(input_id); | |
|
tommi (sloooow) - chröme
2016/08/29 16:19:53
what is input_id? (does this compile?)
Max Morin
2016/08/30 08:17:45
Done.
| |
| 360 if (output_device_id.empty()) { | |
| 361 // Some characters are added to avoid accidentally | |
| 362 // giving the input the same group id as an output. | |
| 363 return input_device_id + "input"; | |
| 364 } | |
| 365 return GetGroupIDOutput(output_device_id); | |
| 366 } | |
| 367 | |
| 348 std::string AudioManagerBase::GetDefaultOutputDeviceID() { | 368 std::string AudioManagerBase::GetDefaultOutputDeviceID() { |
| 349 return ""; | 369 return ""; |
| 350 } | 370 } |
| 351 | 371 |
| 352 int AudioManagerBase::GetUserBufferSize() { | 372 int AudioManagerBase::GetUserBufferSize() { |
| 353 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 373 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 354 int buffer_size = 0; | 374 int buffer_size = 0; |
| 355 std::string buffer_size_str(cmd_line->GetSwitchValueASCII( | 375 std::string buffer_size_str(cmd_line->GetSwitchValueASCII( |
| 356 switches::kAudioBufferSize)); | 376 switches::kAudioBufferSize)); |
| 357 if (base::StringToInt(buffer_size_str, &buffer_size) && buffer_size > 0) | 377 if (base::StringToInt(buffer_size_str, &buffer_size) && buffer_size > 0) |
| 358 return buffer_size; | 378 return buffer_size; |
| 359 | 379 |
| 360 return 0; | 380 return 0; |
| 361 } | 381 } |
| 362 | 382 |
| 363 std::unique_ptr<AudioLog> AudioManagerBase::CreateAudioLog( | 383 std::unique_ptr<AudioLog> AudioManagerBase::CreateAudioLog( |
| 364 AudioLogFactory::AudioComponent component) { | 384 AudioLogFactory::AudioComponent component) { |
| 365 return audio_log_factory_->CreateAudioLog(component); | 385 return audio_log_factory_->CreateAudioLog(component); |
| 366 } | 386 } |
| 367 | 387 |
| 368 } // namespace media | 388 } // namespace media |
| OLD | NEW |