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

Unified Diff: chromeos/audio/audio_device.cc

Issue 2609863007: Add new mic types (Closed)
Patch Set: Created 3 years, 11 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 | « chromeos/audio/audio_device.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/audio_device.cc
diff --git a/chromeos/audio/audio_device.cc b/chromeos/audio/audio_device.cc
index 5039644920814f1e6afce194afe1a7b112b18bcd..c700c0fb325f733bbc708a3ca62fd09eb4af0390 100644
--- a/chromeos/audio/audio_device.cc
+++ b/chromeos/audio/audio_device.cc
@@ -34,7 +34,9 @@ uint8_t GetDevicePriority(AudioDeviceType type, bool is_input) {
return 2;
case AUDIO_TYPE_INTERNAL_SPEAKER:
case AUDIO_TYPE_INTERNAL_MIC:
+ case AUDIO_TYPE_FRONT_MIC:
return 1;
+ case AUDIO_TYPE_REAR_MIC:
hshi1 2017/01/06 18:41:23 why is the FRONT_MIC assigned priority "1" but REA
jennyz 2017/01/06 19:31:16 Yes, same question as hshi, please comment for the
hychao 2017/01/09 03:17:35 Added comment for this. The idea is the same as se
case AUDIO_TYPE_KEYBOARD_MIC:
case AUDIO_TYPE_HOTWORD:
case AUDIO_TYPE_POST_MIX_LOOPBACK:
@@ -64,6 +66,10 @@ std::string AudioDevice::GetTypeString(AudioDeviceType type) {
return "INTERNAL_SPEAKER";
case AUDIO_TYPE_INTERNAL_MIC:
return "INTERNAL_MIC";
+ case AUDIO_TYPE_FRONT_MIC:
+ return "FRONT_MIC";
+ case AUDIO_TYPE_REAR_MIC:
+ return "REAR_MIC";
case AUDIO_TYPE_KEYBOARD_MIC:
return "KEYBOARD_MIC";
case AUDIO_TYPE_HOTWORD:
@@ -87,6 +93,10 @@ AudioDeviceType AudioDevice::GetAudioType(
return AUDIO_TYPE_HEADPHONE;
else if (node_type.find("INTERNAL_MIC") != std::string::npos)
return AUDIO_TYPE_INTERNAL_MIC;
+ else if (node_type.find("FRONT_MIC") != std::string::npos)
+ return AUDIO_TYPE_FRONT_MIC;
+ else if (node_type.find("REAR_MIC") != std::string::npos)
+ return AUDIO_TYPE_REAR_MIC;
else if (node_type.find("KEYBOARD_MIC") != std::string::npos)
return AUDIO_TYPE_KEYBOARD_MIC;
else if (node_type.find("MIC") != std::string::npos)
« no previous file with comments | « chromeos/audio/audio_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698