From 45f5d0b26d72cb20212cb028a3ad7eae866442bf Mon Sep 17 00:00:00 2001 From: haizhouyang Date: Tue, 22 Feb 2022 20:56:01 +0800 Subject: [PATCH] Add usb headset support Signed-off-by: haizhouyang --- audio/interfaces/include/audio_events.h | 61 +++++++++++++++++++++++++ audio/interfaces/include/audio_types.h | 2 + 2 files changed, 63 insertions(+) create mode 100755 audio/interfaces/include/audio_events.h diff --git a/audio/interfaces/include/audio_events.h b/audio/interfaces/include/audio_events.h new file mode 100755 index 0000000000..dbe40636e5 --- /dev/null +++ b/audio/interfaces/include/audio_events.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Audio + * @{ + * + * @brief Defines audio-related APIs, including custom data types and functions for loading drivers, + * accessing a driver adapter, and rendering and capturing audios. + * + * @since 1.0 + * @version 1.0 + */ + +/** + * @file audio_events.h + * + * @brief Defines the type of audio event used by the media service + * + * @since 1.0 + * @version 1.0 + */ + +#ifndef AUDIO_EVENTS_H +#define AUDIO_EVENTS_H + +#include + +enum AudioEventType { + HDF_AUDIO_DEVICE_ADD = 0x1, + HDF_AUDIO_DEVICE_REMOVE = 0x2, + HDF_AUDIO_EVENT_UNKOWN, +}; + +enum AudioDeviceType { + HDF_AUDIO_LINEOUT = 0x1, + HDF_AUDIO_HEADPHONE = 0x2, + HDF_AUDIO_HEADSET = 0x4, + HDF_AUDIO_USB_HEADSET = 0x8, + HDF_AUDIO_DEVICE_UNKOWN, +}; + +struct AudioEvent { + uint32_t eventType; + uint32_t deviceType; +}; + +#endif /* AUDIO_EVENTS_H */ +/** @} */ diff --git a/audio/interfaces/include/audio_types.h b/audio/interfaces/include/audio_types.h index 34c0974493..14a4984c7c 100755 --- a/audio/interfaces/include/audio_types.h +++ b/audio/interfaces/include/audio_types.h @@ -85,6 +85,8 @@ enum AudioPortPin { PIN_OUT_HEADSET = 0x2u, /**< Wired headset pin for output */ PIN_OUT_LINEOUT = 0x4u, /**< Line-out pin */ PIN_OUT_HDMI = 0x8u, /**< HDMI output pin */ + PIN_OUT_USB = 0x10u, /**< USB device output */ + PIN_OUT_USB_EXT = 0x20u, /**< Extended USB device output */ PIN_IN_MIC = 0x8000001u, /**< Microphone input pin */ PIN_IN_HS_MIC = 0x8000002u, /**< Wired headset microphone pin for input */ PIN_IN_LINEIN = 0x8000004u, /**< Line-in pin */ -- Gitee