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

Unified Diff: media/audio/audio_device_description.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/audio_device_description.h ('k') | media/audio/audio_device_name.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_device_description.cc
diff --git a/media/audio/audio_device_description.cc b/media/audio/audio_device_description.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5e0c8e4e52e486057f8092f11a0a5d3d2c1e0593
--- /dev/null
+++ b/media/audio/audio_device_description.cc
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/logging.h"
+#include "media/audio/audio_device_description.h"
+#include "media/base/media_resources.h"
+
+namespace media {
+const char AudioDeviceDescription::kDefaultDeviceId[] = "default";
+const char AudioDeviceDescription::kCommunicationsDeviceId[] = "communications";
+const char AudioDeviceDescription::kLoopbackInputDeviceId[] = "loopback";
+
+// static
+bool AudioDeviceDescription::IsDefaultDevice(const std::string& device_id) {
+ return device_id.empty() ||
+ device_id == AudioDeviceDescription::kDefaultDeviceId;
+}
+
+// static
+bool AudioDeviceDescription::UseSessionIdToSelectDevice(
+ int session_id,
+ const std::string& device_id) {
+ return session_id && device_id.empty();
+}
+
+// static
+std::string AudioDeviceDescription::GetDefaultDeviceName() {
+#if !defined(OS_IOS)
+ return GetLocalizedStringUTF8(DEFAULT_AUDIO_DEVICE_NAME);
+#else
+ NOTREACHED();
+ return "";
+#endif
+}
+
+// static
+std::string AudioDeviceDescription::GetCommunicationsDeviceName() {
+#if defined(OS_WIN)
+ return GetLocalizedStringUTF8(COMMUNICATIONS_AUDIO_DEVICE_NAME);
+#else
+ NOTREACHED();
+ return "";
+#endif
+}
+
+} // namespace media
« no previous file with comments | « media/audio/audio_device_description.h ('k') | media/audio/audio_device_name.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698