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

Unified Diff: media/audio/alsa/audio_manager_alsa.cc

Issue 1892433002: Moving device description utils from AudioManager[Base] into AudioDeviceDescription; to be shared b… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 4 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 | « media/audio/BUILD.gn ('k') | media/audio/android/audio_android_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/alsa/audio_manager_alsa.cc
diff --git a/media/audio/alsa/audio_manager_alsa.cc b/media/audio/alsa/audio_manager_alsa.cc
index e5a4a8352866dc4b62d15a0665f84bb6fb00a544..09718518349e109818031a71470b7a6044a6c4a1 100644
--- a/media/audio/alsa/audio_manager_alsa.cc
+++ b/media/audio/alsa/audio_manager_alsa.cc
@@ -16,6 +16,7 @@
#include "base/nix/xdg_util.h"
#include "base/process/launch.h"
#include "base/stl_util.h"
+#include "media/audio/audio_device_description.h"
#include "media/audio/audio_output_dispatcher.h"
#if defined(USE_CRAS)
#include "media/audio/cras/audio_manager_cras.h"
@@ -172,11 +173,8 @@ void AudioManagerAlsa::GetAlsaDevicesInfo(
// no duplicate counting here since it is only done if the list is
// still empty. Note, pulse has exclusively opened the default
// device, so we must open the device via the "default" moniker.
- if (device_names->empty()) {
- device_names->push_front(
- media::AudioDeviceName(AudioManager::GetDefaultDeviceName(),
- AudioManagerBase::kDefaultDeviceId));
- }
+ if (device_names->empty())
+ device_names->push_front(media::AudioDeviceName::CreateDefault());
// Get the unique device name for the device.
std::unique_ptr<char, base::FreeDeleter> unique_device_name(
@@ -354,8 +352,10 @@ AudioOutputStream* AudioManagerAlsa::MakeOutputStream(
AudioInputStream* AudioManagerAlsa::MakeInputStream(
const AudioParameters& params, const std::string& device_id) {
- std::string device_name = (device_id == AudioManagerBase::kDefaultDeviceId) ?
- AlsaPcmInputStream::kAutoSelectDevice : device_id;
+ std::string device_name =
+ (device_id == AudioDeviceDescription::kDefaultDeviceId)
+ ? AlsaPcmInputStream::kAutoSelectDevice
+ : device_id;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAlsaInputDevice)) {
device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
« no previous file with comments | « media/audio/BUILD.gn ('k') | media/audio/android/audio_android_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698