diff options
Diffstat (limited to 'chromium/media/audio/cras/cras_util.h')
-rw-r--r-- | chromium/media/audio/cras/cras_util.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/chromium/media/audio/cras/cras_util.h b/chromium/media/audio/cras/cras_util.h new file mode 100644 index 00000000000..99c791bc4d1 --- /dev/null +++ b/chromium/media/audio/cras/cras_util.h @@ -0,0 +1,40 @@ +// Copyright 2020 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. + +#ifndef MEDIA_AUDIO_CRAS_CRAS_UTIL_H_ +#define MEDIA_AUDIO_CRAS_CRAS_UTIL_H_ + +#include <cras_client.h> + +#include <cstdint> +#include <string> +#include <vector> + +namespace media { + +enum class DeviceType { kInput, kOutput }; + +struct CrasDevice { + CrasDevice(); + explicit CrasDevice(const cras_ionode_info* node, + const cras_iodev_info* dev, + DeviceType type); + DeviceType type; + uint64_t id; + std::string name; +}; + +// Enumerates all devices of |type|. +std::vector<CrasDevice> CrasGetAudioDevices(DeviceType type); + +// Returns if system AEC is supported in CRAS. +int CrasGetAecSupported(); + +// Returns the system AEC group ID. If no group ID is specified, -1 is +// returned. +int CrasGetAecGroupId(); + +} // namespace media + +#endif // MEDIA_AUDIO_CRAS_CRAS_UTIL_H_ |