From 77346e1dc7ef24b510f2e247df60f4b1ac56d43b Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Sat, 9 Aug 2025 21:41:09 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index c3b40731777..27b5d2dece6 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -244,6 +244,41 @@ typedef void (*OH_AudioSession_CurrentOutputDeviceChangedCallback) ( OH_AudioStream_DeviceChangeReason changeReason, OH_AudioSession_OutputDeviceChangeRecommendedAction recommendedAction); +/** + * @brief This function pointer will point to the callback function that + * is used to return the changing audio device descriptors. + * There may be more than one audio device descriptor returned. + * + * @param type the {@link OH_AudioDevice_ChangeType} is connect or disconnect. + * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} + * pointer variable which will be set the audio device descriptors value. + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioSessionManager_ReleaseDevices} to release the DeviceDescriptor array + * when it is no use anymore. + * @since 21 + */ +typedef int32_t (*OH_AudioSession_AvailableDeviceChangedCallback) ( + OH_AudioDevice_ChangeType type, + OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray +); + +/** + * @brief This function pointer will point to the callback function that + * is used to return the audio session input device change event. + * + * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} + * pointer variable which will be set the audio input device descriptors value. + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioSessionManager_ReleaseDevices} + * to release the DeviceDescriptor array when it is no use anymore. + * @param changeReason the {@link #OH_AudioStream_DeviceChangeReason} indicates + * that why does the input device changes. + * @since 21 + */ +typedef void (*OH_AudioSession_CurrentInputDeviceChangedCallback) ( + OH_AudioDeviceDescriptorArray *devices, + OH_AudioStream_DeviceChangeReason changeReason); + /** * @brief This function pointer will point to the callback function that * is used to return the audio session deactivated event. @@ -467,6 +502,188 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange OH_AudioSessionManager *audioSessionManager, OH_AudioSession_CurrentOutputDeviceChangedCallback callback); +/** + * @brief Get available devices by device usage. + * + * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned + * by {@link OH_AudioManager_GetAudioSessionManager}. + * @param deviceUsage the {@link OH_AudioDevice_Usage}. + * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} + * pointer variable which will be set the audio device descriptors value + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array + * when it is no use anymore. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( + OH_AudioSessionManager *audioSessionManager, + OH_AudioDevice_Usage deviceUsage, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray); + +/** + * @brief Register available device change event callback. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param deviceUsage the {@link OH_AudioDevice_Usage}. + * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used + * to receive the device change event + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback( + OH_AudioSessionManager *audioSessionManager, OH_AudioDevice_Usage deviceUsage, + OH_AudioSession_AvailableDeviceChangedCallback callback); + +/** + * @brief Unregister available device change event callback. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used + * to receive the device change event + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_UnRegisterAvailableDevicesChangeCallback( + OH_AudioSessionManager *audioSessionManager, + OH_AudioSession_AvailableDeviceChangedCallback callback); + +/** + * @brief Sets the input device. + * This function applys on audiocapturers whose SourceType are + * AUDIOSTREAM_SOURCE_TYPE_MIC/AUDIOSTREAM_SOURCE_TYPE_CAMCORDER/AUDIOSTREAM_SOURCE_TYPE_LIVE. + * + * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned + * by {@link OH_AudioManager_GetAudioSessionManager}. + * @param deviceType The target device. The available deviceType must be in the array returned + * by {@link OH_AudioSessionManager_GetAvailableDevices}. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_SelectInputDevice( + OH_AudioSessionManager *audioSessionManager, H_AudioDevice_Type deviceType); + +/** + * @brief Gets the selected input device. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param deviceType The input device type set by + * {@link OH_AudioSessionManager_SelectInputDevice} or AUDIO_DEVICE_TYPE_INVALID if + * not set yet. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedInputDevice( + OH_AudioSessionManager *audioSessionManager, OH_AudioDevice_Type *deviceType); + +/** + * @brief Prefer wireless device to record, such as BLUETOOTH_SCO or NEARLINK. + * + * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned + * by {@link OH_AudioManager_GetAudioSessionManager}. + * @param enable Indicates whether prefer wireless device to record. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessRecord( + OH_AudioSessionManager *audioSessionManager, bool enable); + +/** + * @brief Gets whether prefer wireless device to record. + * + * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned + * by {@link OH_AudioManager_GetAudioSessionManager}. + * @param enable Indicates whether prefer wireless device to record. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessRecord( + OH_AudioSessionManager *audioSessionManager, bool *enable); + +/** + * @brief Prefer full-bandwidth audio, if the wireless device support it. + * + * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned + * by {@link OH_AudioManager_GetAudioSessionManager}. + * @param enable Indicates whether prefer full-bandwidth audio. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessHighQualityRecord( + OH_AudioSessionManager *audioSessionManager, bool enable); + +/** + * @brief Gets whether prefer full-bandwidth audio, if the wireless device support it. + * + * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned + * by {@link OH_AudioManager_GetAudioSessionManager}. + * @param enable Indicates whether prefer full-bandwidth audio. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessHighQualityRecord( + OH_AudioSessionManager *audioSessionManager, bool *enable); + +/** + * @brief Register the audio session input device change event callback. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used + * to receive the input device change event + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback( + OH_AudioSessionManager *audioSessionManager, + OH_AudioSession_CurrentInputDeviceChangedCallback callback); + +/** + * @brief Unregister the audio session input device change event callback. + * + * @param audioSessionManager the {@link #OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used + * to receive the input device change event + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * @since 21 + */ +OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback( + OH_AudioSessionManager *audioSessionManager, + OH_AudioSession_CurrentInputDeviceChangedCallback callback); + #ifdef __cplusplus } #endif -- Gitee From 8fa39d090caac63bf90d54ad9e9c73f052ee1806 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Sat, 9 Aug 2025 21:48:23 +0800 Subject: [PATCH 02/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- multimedia/audio_framework/ohaudio.ndk.json | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 858a405ccc3..f6a634d6803 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -379,6 +379,50 @@ "first_introduced": "12", "name":"OH_AudioSessionManager_UnregisterCurrentOutputDeviceChangeCallback" }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_GetAvailableDevices" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_UnRegisterAvailableDevicesChangeCallback" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_SelectInputDevice" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_GetSelectedInputDevice" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_SetPreferWirelessRecord" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_GetPreferWirelessRecord" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_SetPreferWirelessHighQualityRecord" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_GetPreferWirelessHighQualityRecord" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback" + }, + { + "first_introduced": "12", + "name":"OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback" + }, { "first_introduced": "12", "name": "OH_GetAudioManager" -- Gitee From 84d95fd340be1d34d43feabe805528770bb54fed Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 11 Aug 2025 14:40:55 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 27b5d2dece6..da346263909 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -568,7 +568,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnRegisterAvailableDevicesChangeCal * by {@link OH_AudioSessionManager_GetAvailableDevices}. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ @@ -596,10 +595,9 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedInputDevice( * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param enable Indicates whether prefer wireless device to record. + * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ @@ -614,7 +612,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessRecord( * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ @@ -626,10 +623,9 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessRecord( * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param enable Indicates whether prefer full-bandwidth audio. + * @param enable Indicates whether prefer full-bandwidth audio. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ @@ -644,7 +640,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessHighQualityRecord( * @param enable Indicates whether prefer full-bandwidth audio. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ @@ -656,6 +651,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessHighQualityRecord( * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param sourceType the {@link OH_AudioStream_SourceType}. * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used * to receive the input device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds @@ -666,6 +662,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessHighQualityRecord( */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback( OH_AudioSessionManager *audioSessionManager, + OH_AudioStream_SourceType sourceType, OH_AudioSession_CurrentInputDeviceChangedCallback callback); /** @@ -673,6 +670,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCal * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param sourceType the {@link OH_AudioStream_SourceType}. * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used * to receive the input device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds @@ -682,6 +680,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCal */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback( OH_AudioSessionManager *audioSessionManager, + OH_AudioStream_SourceType sourceType, OH_AudioSession_CurrentInputDeviceChangedCallback callback); #ifdef __cplusplus -- Gitee From e3fc4186ffe16e3103c72a222405d29b3587a31c Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 11 Aug 2025 18:52:26 +0800 Subject: [PATCH 04/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- multimedia/audio_framework/ohaudio.ndk.json | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index f6a634d6803..ff149ac4319 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -380,47 +380,47 @@ "name":"OH_AudioSessionManager_UnregisterCurrentOutputDeviceChangeCallback" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_GetAvailableDevices" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_UnRegisterAvailableDevicesChangeCallback" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_SelectInputDevice" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_GetSelectedInputDevice" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_SetPreferWirelessRecord" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_GetPreferWirelessRecord" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_SetPreferWirelessHighQualityRecord" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_GetPreferWirelessHighQualityRecord" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback" }, { - "first_introduced": "12", + "first_introduced": "21", "name":"OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback" }, { -- Gitee From 2683512cd09460e34b2887359fb5cfd7a03a5d50 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 11 Aug 2025 21:10:28 +0800 Subject: [PATCH 05/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index da346263909..6c11304cb18 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -609,7 +609,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessRecord( * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param enable Indicates whether prefer wireless device to record. + * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. @@ -637,7 +637,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessHighQualityRecord( * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param enable Indicates whether prefer full-bandwidth audio. + * @param enable Indicates whether prefer full-bandwidth audio. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. -- Gitee From 0216d3d8979c9e51e2e81fe7b09bc591e677244f Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Tue, 12 Aug 2025 11:27:46 +0800 Subject: [PATCH 06/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 59 ++++--------------- 1 file changed, 13 insertions(+), 46 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 6c11304cb18..1a3c115abce 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -515,7 +515,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange * when it is no use anymore. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ @@ -533,7 +532,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( * to receive the device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error * @since 21 */ @@ -558,40 +556,41 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnRegisterAvailableDevicesChangeCal OH_AudioSession_AvailableDeviceChangedCallback callback); /** - * @brief Sets the input device. - * This function applys on audiocapturers whose SourceType are - * AUDIOSTREAM_SOURCE_TYPE_MIC/AUDIOSTREAM_SOURCE_TYPE_CAMCORDER/AUDIOSTREAM_SOURCE_TYPE_LIVE. + * @brief Sets the media input device. + * This function is not valid for call recording, whose SourceType is + * SOURCE_TYPE_VOICE_CALL or SOURCE_TYPE_VOICE_COMMUNICATION. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. * @param deviceType The target device. The available deviceType must be in the array returned - * by {@link OH_AudioSessionManager_GetAvailableDevices}. + * by {@link OH_AudioSessionManager_GetAvailableDevices} or AUDIO_DEVICE_TYPE_INVALID. + * When the AUDIO_DEVICE_TYPE_INVALID is passed, it clears the last selection. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_SelectInputDevice( +OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( OH_AudioSessionManager *audioSessionManager, H_AudioDevice_Type deviceType); /** - * @brief Gets the selected input device. + * @brief Gets the selected media input device. * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param deviceType The input device type set by - * {@link OH_AudioSessionManager_SelectInputDevice} or AUDIO_DEVICE_TYPE_INVALID if + * {@link OH_AudioSessionManager_SelectMediaInputDevice} or AUDIO_DEVICE_TYPE_INVALID if * not set yet. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails * or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedInputDevice( +OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( OH_AudioSessionManager *audioSessionManager, OH_AudioDevice_Type *deviceType); /** - * @brief Prefer wireless device to record, such as BLUETOOTH_SCO or NEARLINK. + * @brief prefer bluetooth and nearlink device to record. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. @@ -601,11 +600,11 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedInputDevice( * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessRecord( +OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( OH_AudioSessionManager *audioSessionManager, bool enable); /** - * @brief Gets whether prefer wireless device to record. + * @brief Gets whether prefer bluetooth and nearlink device to record. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. @@ -615,35 +614,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessRecord( * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessRecord( - OH_AudioSessionManager *audioSessionManager, bool *enable); - -/** - * @brief Prefer full-bandwidth audio, if the wireless device support it. - * - * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned - * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param enable Indicates whether prefer full-bandwidth audio. - * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. - * @since 21 - */ -OH_AudioCommon_Result OH_AudioSessionManager_SetPreferWirelessHighQualityRecord( - OH_AudioSessionManager *audioSessionManager, bool enable); - -/** - * @brief Gets whether prefer full-bandwidth audio, if the wireless device support it. - * - * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned - * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param enable Indicates whether prefer full-bandwidth audio. - * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. - * @since 21 - */ -OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessHighQualityRecord( +OH_AudioCommon_Result OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord( OH_AudioSessionManager *audioSessionManager, bool *enable); /** @@ -651,7 +622,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessHighQualityRecord( * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} - * @param sourceType the {@link OH_AudioStream_SourceType}. * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used * to receive the input device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds @@ -662,7 +632,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferWirelessHighQualityRecord( */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback( OH_AudioSessionManager *audioSessionManager, - OH_AudioStream_SourceType sourceType, OH_AudioSession_CurrentInputDeviceChangedCallback callback); /** @@ -670,7 +639,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCal * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} - * @param sourceType the {@link OH_AudioStream_SourceType}. * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used * to receive the input device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds @@ -680,7 +648,6 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCal */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback( OH_AudioSessionManager *audioSessionManager, - OH_AudioStream_SourceType sourceType, OH_AudioSession_CurrentInputDeviceChangedCallback callback); #ifdef __cplusplus -- Gitee From 7b9df485e8a5906f6672607347ded8d017248285 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Tue, 12 Aug 2025 11:45:34 +0800 Subject: [PATCH 07/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- multimedia/audio_framework/ohaudio.ndk.json | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index ff149ac4319..311059da232 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -393,27 +393,19 @@ }, { "first_introduced": "21", - "name":"OH_AudioSessionManager_SelectInputDevice" + "name":"OH_AudioSessionManager_SelectMediaInputDevice" }, { "first_introduced": "21", - "name":"OH_AudioSessionManager_GetSelectedInputDevice" + "name":"OH_AudioSessionManager_GetSelectedMediaInputDevice" }, { "first_introduced": "21", - "name":"OH_AudioSessionManager_SetPreferWirelessRecord" + "name":"OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord" }, { "first_introduced": "21", - "name":"OH_AudioSessionManager_GetPreferWirelessRecord" - }, - { - "first_introduced": "21", - "name":"OH_AudioSessionManager_SetPreferWirelessHighQualityRecord" - }, - { - "first_introduced": "21", - "name":"OH_AudioSessionManager_GetPreferWirelessHighQualityRecord" + "name":"OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord" }, { "first_introduced": "21", -- Gitee From d817374f000f8802f8f1289f92e39ec2aa583311 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Tue, 12 Aug 2025 14:23:37 +0800 Subject: [PATCH 08/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 1a3c115abce..ee23c8a6db4 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -225,25 +225,6 @@ typedef struct OH_AudioSession_StateChangedEvent { typedef void (*OH_AudioSession_StateChangedCallback) ( OH_AudioSession_StateChangedEvent event); -/** - * @brief This function pointer will point to the callback function that - * is used to return the audio session device change event. - * - * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} - * pointer variable which will be set the audio device descriptors value. - * Do not release the audioDeviceDescriptorArray pointer separately - * instead call {@link OH_AudioSessionManager_ReleaseDevices} - * to release the DeviceDescriptor array when it is no use anymore. - * @param changeReason the {@link #OH_AudioStream_DeviceChangeReason} indicates that why does the device changes. - * @param recommendedAction the {@link #OH_AudioSession_OutputDeviceChangeRecommendedAction} - * recommend action when device change. - * @since 20 - */ -typedef void (*OH_AudioSession_CurrentOutputDeviceChangedCallback) ( - OH_AudioDeviceDescriptorArray *devices, - OH_AudioStream_DeviceChangeReason changeReason, - OH_AudioSession_OutputDeviceChangeRecommendedAction recommendedAction); - /** * @brief This function pointer will point to the callback function that * is used to return the changing audio device descriptors. @@ -259,8 +240,7 @@ typedef void (*OH_AudioSession_CurrentOutputDeviceChangedCallback) ( */ typedef int32_t (*OH_AudioSession_AvailableDeviceChangedCallback) ( OH_AudioDevice_ChangeType type, - OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray -); + OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray); /** * @brief This function pointer will point to the callback function that @@ -279,6 +259,25 @@ typedef void (*OH_AudioSession_CurrentInputDeviceChangedCallback) ( OH_AudioDeviceDescriptorArray *devices, OH_AudioStream_DeviceChangeReason changeReason); +/** + * @brief This function pointer will point to the callback function that + * is used to return the audio session device change event. + * + * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} + * pointer variable which will be set the audio device descriptors value. + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioSessionManager_ReleaseDevices} + * to release the DeviceDescriptor array when it is no use anymore. + * @param changeReason the {@link #OH_AudioStream_DeviceChangeReason} indicates that why does the device changes. + * @param recommendedAction the {@link #OH_AudioSession_OutputDeviceChangeRecommendedAction} + * recommend action when device change. + * @since 20 + */ +typedef void (*OH_AudioSession_CurrentOutputDeviceChangedCallback) ( + OH_AudioDeviceDescriptorArray *devices, + OH_AudioStream_DeviceChangeReason changeReason, + OH_AudioSession_OutputDeviceChangeRecommendedAction recommendedAction); + /** * @brief This function pointer will point to the callback function that * is used to return the audio session deactivated event. @@ -529,7 +528,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param deviceUsage the {@link OH_AudioDevice_Usage}. * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used - * to receive the device change event + * to receive available device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error -- Gitee From 64a33f981c87f370175d7b03564ed7609b52b9df Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Tue, 12 Aug 2025 14:51:43 +0800 Subject: [PATCH 09/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index ee23c8a6db4..bc1c8c32e7d 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -239,6 +239,7 @@ typedef void (*OH_AudioSession_StateChangedCallback) ( * @since 21 */ typedef int32_t (*OH_AudioSession_AvailableDeviceChangedCallback) ( + OH_AudioDevice_ChangeType type, OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray); @@ -514,7 +515,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange * when it is no use anymore. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( @@ -531,7 +532,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( * to receive available device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback( @@ -547,10 +548,10 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallb * to receive the device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_UnRegisterAvailableDevicesChangeCallback( +OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCallback( OH_AudioSessionManager *audioSessionManager, OH_AudioSession_AvailableDeviceChangedCallback callback); @@ -566,7 +567,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnRegisterAvailableDevicesChangeCal * When the AUDIO_DEVICE_TYPE_INVALID is passed, it clears the last selection. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( @@ -582,7 +583,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( * not set yet. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( @@ -596,7 +597,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( @@ -626,7 +627,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback( @@ -642,7 +643,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCal * to receive the input device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback( -- Gitee From 757d46315ff4eabb9a51bfe8bfecf9d2da209a2d Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Tue, 12 Aug 2025 17:49:24 +0800 Subject: [PATCH 10/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 109 +++++++++--------- 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index bc1c8c32e7d..47c2b6df6b4 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -227,33 +227,32 @@ typedef void (*OH_AudioSession_StateChangedCallback) ( /** * @brief This function pointer will point to the callback function that - * is used to return the changing audio device descriptors. - * There may be more than one audio device descriptor returned. + * is used to return the changing audio device descriptors. + * There may be more than one audio device descriptor returned. * * @param type the {@link OH_AudioDevice_ChangeType} is connect or disconnect. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} - * pointer variable which will be set the audio device descriptors value. - * Do not release the audioDeviceDescriptorArray pointer separately - * instead call {@link OH_AudioSessionManager_ReleaseDevices} to release the DeviceDescriptor array - * when it is no use anymore. + * pointer variable which will be set the audio device descriptors value. + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioSessionManager_ReleaseDevices} to release the DeviceDescriptor array + * when it is no use anymore. * @since 21 */ typedef int32_t (*OH_AudioSession_AvailableDeviceChangedCallback) ( - OH_AudioDevice_ChangeType type, OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray); /** * @brief This function pointer will point to the callback function that - * is used to return the audio session input device change event. + * is used to return the audio session input device change event. * * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} - * pointer variable which will be set the audio input device descriptors value. - * Do not release the audioDeviceDescriptorArray pointer separately - * instead call {@link OH_AudioSessionManager_ReleaseDevices} - * to release the DeviceDescriptor array when it is no use anymore. + * pointer variable which will be set the audio input device descriptors value. + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioSessionManager_ReleaseDevices} + * to release the DeviceDescriptor array when it is no use anymore. * @param changeReason the {@link #OH_AudioStream_DeviceChangeReason} indicates - * that why does the input device changes. + * that why does the input device changes. * @since 21 */ typedef void (*OH_AudioSession_CurrentInputDeviceChangedCallback) ( @@ -506,16 +505,16 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange * @brief Get available devices by device usage. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned - * by {@link OH_AudioManager_GetAudioSessionManager}. + * by {@link OH_AudioManager_GetAudioSessionManager}. * @param deviceUsage the {@link OH_AudioDevice_Usage}. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} - * pointer variable which will be set the audio device descriptors value - * Do not release the audioDeviceDescriptorArray pointer separately - * instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array - * when it is no use anymore. + * pointer variable which will be set the audio device descriptors value + * Do not release the audioDeviceDescriptorArray pointer separately + * instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array + * when it is no use anymore. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( @@ -526,13 +525,13 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( * @brief Register available device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param deviceUsage the {@link OH_AudioDevice_Usage}. * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used - * to receive available device change event + * to receive available device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback( @@ -543,12 +542,12 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallb * @brief Unregister available device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used - * to receive the device change event + * to receive the device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCallback( @@ -557,17 +556,17 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal /** * @brief Sets the media input device. - * This function is not valid for call recording, whose SourceType is - * SOURCE_TYPE_VOICE_CALL or SOURCE_TYPE_VOICE_COMMUNICATION. + * This function is not valid for call recording, whose SourceType is + * SOURCE_TYPE_VOICE_CALL or SOURCE_TYPE_VOICE_COMMUNICATION. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned - * by {@link OH_AudioManager_GetAudioSessionManager}. + * by {@link OH_AudioManager_GetAudioSessionManager}. * @param deviceType The target device. The available deviceType must be in the array returned - * by {@link OH_AudioSessionManager_GetAvailableDevices} or AUDIO_DEVICE_TYPE_INVALID. - * When the AUDIO_DEVICE_TYPE_INVALID is passed, it clears the last selection. + * by {@link OH_AudioSessionManager_GetAvailableDevices} or AUDIO_DEVICE_TYPE_INVALID. + * When the AUDIO_DEVICE_TYPE_INVALID is passed, it clears the last selection. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( @@ -577,13 +576,13 @@ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( * @brief Gets the selected media input device. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param deviceType The input device type set by - * {@link OH_AudioSessionManager_SelectMediaInputDevice} or AUDIO_DEVICE_TYPE_INVALID if - * not set yet. + * {@link OH_AudioSessionManager_SelectMediaInputDevice} or AUDIO_DEVICE_TYPE_INVALID if + * not set yet. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( @@ -593,11 +592,11 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( * @brief prefer bluetooth and nearlink device to record. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned - * by {@link OH_AudioManager_GetAudioSessionManager}. + * by {@link OH_AudioManager_GetAudioSessionManager}. * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( @@ -607,11 +606,11 @@ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( * @brief Gets whether prefer bluetooth and nearlink device to record. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned - * by {@link OH_AudioManager_GetAudioSessionManager}. + * by {@link OH_AudioManager_GetAudioSessionManager}. * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord( @@ -621,13 +620,13 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord * @brief Register the audio session input device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used - * to receive the input device change event + * to receive the input device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback( @@ -638,12 +637,12 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCal * @brief Unregister the audio session input device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used - * to receive the input device change event + * to receive the input device change event * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback( -- Gitee From 63301ff94ebfd552358d916411408dc1831fca94 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Fri, 22 Aug 2025 20:27:29 +0800 Subject: [PATCH 11/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 47c2b6df6b4..b17d6f006ac 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -238,7 +238,7 @@ typedef void (*OH_AudioSession_StateChangedCallback) ( * when it is no use anymore. * @since 21 */ -typedef int32_t (*OH_AudioSession_AvailableDeviceChangedCallback) ( +typedef void (*OH_AudioSession_AvailableDeviceChangedCallback) ( OH_AudioDevice_ChangeType type, OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray); -- Gitee From ad8cedfbf85d9e88af113a5a05febabb3c12ee9d Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Sat, 23 Aug 2025 18:52:20 +0800 Subject: [PATCH 12/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_routing_manager.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index b0f360a9544..0f460633a9b 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -118,7 +118,8 @@ OH_AudioCommon_Result OH_AudioRoutingManager_GetDevices( * * @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned * by {@link OH_AudioManager_GetAudioRoutingManager}. - * @param deviceUsage the {@link OH_AudioDevice_Usage}. + * @param deviceUsage the {@link OH_AudioDevice_Usage} which is used as + * the filter parameter for getting the available devices. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value * Do not release the audioDeviceDescriptorArray pointer separately @@ -142,7 +143,8 @@ OH_AudioCommon_Result OH_AudioRoutingManager_GetAvailableDevices( * * @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned * by {@link OH_AudioManager_GetAudioRoutingManager}. - * @param streamUsage the {@link OH_AudioStream_Usage}. + * @param streamUsage the {@link OH_AudioStream_Usage} which is used as + * the filter parameter for getting the prefer output devices. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value * Do not release the audioDeviceDescriptorArray pointer separately -- Gitee From 7e62952c341956e019bc81edee92e10002ba91d4 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 25 Aug 2025 21:08:36 +0800 Subject: [PATCH 13/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index b17d6f006ac..250e30c30b5 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -514,7 +514,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange * when it is no use anymore. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( @@ -528,10 +528,10 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param deviceUsage the {@link OH_AudioDevice_Usage}. * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used - * to receive available device change event - * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * to receive available device change event. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback( @@ -542,12 +542,12 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallb * @brief Unregister available device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used - * to receive the device change event - * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * to receive the device change event. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCallback( @@ -566,7 +566,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * When the AUDIO_DEVICE_TYPE_INVALID is passed, it clears the last selection. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( @@ -576,13 +576,13 @@ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( * @brief Gets the selected media input device. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. * @param deviceType The input device type set by * {@link OH_AudioSessionManager_SelectMediaInputDevice} or AUDIO_DEVICE_TYPE_INVALID if * not set yet. - * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( @@ -596,7 +596,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( @@ -610,7 +610,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord( @@ -620,13 +620,13 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord * @brief Register the audio session input device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used - * to receive the input device change event - * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error + * to receive the input device change event. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. + * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback( @@ -637,11 +637,11 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCal * @brief Unregister the audio session input device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used - * to receive the input device change event - * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds - * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * to receive the input device change event. + * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. + * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ -- Gitee From eb5d31ac91940fd68dc54961d3a8e72203d5504d Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Wed, 27 Aug 2025 09:28:01 +0800 Subject: [PATCH 14/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_routing_manager.h | 6 ++---- .../native_audio_session_manager.h | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h index 0f460633a9b..b0f360a9544 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_routing_manager.h @@ -118,8 +118,7 @@ OH_AudioCommon_Result OH_AudioRoutingManager_GetDevices( * * @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned * by {@link OH_AudioManager_GetAudioRoutingManager}. - * @param deviceUsage the {@link OH_AudioDevice_Usage} which is used as - * the filter parameter for getting the available devices. + * @param deviceUsage the {@link OH_AudioDevice_Usage}. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value * Do not release the audioDeviceDescriptorArray pointer separately @@ -143,8 +142,7 @@ OH_AudioCommon_Result OH_AudioRoutingManager_GetAvailableDevices( * * @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned * by {@link OH_AudioManager_GetAudioRoutingManager}. - * @param streamUsage the {@link OH_AudioStream_Usage} which is used as - * the filter parameter for getting the prefer output devices. + * @param streamUsage the {@link OH_AudioStream_Usage}. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value * Do not release the audioDeviceDescriptorArray pointer separately diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 250e30c30b5..e16e5d1e569 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -238,7 +238,7 @@ typedef void (*OH_AudioSession_StateChangedCallback) ( * when it is no use anymore. * @since 21 */ -typedef void (*OH_AudioSession_AvailableDeviceChangedCallback) ( +typedef void (*OH_AudioSession_AvailableDeviceChangeCallback) ( OH_AudioDevice_ChangeType type, OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray); @@ -506,7 +506,8 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param deviceUsage the {@link OH_AudioDevice_Usage}. + * @param deviceUsage the {@link OH_AudioDevice_Usage} which is used as + * the filter parameter for getting the available devices. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value * Do not release the audioDeviceDescriptorArray pointer separately @@ -526,8 +527,9 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} - * @param deviceUsage the {@link OH_AudioDevice_Usage}. - * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used + * @param deviceUsage the {@link OH_AudioDevice_Usage} which is used as + * the filter parameter for register the available devices change event. + * @param callback the {@link #OH_AudioSession_AvailableDeviceChangeCallback} which is used * to receive available device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. @@ -536,14 +538,14 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback( OH_AudioSessionManager *audioSessionManager, OH_AudioDevice_Usage deviceUsage, - OH_AudioSession_AvailableDeviceChangedCallback callback); + OH_AudioSession_AvailableDeviceChangeCallback callback); /** * @brief Unregister available device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. - * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used + * @param callback the {@link #OH_AudioSession_AvailableDeviceChangeCallback} which is used * to receive the device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. @@ -552,7 +554,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallb */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCallback( OH_AudioSessionManager *audioSessionManager, - OH_AudioSession_AvailableDeviceChangedCallback callback); + OH_AudioSession_AvailableDeviceChangeCallback callback); /** * @brief Sets the media input device. @@ -613,7 +615,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord( +OH_AudioCommon_Result OH_AudioSessionManager_GetPreferredBluetoothAndNearlinkRecord( OH_AudioSessionManager *audioSessionManager, bool *enable); /** -- Gitee From e05e8777966f9ca1ad9a0f9cd3c9244578ff3f7d Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Wed, 27 Aug 2025 09:30:17 +0800 Subject: [PATCH 15/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index e16e5d1e569..52666c10570 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -255,7 +255,7 @@ typedef void (*OH_AudioSession_AvailableDeviceChangeCallback) ( * that why does the input device changes. * @since 21 */ -typedef void (*OH_AudioSession_CurrentInputDeviceChangedCallback) ( +typedef void (*OH_AudioSession_CurrentInputDeviceChangeCallback) ( OH_AudioDeviceDescriptorArray *devices, OH_AudioStream_DeviceChangeReason changeReason); @@ -623,7 +623,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferredBluetoothAndNearlinkRec * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. - * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used + * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangeCallback} which is used * to receive the input device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. @@ -633,14 +633,14 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetPreferredBluetoothAndNearlinkRec */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback( OH_AudioSessionManager *audioSessionManager, - OH_AudioSession_CurrentInputDeviceChangedCallback callback); + OH_AudioSession_CurrentInputDeviceChangeCallback callback); /** * @brief Unregister the audio session input device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. - * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used + * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangeCallback} which is used * to receive the input device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. @@ -649,7 +649,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCal */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback( OH_AudioSessionManager *audioSessionManager, - OH_AudioSession_CurrentInputDeviceChangedCallback callback); + OH_AudioSession_CurrentInputDeviceChangeCallback callback); #ifdef __cplusplus } -- Gitee From ee884b0ce0bac81f1a06589276bd8e20ac62296f Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Wed, 27 Aug 2025 20:24:09 +0800 Subject: [PATCH 16/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 52666c10570..bd60c582b5c 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -615,7 +615,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_GetPreferredBluetoothAndNearlinkRecord( +OH_AudioCommon_Result OH_AudioSessionManager_IsPreferredBluetoothAndNearlinkRecord( OH_AudioSessionManager *audioSessionManager, bool *enable); /** -- Gitee From c15d5b1cb54fb8082910359a0892675e7e59ce65 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Wed, 3 Sep 2025 16:46:39 +0800 Subject: [PATCH 17/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index bd60c582b5c..579440601e4 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -238,7 +238,7 @@ typedef void (*OH_AudioSession_StateChangedCallback) ( * when it is no use anymore. * @since 21 */ -typedef void (*OH_AudioSession_AvailableDeviceChangeCallback) ( +typedef void (*OH_AudioSession_AvailableDeviceChangedCallback) ( OH_AudioDevice_ChangeType type, OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray); @@ -255,7 +255,7 @@ typedef void (*OH_AudioSession_AvailableDeviceChangeCallback) ( * that why does the input device changes. * @since 21 */ -typedef void (*OH_AudioSession_CurrentInputDeviceChangeCallback) ( +typedef void (*OH_AudioSession_CurrentInputDeviceChangedCallback) ( OH_AudioDeviceDescriptorArray *devices, OH_AudioStream_DeviceChangeReason changeReason); @@ -506,8 +506,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param deviceUsage the {@link OH_AudioDevice_Usage} which is used as - * the filter parameter for getting the available devices. + * @param deviceUsage the {@link OH_AudioDevice_Usage} to get. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value * Do not release the audioDeviceDescriptorArray pointer separately @@ -515,7 +514,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange * when it is no use anymore. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( @@ -527,34 +526,33 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} - * @param deviceUsage the {@link OH_AudioDevice_Usage} which is used as - * the filter parameter for register the available devices change event. - * @param callback the {@link #OH_AudioSession_AvailableDeviceChangeCallback} which is used + * @param deviceUsage the {@link OH_AudioDevice_Usage} to get. + * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used * to receive available device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback( OH_AudioSessionManager *audioSessionManager, OH_AudioDevice_Usage deviceUsage, - OH_AudioSession_AvailableDeviceChangeCallback callback); + OH_AudioSession_AvailableDeviceChangedCallback callback); /** * @brief Unregister available device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. - * @param callback the {@link #OH_AudioSession_AvailableDeviceChangeCallback} which is used + * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used * to receive the device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCallback( OH_AudioSessionManager *audioSessionManager, - OH_AudioSession_AvailableDeviceChangeCallback callback); + OH_AudioSession_AvailableDeviceChangedCallback callback); /** * @brief Sets the media input device. @@ -568,7 +566,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * When the AUDIO_DEVICE_TYPE_INVALID is passed, it clears the last selection. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( @@ -584,7 +582,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( * not set yet. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( @@ -598,7 +596,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( @@ -612,7 +610,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( * @param enable Indicates whether prefer wireless device to record. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_IsPreferredBluetoothAndNearlinkRecord( @@ -623,33 +621,33 @@ OH_AudioCommon_Result OH_AudioSessionManager_IsPreferredBluetoothAndNearlinkReco * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. - * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangeCallback} which is used + * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used * to receive the input device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback( OH_AudioSessionManager *audioSessionManager, - OH_AudioSession_CurrentInputDeviceChangeCallback callback); + OH_AudioSession_CurrentInputDeviceChangedCallback callback); /** * @brief Unregister the audio session input device change event callback. * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. - * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangeCallback} which is used + * @param callback the {@link #OH_AudioSession_CurrentInputDeviceChangedCallback} which is used * to receive the input device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. - * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio audio service error, System error. + * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback( OH_AudioSessionManager *audioSessionManager, - OH_AudioSession_CurrentInputDeviceChangeCallback callback); + OH_AudioSession_CurrentInputDeviceChangedCallback callback); #ifdef __cplusplus } -- Gitee From 354f1c4eff714ef87e0e4aa80a975a7b20e2c8db Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 8 Sep 2025 11:03:16 +0800 Subject: [PATCH 18/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 68 +++++++++++++++---- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 579440601e4..7b788aaae94 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -179,6 +179,34 @@ typedef enum { DEACTIVATED_TIMEOUT = 1, } OH_AudioSession_DeactivatedReason; +/** + * @brief Enumerates the categories that app pefer to use when recording with Bluetooth and Nearlink. + * + * @since 21 + */ +typedef enum { + /** + * @brief Not prefer to use Bluetooth and Nearlink record. + */ + PREFERRED_NONE = 0, + + /** + * @brief Prefer to use Bluetooth and Nearlink record. However, + * whether to use low latency or high quality recording dpends on system. + */ + PREFERRED_DEFAULT = 1, + + /** + * @brief Prefer to use Bluetooth and Nearlink low latency mode to record. + */ + PREFERRED_LOW_LATENCY = 1, + + /** + * @brief Prefer to use Bluetooth and Nearlink high quality mode to record. + */ + PREFERRED_LOW_LATENCY = 1, +} OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory; + /** * @brief declare the audio session strategy * @@ -558,19 +586,23 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * @brief Sets the media input device. * This function is not valid for call recording, whose SourceType is * SOURCE_TYPE_VOICE_CALL or SOURCE_TYPE_VOICE_COMMUNICATION. - * + * In scenarios where there are concurrent recording streams with higher priority, + * the actual input device used by the app may differ from the selected one. + * The application can use {@link OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback} + * to register a callback to listen for the actual input device. + * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param deviceType The target device. The available deviceType must be in the array returned - * by {@link OH_AudioSessionManager_GetAvailableDevices} or AUDIO_DEVICE_TYPE_INVALID. - * When the AUDIO_DEVICE_TYPE_INVALID is passed, it clears the last selection. + * @param deviceDescriptor The target device. The available device must be in the array returned + * by {@link OH_AudioSessionManager_GetAvailableDevices}. + * When the nullptr is passed, system will clear the last selection. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( - OH_AudioSessionManager *audioSessionManager, H_AudioDevice_Type deviceType); + OH_AudioSessionManager *audioSessionManager, OH_AudioDeviceDescriptor *deviceDescriptor); /** * @brief Gets the selected media input device. @@ -589,32 +621,40 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( OH_AudioSessionManager *audioSessionManager, OH_AudioDevice_Type *deviceType); /** - * @brief prefer bluetooth and nearlink device to record. - * + * @brief Set the prefered record category with bluetooth and nearlink device. + * The app can set this category before Bluetooth or Nearlink connected, and the system will + * prefer to use Bluetooth or Nearlink to record when the device connected. + * In scenarios where there are concurrent recording streams with higher priority, + * the actual input device used by the app may differ from the prefered one. + * The application can use {@link OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback} + * to register a callback to listen for the actual input device. + * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param enable Indicates whether prefer wireless device to record. + * @param category The category app pefer to use when recording with Bluetooth or Nearlink. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord( - OH_AudioSessionManager *audioSessionManager, bool enable); +OH_AudioCommon_Result OH_AudioSessionManager_SetBluetoothAndNearlinkPreferredRecordCategory( + OH_AudioSessionManager *audioSessionManager, + OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory category); /** - * @brief Gets whether prefer bluetooth and nearlink device to record. + * @brief Get the prefered record category with bluetooth and nearlink device. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param enable Indicates whether prefer wireless device to record. + * @param category The category app pefer to use when recording with Bluetooth or Nearlink. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ -OH_AudioCommon_Result OH_AudioSessionManager_IsPreferredBluetoothAndNearlinkRecord( - OH_AudioSessionManager *audioSessionManager, bool *enable); +OH_AudioCommon_Result OH_AudioSessionManager_GetBluetoothAndNearlinkPreferredRecordCategory( + OH_AudioSessionManager *audioSessionManager, + OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory *category); /** * @brief Register the audio session input device change event callback. -- Gitee From 7a9946df8fb95d04ee13fbc77b2c0f4c166f9e08 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 8 Sep 2025 14:27:50 +0800 Subject: [PATCH 19/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 7b788aaae94..f58daf59d39 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -180,29 +180,31 @@ typedef enum { } OH_AudioSession_DeactivatedReason; /** - * @brief Enumerates the categories that app pefer to use when recording with Bluetooth and Nearlink. + * @brief Enumerates the categories application prefer to use + * when recording with bluetooth and nearlink. * * @since 21 */ typedef enum { /** - * @brief Not prefer to use Bluetooth and Nearlink record. + * @brief Not prefer to use bluetooth and nearlink record. */ PREFERRED_NONE = 0, /** - * @brief Prefer to use Bluetooth and Nearlink record. However, - * whether to use low latency or high quality recording dpends on system. + * @brief Prefer to use bluetooth and nearlink record. + * However, whether to use low latency or high quality recording + * dpends on system. */ PREFERRED_DEFAULT = 1, /** - * @brief Prefer to use Bluetooth and Nearlink low latency mode to record. + * @brief Prefer to use bluetooth and nearlink low latency mode to record. */ PREFERRED_LOW_LATENCY = 1, /** - * @brief Prefer to use Bluetooth and Nearlink high quality mode to record. + * @brief Prefer to use bluetooth and nearlink high quality mode to record. */ PREFERRED_LOW_LATENCY = 1, } OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory; @@ -530,15 +532,16 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange OH_AudioSession_CurrentOutputDeviceChangedCallback callback); /** - * @brief Get available devices by device usage. + * @brief Gets available devices by device usage. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param deviceUsage the {@link OH_AudioDevice_Usage} to get. + * @param deviceUsage the {@link OH_AudioDevice_Usage} which is used as + * the filter parameter for get the available devices. * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value * Do not release the audioDeviceDescriptorArray pointer separately - * instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array + * instead call {@link OH_AudioSessionManager_ReleaseDevices} to release the DeviceDescriptor array * when it is no use anymore. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. @@ -554,7 +557,8 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetAvailableDevices( * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} - * @param deviceUsage the {@link OH_AudioDevice_Usage} to get. + * @param deviceUsage the {@link OH_AudioDevice_Usage} which is used as + * the filter parameter for register the available devices change event. * @param callback the {@link #OH_AudioSession_AvailableDeviceChangedCallback} which is used * to receive available device change event. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. @@ -587,7 +591,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * This function is not valid for call recording, whose SourceType is * SOURCE_TYPE_VOICE_CALL or SOURCE_TYPE_VOICE_COMMUNICATION. * In scenarios where there are concurrent recording streams with higher priority, - * the actual input device used by the app may differ from the selected one. + * the actual input device used by the application may differ from the selected one. * The application can use {@link OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback} * to register a callback to listen for the actual input device. * @@ -621,17 +625,17 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( OH_AudioSessionManager *audioSessionManager, OH_AudioDevice_Type *deviceType); /** - * @brief Set the prefered record category with bluetooth and nearlink device. - * The app can set this category before Bluetooth or Nearlink connected, and the system will - * prefer to use Bluetooth or Nearlink to record when the device connected. + * @brief Sets the prefered record category with bluetooth and nearlink device. + * The application can set this category before bluetooth and nearlink connected, and the system will + * prefer to use bluetooth and nearlink to record when the device connected. * In scenarios where there are concurrent recording streams with higher priority, - * the actual input device used by the app may differ from the prefered one. + * the actual input device used by the application may differ from the prefered one. * The application can use {@link OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback} * to register a callback to listen for the actual input device. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param category The category app pefer to use when recording with Bluetooth or Nearlink. + * @param category The category application prefer to use when recording with bluetooth and nearlink. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. @@ -642,11 +646,11 @@ OH_AudioCommon_Result OH_AudioSessionManager_SetBluetoothAndNearlinkPreferredRec OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory category); /** - * @brief Get the prefered record category with bluetooth and nearlink device. + * @brief Gets the prefered record category with bluetooth and nearlink device. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param category The category app pefer to use when recording with Bluetooth or Nearlink. + * @param category The category application prefer to use when recording with bluetooth and nearlink. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. -- Gitee From d3259421bd5c6956b2ef49c68ae1a59a43d98d9d Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 8 Sep 2025 14:30:51 +0800 Subject: [PATCH 20/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index f58daf59d39..85de0f3ed50 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -201,12 +201,12 @@ typedef enum { /** * @brief Prefer to use bluetooth and nearlink low latency mode to record. */ - PREFERRED_LOW_LATENCY = 1, + PREFERRED_LOW_LATENCY = 2, /** * @brief Prefer to use bluetooth and nearlink high quality mode to record. */ - PREFERRED_LOW_LATENCY = 1, + PREFERRED_LOW_LATENCY = 3, } OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory; /** -- Gitee From 4511f5645fae4b3e07a92e094535703d977d77b4 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 8 Sep 2025 22:09:48 +0800 Subject: [PATCH 21/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../native_audio_session_manager.h | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 85de0f3ed50..587833a6e92 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -597,7 +597,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param deviceDescriptor The target device. The available device must be in the array returned + * @param audioDeviceDescriptor The target device. The available device must be in the array returned * by {@link OH_AudioSessionManager_GetAvailableDevices}. * When the nullptr is passed, system will clear the last selection. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. @@ -606,23 +606,26 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( - OH_AudioSessionManager *audioSessionManager, OH_AudioDeviceDescriptor *deviceDescriptor); + OH_AudioSessionManager *audioSessionManager, OH_AudioDeviceDescriptor *audioDeviceDescriptor); /** * @brief Gets the selected media input device. * * @param audioSessionManager the {@link #OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager}. - * @param deviceType The input device type set by - * {@link OH_AudioSessionManager_SelectMediaInputDevice} or AUDIO_DEVICE_TYPE_INVALID if - * not set yet. + * @param audioDeviceDescriptor The target device set by + * {@link OH_AudioSessionManager_SelectMediaInputDevice} or + * device with AUDIO_DEVICE_TYPE_INVALID if not set yet. + * Do not release the audioDeviceDescriptor pointer separately, + * instead call {@link OH_AudioSessionManager_ReleaseDevice} to release it + * when it is no use anymore. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. * or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} Audio client call audio service error, System error. * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( - OH_AudioSessionManager *audioSessionManager, OH_AudioDevice_Type *deviceType); + OH_AudioSessionManager *audioSessionManager, OH_AudioDeviceDescriptor **audioDeviceDescriptor); /** * @brief Sets the prefered record category with bluetooth and nearlink device. @@ -693,6 +696,20 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeC OH_AudioSessionManager *audioSessionManager, OH_AudioSession_CurrentInputDeviceChangedCallback callback); +/** + * @brief Release the audio device descriptor object. + * + * @param audioSessionManager the {@link OH_AudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * @param audioDeviceDescriptor Audio device descriptor should be released. + * @return {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. + * or {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails + * @since 20 + */ +OH_AudioCommon_Result OH_AudioSessionManager_ReleaseDevice( + OH_AudioSessionManager *audioSessionManager, + OH_AudioDeviceDescriptorArray *audioDeviceDescriptor); + #ifdef __cplusplus } #endif -- Gitee From 32941511c773a7679bde8aa34af8fdb82b2d4e0c Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Mon, 8 Sep 2025 22:15:53 +0800 Subject: [PATCH 22/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 587833a6e92..12d52daaa6e 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -700,11 +700,11 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeC * @brief Release the audio device descriptor object. * * @param audioSessionManager the {@link OH_AudioSessionManager} - * returned by the {@link #OH_AudioManager_GetAudioSessionManager} + * returned by the {@link #OH_AudioManager_GetAudioSessionManager} * @param audioDeviceDescriptor Audio device descriptor should be released. * @return {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. * or {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails - * @since 20 + * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_ReleaseDevice( OH_AudioSessionManager *audioSessionManager, -- Gitee From fda7ddc5c67127eeb0544b21b86647b20952c464 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Tue, 9 Sep 2025 09:37:53 +0800 Subject: [PATCH 23/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 12d52daaa6e..395964bc020 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -206,7 +206,7 @@ typedef enum { /** * @brief Prefer to use bluetooth and nearlink high quality mode to record. */ - PREFERRED_LOW_LATENCY = 3, + PREFERRED_HIGH_QUALITY = 3, } OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory; /** -- Gitee From 9d17027a8d4b138a2481b47b8050a628bf61b022 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Tue, 9 Sep 2025 11:03:48 +0800 Subject: [PATCH 24/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 395964bc020..8dc17c4cc28 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -708,7 +708,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeC */ OH_AudioCommon_Result OH_AudioSessionManager_ReleaseDevice( OH_AudioSessionManager *audioSessionManager, - OH_AudioDeviceDescriptorArray *audioDeviceDescriptor); + OH_AudioDeviceDescriptor *audioDeviceDescriptor); #ifdef __cplusplus } -- Gitee From 98748d55aaf4a8b08b449dbb7b6633e2e7d1042b Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Thu, 11 Sep 2025 19:42:17 +0800 Subject: [PATCH 25/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 8dc17c4cc28..0c948212397 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -194,7 +194,7 @@ typedef enum { /** * @brief Prefer to use bluetooth and nearlink record. * However, whether to use low latency or high quality recording - * dpends on system. + * depends on system. */ PREFERRED_DEFAULT = 1, @@ -532,7 +532,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange OH_AudioSession_CurrentOutputDeviceChangedCallback callback); /** - * @brief Gets available devices by device usage. + * @brief Get available devices by device usage. * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. @@ -597,7 +597,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. - * @param audioDeviceDescriptor The target device. The available device must be in the array returned + * @param deviceDescriptor The target device. The available device must be in the array returned * by {@link OH_AudioSessionManager_GetAvailableDevices}. * When the nullptr is passed, system will clear the last selection. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. @@ -606,7 +606,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * @since 21 */ OH_AudioCommon_Result OH_AudioSessionManager_SelectMediaInputDevice( - OH_AudioSessionManager *audioSessionManager, OH_AudioDeviceDescriptor *audioDeviceDescriptor); + OH_AudioSessionManager *audioSessionManager, OH_AudioDeviceDescriptor *deviceDescriptor); /** * @brief Gets the selected media input device. @@ -635,7 +635,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_GetSelectedMediaInputDevice( * the actual input device used by the application may differ from the prefered one. * The application can use {@link OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback} * to register a callback to listen for the actual input device. - * + * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. * @param category The category application prefer to use when recording with bluetooth and nearlink. @@ -701,7 +701,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeC * * @param audioSessionManager the {@link OH_AudioSessionManager} * returned by the {@link #OH_AudioManager_GetAudioSessionManager} - * @param audioDeviceDescriptor Audio device descriptor should be released. + * @param audioDeviceDescriptor Audio device descriptor to release. * @return {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. * or {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails * @since 21 -- Gitee From 0757405f5108eff2b7809bd51c3d5b212b253903 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Thu, 11 Sep 2025 19:46:38 +0800 Subject: [PATCH 26/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- multimedia/audio_framework/ohaudio.ndk.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 311059da232..b508542564f 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -401,11 +401,11 @@ }, { "first_introduced": "21", - "name":"OH_AudioSessionManager_PreferBluetoothAndNearlinkRecord" + "name":"OH_AudioSessionManager_SetBluetoothAndNearlinkPreferredRecordCategory" }, { "first_introduced": "21", - "name":"OH_AudioSessionManager_GetPreferBluetoothAndNearlinkRecord" + "name":"OH_AudioSessionManager_GetBluetoothAndNearlinkPreferredRecordCategory" }, { "first_introduced": "21", @@ -415,6 +415,10 @@ "first_introduced": "21", "name":"OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback" }, + { + "first_introduced": "21", + "name":"OH_AudioSessionManager_ReleaseDevice" + }, { "first_introduced": "12", "name": "OH_GetAudioManager" -- Gitee From f17510d247828b9234ad04a9902433109b679fe3 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Thu, 11 Sep 2025 21:59:04 +0800 Subject: [PATCH 27/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 0c948212397..1257149a275 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -594,7 +594,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterAvailableDevicesChangeCal * the actual input device used by the application may differ from the selected one. * The application can use {@link OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback} * to register a callback to listen for the actual input device. - * + * * @param audioSessionManager the {@link OH_AudioSessionManager} handle returned * by {@link OH_AudioManager_GetAudioSessionManager}. * @param deviceDescriptor The target device. The available device must be in the array returned -- Gitee From 62272936dd6b30e95be18daaf91a3175d50d88b7 Mon Sep 17 00:00:00 2001 From: zhanganxiang Date: Fri, 12 Sep 2025 10:06:26 +0800 Subject: [PATCH 28/28] =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanganxiang --- .../audio_manager/native_audio_session_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h index 1257149a275..a97cca5abc8 100644 --- a/multimedia/audio_framework/audio_manager/native_audio_session_manager.h +++ b/multimedia/audio_framework/audio_manager/native_audio_session_manager.h @@ -541,7 +541,7 @@ OH_AudioCommon_Result OH_AudioSessionManager_UnregisterCurrentOutputDeviceChange * @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray} * pointer variable which will be set the audio device descriptors value * Do not release the audioDeviceDescriptorArray pointer separately - * instead call {@link OH_AudioSessionManager_ReleaseDevices} to release the DeviceDescriptor array + * instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array * when it is no use anymore. * @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds. * or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails. -- Gitee