summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormnissler <mnissler@chromium.org>2015-07-08 03:44:42 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-08 10:45:24 +0000
commit653d0be5f55495ff9abc57f97ab21565cbc3b860 (patch)
treeb02614ce05c399d4db1f6ad9eb9d145b33d2a524
parent0d15a85e73998a1de32384734f13c4e9b5f07e8f (diff)
downloadchromium_src-653d0be5f55495ff9abc57f97ab21565cbc3b860.zip
chromium_src-653d0be5f55495ff9abc57f97ab21565cbc3b860.tar.gz
chromium_src-653d0be5f55495ff9abc57f97ab21565cbc3b860.tar.bz2
Revert of Implement HasInputDevices in CrasAudioManager (patchset #10 id:170001 of https://codereview.chromium.org/1186293003/)
Reason for revert: Looks like this broke the build: http://build.chromium.org/p/chromium.chromiumos/buildstatus?builder=ChromiumOS%20amd64-generic%20Compile&number=1769 Original issue's description: > Implement HasInputDevices in CrasAudioManager > > Currently in CrasAudioManager, HasInputDevices always returns True. > We need to let HasInputDevices reflect the truth for device without > internal microphone like ChromeBox. > Let CrasAudioHandler updates the flag in CrasAudioManager whenever > CrasAudioHandler gets the audio node info from Cras. > > Add a property is_for_simple_usage to AudioDeviceType to indicate > that a device is for simple usage, not for special usage like > loopback, always on keyword mic, or keyboard mic. > > This property can also replace the logic in audio_detailed_view.cc > to filter out the devices that we do not want to display in UI. > > BUG=490851 > TEST=Check audio devices in UI does not contain loopback devices. > TEST=Check virtual keyboard does not show microphone for chromebox > (Not tested yet). > > R=dalecurtis@chromium.org, derat@chromium.org, dgreid@chromium.org, jennyz@chromium.org > > Committed: https://crrev.com/3c3d910e31448a88e014b31334a57242ba5e8960 > Cr-Commit-Position: refs/heads/master@{#337791} TBR=dalecurtis@chromium.org,derat@chromium.org,dgreid@chromium.org,jennyz@chromium.org,stevenjb@chromium.org,cychiang@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=490851 Review URL: https://codereview.chromium.org/1220873010 Cr-Commit-Position: refs/heads/master@{#337798}
-rw-r--r--ash/system/chromeos/audio/audio_detailed_view.cc5
-rw-r--r--chromeos/audio/audio_device.h14
-rw-r--r--chromeos/audio/cras_audio_handler.h2
-rw-r--r--media/DEPS1
-rw-r--r--media/audio/audio_manager_base.h44
-rw-r--r--media/audio/cras/audio_manager_cras.cc9
6 files changed, 31 insertions, 44 deletions
diff --git a/ash/system/chromeos/audio/audio_detailed_view.cc b/ash/system/chromeos/audio/audio_detailed_view.cc
index 2e76943..d970542 100644
--- a/ash/system/chromeos/audio/audio_detailed_view.cc
+++ b/ash/system/chromeos/audio/audio_detailed_view.cc
@@ -120,7 +120,10 @@ void AudioDetailedView::UpdateAudioDevices() {
CrasAudioHandler::Get()->GetAudioDevices(&devices);
for (size_t i = 0; i < devices.size(); ++i) {
// Don't display keyboard mic or aokr type.
- if (!devices[i].is_for_simple_usage())
+ if (devices[i].type == chromeos::AUDIO_TYPE_KEYBOARD_MIC ||
+ devices[i].type == chromeos::AUDIO_TYPE_AOKR ||
+ devices[i].type == chromeos::AUDIO_TYPE_POST_MIX_LOOPBACK ||
+ devices[i].type == chromeos::AUDIO_TYPE_POST_DSP_LOOPBACK)
continue;
if (devices[i].is_input)
input_devices_.push_back(devices[i]);
diff --git a/chromeos/audio/audio_device.h b/chromeos/audio/audio_device.h
index 2ed26b1..67dca1c 100644
--- a/chromeos/audio/audio_device.h
+++ b/chromeos/audio/audio_device.h
@@ -41,20 +41,6 @@ struct CHROMEOS_EXPORT AudioDevice {
static std::string GetTypeString(chromeos::AudioDeviceType type);
static chromeos::AudioDeviceType GetAudioType(const std::string& node_type);
- // Indicates that an input or output audio device is for simple usage like
- // playback or recording for user. In contrast, audio device such as
- // loopback, always on keyword recognition (AOKR), and keyboard mic are
- // not for simple usage.
- bool is_for_simple_usage() {
- return (type == AUDIO_TYPE_HEADPHONE ||
- type == AUDIO_TYPE_INTERNAL_MIC ||
- type == AUDIO_TYPE_MIC ||
- type == AUDIO_TYPE_USB ||
- type == AUDIO_TYPE_BLUETOOTH ||
- type == AUDIO_TYPE_HDMI ||
- type == AUDIO_TYPE_INTERNAL_SPEAKER);
- }
-
bool is_input;
uint64 id;
std::string display_name;
diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h
index 5d24973..10c77a4 100644
--- a/chromeos/audio/cras_audio_handler.h
+++ b/chromeos/audio/cras_audio_handler.h
@@ -128,8 +128,6 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
virtual uint64_t GetPrimaryActiveInputNode() const;
// Gets the audio devices back in |device_list|.
- // This call can be invoked from I/O thread or UI thread because
- // it does not need to access CrasAudioClient on DBus.
virtual void GetAudioDevices(AudioDeviceList* device_list) const;
virtual bool GetPrimaryActiveOutputDevice(AudioDevice* device) const;
diff --git a/media/DEPS b/media/DEPS
index 213ce6e..6d3642e 100644
--- a/media/DEPS
+++ b/media/DEPS
@@ -1,6 +1,5 @@
# Do NOT add net/ or ui/base without a great reason, they're huge!
include_rules = [
- "+chromeos/audio",
"+crypto",
"+device/udev_linux",
"+device/usb",
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index 866ecef..0ac7020 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -48,39 +48,28 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
~AudioManagerBase() override;
- // AudioManager:
scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override;
scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override;
+
base::string16 GetAudioInputDeviceModel() override;
+
void ShowAudioInputSettings() override;
+
void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override;
+
void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override;
+
AudioOutputStream* MakeAudioOutputStream(
const AudioParameters& params,
const std::string& device_id) override;
+
AudioInputStream* MakeAudioInputStream(const AudioParameters& params,
const std::string& device_id) override;
+
AudioOutputStream* MakeAudioOutputStreamProxy(
const AudioParameters& params,
const std::string& device_id) override;
- // Listeners will be notified on the GetTaskRunner() task runner.
- void AddOutputDeviceChangeListener(AudioDeviceListener* listener) override;
- void RemoveOutputDeviceChangeListener(AudioDeviceListener* listener) override;
-
- AudioParameters GetDefaultOutputStreamParameters() override;
- AudioParameters GetOutputStreamParameters(
- const std::string& device_id) override;
- AudioParameters GetInputStreamParameters(
- const std::string& device_id) override;
- std::string GetAssociatedOutputDeviceID(
- const std::string& input_device_id) override;
- scoped_ptr<AudioLog> CreateAudioLog(
- AudioLogFactory::AudioComponent component) override;
- void SetHasKeyboardMic() override;
-
- // AudioManagerBase:
-
// Called internally by the audio stream when it has been closed.
virtual void ReleaseOutputStream(AudioOutputStream* stream);
virtual void ReleaseInputStream(AudioInputStream* stream);
@@ -104,6 +93,25 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
virtual AudioInputStream* MakeLowLatencyInputStream(
const AudioParameters& params, const std::string& device_id) = 0;
+ // Listeners will be notified on the GetTaskRunner() task runner.
+ void AddOutputDeviceChangeListener(AudioDeviceListener* listener) override;
+ void RemoveOutputDeviceChangeListener(AudioDeviceListener* listener) override;
+
+ AudioParameters GetDefaultOutputStreamParameters() override;
+ AudioParameters GetOutputStreamParameters(
+ const std::string& device_id) override;
+
+ AudioParameters GetInputStreamParameters(
+ const std::string& device_id) override;
+
+ std::string GetAssociatedOutputDeviceID(
+ const std::string& input_device_id) override;
+
+ scoped_ptr<AudioLog> CreateAudioLog(
+ AudioLogFactory::AudioComponent component) override;
+
+ void SetHasKeyboardMic() override;
+
// Get number of input or output streams.
int input_stream_count() const { return num_input_streams_; }
int output_stream_count() const { return num_output_streams_; }
diff --git a/media/audio/cras/audio_manager_cras.cc b/media/audio/cras/audio_manager_cras.cc
index 7308a6d..befd3df 100644
--- a/media/audio/cras/audio_manager_cras.cc
+++ b/media/audio/cras/audio_manager_cras.cc
@@ -11,8 +11,6 @@
#include "base/logging.h"
#include "base/nix/xdg_util.h"
#include "base/stl_util.h"
-#include "chromeos/audio/audio_device.h"
-#include "chromeos/audio/cras_audio_handler.h"
#include "media/audio/cras/cras_input.h"
#include "media/audio/cras/cras_unified.h"
#include "media/base/channel_layout.h"
@@ -51,12 +49,7 @@ bool AudioManagerCras::HasAudioOutputDevices() {
}
bool AudioManagerCras::HasAudioInputDevices() {
- chromeos::AudioDeviceList devices;
- chromeos::CrasAudioHandler::Get()->GetAudioDevices(&devices);
- for (size_t i = 0; i < devices.size(); ++i)
- if (devices[i].is_input && devices[i].is_for_simple_usage())
- return true;
- return false;
+ return true;
}
AudioManagerCras::AudioManagerCras(AudioLogFactory* audio_log_factory)