From 01d62c879cfd9e8ac43d7e5ab93180ff14019851 Mon Sep 17 00:00:00 2001 From: wanghongen Date: Thu, 28 Aug 2025 14:35:24 +0800 Subject: [PATCH 1/8] =?UTF-8?q?audio=20interface=E4=BB=93=E9=BB=84?= =?UTF-8?q?=E8=93=9D=E5=B7=AE=E5=BC=82=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanghongen --- audio/v1_0/AudioTypes.idl | 2 +- audio/v1_0/IAudioAdapter.idl | 2 +- audio/v1_0/IAudioCallback.idl | 2 +- audio/v1_0/IAudioCapture.idl | 2 +- audio/v1_0/IAudioRender.idl | 2 +- audio/v5_0/BUILD.gn | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/audio/v1_0/AudioTypes.idl b/audio/v1_0/AudioTypes.idl index fa171d32..47dac720 100644 --- a/audio/v1_0/AudioTypes.idl +++ b/audio/v1_0/AudioTypes.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/audio/v1_0/IAudioAdapter.idl b/audio/v1_0/IAudioAdapter.idl index cbc3bcf1..b2377e9d 100644 --- a/audio/v1_0/IAudioAdapter.idl +++ b/audio/v1_0/IAudioAdapter.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/audio/v1_0/IAudioCallback.idl b/audio/v1_0/IAudioCallback.idl index d030c2e1..0144dba3 100644 --- a/audio/v1_0/IAudioCallback.idl +++ b/audio/v1_0/IAudioCallback.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/audio/v1_0/IAudioCapture.idl b/audio/v1_0/IAudioCapture.idl index 0f447862..7a5b451f 100644 --- a/audio/v1_0/IAudioCapture.idl +++ b/audio/v1_0/IAudioCapture.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/audio/v1_0/IAudioRender.idl b/audio/v1_0/IAudioRender.idl index edb991e3..67e058a1 100644 --- a/audio/v1_0/IAudioRender.idl +++ b/audio/v1_0/IAudioRender.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/audio/v5_0/BUILD.gn b/audio/v5_0/BUILD.gn index 77e208e6..c08b6c7a 100644 --- a/audio/v5_0/BUILD.gn +++ b/audio/v5_0/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2025 Huawei Device Co., Ltd. +# Copyright (c) 2025 Huawei Device Co., Ltd # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -- Gitee From 3397e9130d170216b055e8f9d474007b6c656f3d Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Thu, 28 Aug 2025 07:16:46 +0000 Subject: [PATCH 2/8] update audio/v1_0/AudioTypes.idl. Signed-off-by: wanghongenaf --- audio/v1_0/AudioTypes.idl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/audio/v1_0/AudioTypes.idl b/audio/v1_0/AudioTypes.idl index 47dac720..9d935219 100644 --- a/audio/v1_0/AudioTypes.idl +++ b/audio/v1_0/AudioTypes.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -286,7 +286,6 @@ enum AudioExtParamKey { AUDIO_EXT_PARAM_KEY_EFFECT = 4, /**< Distributed audio extra param key audio effect event */ AUDIO_EXT_PARAM_KEY_STATUS = 5, /**< Distributed audio extra param key device status event */ AUDIO_EXT_PARAM_KEY_USB_DEVICE = 101, /**< Check USB device type ARM or HIFI */ - AUDIO_EXT_PARAM_KEY_PERF_INFO = 201, /**< Distributed audio extra param key dsp load event */ AUDIO_EXT_PARAM_KEY_LOWPOWER = 1000, /**< Low power event type */ }; @@ -358,7 +357,7 @@ enum AudioInputType { */ struct AudioOffloadInfo { - unsigned int sampleRate; /**< Audio sampling rate */ + unsigned int sampleRate; /**< Audio sampling rate */ unsigned int channelCount; /**< Number of audio channels */ unsigned int bitRate; /**< bitRate of compressed audio data */ unsigned int bitWidth; /**< bitwidth of audio data */ -- Gitee From 1fae024337e2291f25a1f93d766cbf4aa7e32c34 Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Thu, 28 Aug 2025 07:18:03 +0000 Subject: [PATCH 3/8] update audio/v1_0/IAudioAdapter.idl. Signed-off-by: wanghongenaf --- audio/v1_0/IAudioAdapter.idl | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/audio/v1_0/IAudioAdapter.idl b/audio/v1_0/IAudioAdapter.idl index b2377e9d..b66cf728 100644 --- a/audio/v1_0/IAudioAdapter.idl +++ b/audio/v1_0/IAudioAdapter.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -51,6 +51,7 @@ interface IAudioAdapter { * If the initialization is not complete, wait for a while (for example, 100 ms) and perform the check again * until the port initialization is complete. * + * @param adapter Indicates the pointer to the audio adapter to operate. * @return Returns 0 if the initialization is successful; returns a negative value otherwise. */ InitAllPorts(); @@ -75,7 +76,8 @@ interface IAudioAdapter { * * @attention Do not destroy the object during audio rendering. * - * @param renderId Indicates the pointer to the IAudioRender object to operate. + * @param adapter Indicates the pointer to the audio adapter to operate. + * @param render Indicates the pointer to the IAudioRender object to operate. * @return Returns 0 if the IAudioRender object is destroyed; returns a negative value otherwise. * @see CreateRender */ @@ -101,7 +103,8 @@ interface IAudioAdapter { * * @attention Do not destroy the object during audio capturing. * - * @param captureId Indicates the pointer to the IAudioCapture object to operate. + * @param adapter Indicates the pointer to the audio adapter to operate. + * @param capture Indicates the pointer to the IAudioCapture object to operate. * @return Returns 0 if the IAudioCapture object is destroyed; returns a negative value otherwise. * @see CreateCapture */ @@ -110,6 +113,7 @@ interface IAudioAdapter { /** * @brief Obtains the capability set of the port driver for the audio adapter. * + * @param adapter Indicates the pointer to the audio adapter to operate. * @param port Indicates the pointer to the port. * @param capability Indicates the pointer to the capability set to obtain. * @return Returns 0 if the capability set is successfully obtained; returns a negative value otherwise. @@ -119,6 +123,7 @@ interface IAudioAdapter { /** * @brief Sets the passthrough data transmission mode of the audio port driver. * + * @param adapter Indicates the pointer to the audio adapter to operate. * @param port Indicates the pointer to the port. * @param mode Indicates the passthrough transmission mode to set. * @return Returns 0 if the setting is successful; returns a negative value otherwise. @@ -129,6 +134,7 @@ interface IAudioAdapter { /** * @brief Obtains the passthrough data transmission mode of the audio port driver. * + * @param adapter Indicates the pointer to the audio adapter to operate. * @param port Indicates the pointer to the port. * @param mode Indicates the pointer to the passthrough transmission mode to obtain. * @return Returns 0 if the mode is successfully obtained; returns a negative value otherwise. @@ -139,6 +145,7 @@ interface IAudioAdapter { /** * @brief Get the device status of an adapter. * + * @param adapter Indicates the audio adapter. * @param status Indicates the status of device . * @return Returns 0 if the operation is successful; returns a negative value otherwise. */ @@ -147,6 +154,7 @@ interface IAudioAdapter { /** * @brief Update audio route on several source and sink ports. * + * @param adapter Indicates the pointer to the audio adapter to operate. * @param route Indicates route information. * @param routeHandle Indicates route handle. * @return Returns 0 if the mode is successfully obtained; returns a negative value otherwise. @@ -157,6 +165,7 @@ interface IAudioAdapter { /** * @brief Release an audio route. * + * @param adapter Indicates the pointer to the audio adapter to operate. * @param routeHandle Indicates route handle. * @return Returns 0 if the mode is successfully obtained; returns a negative value otherwise. * @see SetPassthroughMode @@ -166,6 +175,7 @@ interface IAudioAdapter { /** * @brief Sets the mute operation for the audio. * + * @param adapter Indicates the pointer to the audio adapter to operate. * @param mute Specifies whether to mute the audio. Value true means to mute the audio, * and false means the opposite. * @return Returns 0 if the setting is successful; returns a negative value otherwise. @@ -176,6 +186,7 @@ interface IAudioAdapter { /** * @brief Obtains the mute operation set for the audio. * + * @param adapter Indicates the pointer to the audio adapter to operate. * @param mute Indicates the pointer to the mute operation set for the audio. Value true means that * the audio is muted, and false means the opposite. * @return Returns 0 if the mute operation is obtained; returns a negative value otherwise. @@ -189,6 +200,7 @@ interface IAudioAdapter { * The volume ranges from 0.0 to 1.0. If the volume level in an audio service ranges from 0 to 15, * 0.0 indicates that the audio is muted, and 1.0 indicates the maximum volume level (15). * + * @param adapter Indicates the pointer to the audio adapter to operate. * @param volume Indicates the volume to set. The value ranges from 0.0 to 1.0. * @return Returns 0 if the setting is successful; returns a negative value otherwise. * @see GetVolume @@ -198,6 +210,7 @@ interface IAudioAdapter { /** * @brief Sets extra audio parameters. * + * @param adapter Indicates the audio adapter. * @param key Indicates what kind of parameter type will be set. * @param condition Indicates the specific extend parameter condition of AudioExtParamKey. * @param value Indicates the value of the specified condition. @@ -216,9 +229,11 @@ interface IAudioAdapter { /** * @brief Get extra audio parameters. * + * @param adapter Indicates the audio adapter. * @param key Indicates what kind of parameter type will be get. * @param condition Indicates the specific extend parameter condition of AudioExtParamKey. * @param value Indicates the value of the specified condition. + * @param lenth Indicates the length of the value pointer. * * The format of condition is key=value. Separate multiple key-value pairs by semicolons (;). * When key equals to AudioExtParamKey::AUDIO_EXT_PARAM_KEY_VOLUME, the format of condition must be like this: @@ -234,7 +249,8 @@ interface IAudioAdapter { /** * @brief Register extra audio parameters observer. * - * @param audioCallback Indicates param observer. + * @param adapter Indicates the audio adapter. + * @param callback Indicates param observer. * @param cookie Indicates the pointer to the callback parameters; * @return Returns 0 if the operation is successful; returns a negative value otherwise. */ -- Gitee From 86b01a93187376de45e1002c1fe6111d34bf01e0 Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Thu, 28 Aug 2025 07:18:53 +0000 Subject: [PATCH 4/8] update audio/v1_0/IAudioCallback.idl. Signed-off-by: wanghongenaf --- audio/v1_0/IAudioCallback.idl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/audio/v1_0/IAudioCallback.idl b/audio/v1_0/IAudioCallback.idl index 0144dba3..38c7e17a 100644 --- a/audio/v1_0/IAudioCallback.idl +++ b/audio/v1_0/IAudioCallback.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -31,6 +31,15 @@ package ohos.hdi.audio.v1_0; import ohos.hdi.audio.v1_0.AudioTypes; +/** + * @brief Called when an event defined in {@link AudioCallbackType} occurs. + * + * @param AudioCallbackType Indicates the occurred event that triggers this callback. + * @param reserved Indicates the pointer to a reserved field. + * @param cookie Indicates the pointer to the cookie for data transmission. + * @return Returns 0 if the callback is successfully executed; returns a negative value otherwise. + * @see RegCallback + */ [callback] interface IAudioCallback { /** * @brief Called when an event defined in {@link AudioCallbackType} occurs. -- Gitee From 7dd14302d609dcbc239346527a6774bdc5fbc354 Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Thu, 28 Aug 2025 07:19:55 +0000 Subject: [PATCH 5/8] update audio/v1_0/IAudioCapture.idl. Signed-off-by: wanghongenaf --- audio/v1_0/IAudioCapture.idl | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/audio/v1_0/IAudioCapture.idl b/audio/v1_0/IAudioCapture.idl index 7a5b451f..3235f67b 100644 --- a/audio/v1_0/IAudioCapture.idl +++ b/audio/v1_0/IAudioCapture.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -42,7 +42,9 @@ interface IAudioCapture { /** * @brief Reads a frame of input data (uplink data) from the audio driver for capturing. * + * @param capture Indicates the pointer to the IAudioCapture object to operate. * @param frame Indicates the pointer to the input data to read. + * @param requestBytes Indicates the size of the input data, in bytes. * @param replyBytes Indicates the pointer to the actual length (in bytes) of the audio data to read. * @return Returns 0 if the input data is read successfully; returns a negative value otherwise. */ @@ -51,6 +53,7 @@ interface IAudioCapture { /** * @brief Obtains the last number of input audio frames. * + * @param capture Indicates the pointer to the IAudioCapture object to operate. * @param frames Indicates the pointer to the last number of input audio frames. * @param time Indicates the pointer to the timestamp associated with the frame. * @return Returns 0 if the last number is obtained; returns a negative value otherwise. @@ -61,6 +64,7 @@ interface IAudioCapture { /** * @brief Checks whether the configuration of an audio scene is supported. * + * @param handle Indicates the audio handle. * @param scene Indicates the pointer to the descriptor of the audio scene. * @param supported Indicates the pointer to the variable specifying whether the configuration is supported. * Value true means that the configuration is supported, and false means the opposite. @@ -85,6 +89,7 @@ interface IAudioCapture { *
  • To select only the output device, such as media receiver, speaker, or headset, you can set * scene to receiver, speaker, or headset, respectively.
  • * + * @param handle Indicates the audio handle. * @param scene Indicates the pointer to the descriptor of the audio scene to select. * @return Returns 0 if the scene is selected successfully; returns a negative value otherwise. * @see CheckSceneCapability @@ -94,6 +99,7 @@ interface IAudioCapture { /** * @brief Sets the mute operation for the audio. * + * @param handle Indicates the audio handle. * @param mute Specifies whether to mute the audio. Value true means to mute the audio, * and false means the opposite. * @return Returns 0 if the setting is successful; returns a negative value otherwise. @@ -104,6 +110,7 @@ interface IAudioCapture { /** * @brief Obtains the mute operation set for the audio. * + * @param handle Indicates the audio handle. * @param mute Indicates the pointer to the mute operation set for the audio. Value true means that * the audio is muted, and false means the opposite. * @return Returns 0 if the mute operation is obtained; returns a negative value otherwise. @@ -117,6 +124,7 @@ interface IAudioCapture { * The volume ranges from 0.0 to 1.0. If the volume level in an audio service ranges from 0 to 15, * 0.0 indicates that the audio is muted, and 1.0 indicates the maximum volume level (15). * + * @param handle Indicates the audio handle. * @param volume Indicates the volume to set. The value ranges from 0.0 to 1.0. * @return Returns 0 if the setting is successful; returns a negative value otherwise. * @see GetVolume @@ -126,6 +134,7 @@ interface IAudioCapture { /** * @brief Obtains the audio volume. * + * @param handle Indicates the audio handle. * @param volume Indicates the pointer to the volume to obtain. The value ranges from 0.0 to 1.0. * @return Returns 0 if the volume is obtained; returns a negative value otherwise. * @see SetVolume @@ -142,6 +151,7 @@ interface IAudioCapture { *
  • Float numbers ranging from 0.0 to 1.0, where 0.0 means to mute the audio, * and 1.0 means the maximum gain value, for example, 6 dB
  • * + * @param handle Indicates the audio handle. * @param min Indicates the pointer to the minimum value of the range. * @param max Indicates the pointer to the maximum value of the range. * @return Returns 0 if the range is obtained; returns a negative value otherwise. @@ -153,6 +163,7 @@ interface IAudioCapture { /** * @brief Obtains the audio gain. * + * @param handle Indicates the audio handle. * @param gain Indicates the pointer to the audio gain. * @return Returns 0 if the audio gain is obtained; returns a negative value otherwise. * @see GetGainThreshold @@ -163,6 +174,7 @@ interface IAudioCapture { /** * @brief Sets the audio gain. * + * @param handle Indicates the audio handle. * @param gain Indicates the audio gain to set. * @return Returns 0 if the setting is successful; returns a negative value otherwise. * @see GetGainThreshold @@ -173,6 +185,7 @@ interface IAudioCapture { /** * @brief Obtains the audio frame size, that is, the length (in bytes) of a frame. * + * @param handle Indicates the audio handle. * @param size Indicates the pointer to the audio frame size (in bytes). * @return Returns 0 if the audio frame size is obtained; returns a negative value otherwise. */ @@ -181,6 +194,7 @@ interface IAudioCapture { /** * @brief Obtains the number of audio frames in the audio buffer. * + * @param handle Indicates the audio handle. * @param count Indicates the pointer to the number of audio frames in the audio buffer. * @return Returns 0 if the number of audio frames is obtained; returns a negative value otherwise. */ @@ -189,6 +203,7 @@ interface IAudioCapture { /** * @brief Sets audio sampling attributes. * + * @param handle Indicates the audio handle. * @param attrs Indicates the pointer to the audio sampling attributes to set, such as the sampling rate, * sampling precision, and channel. * @return Returns 0 if the setting is successful; returns a negative value otherwise. @@ -199,6 +214,7 @@ interface IAudioCapture { /** * @brief Obtains audio sampling attributes. * + * @param handle Indicates the audio handle. * @param attrs Indicates the pointer to the audio sampling attributes, such as the sampling rate, * sampling precision, and channel. * @return Returns 0 if audio sampling attributes are obtained; returns a negative value otherwise. @@ -209,6 +225,7 @@ interface IAudioCapture { /** * @brief Obtains the data channel ID of the audio. * + * @param handle Indicates the audio handle. * @param channelId Indicates the pointer to the data channel ID. * @return Returns 0 if the data channel ID is obtained; returns a negative value otherwise. */ @@ -217,6 +234,7 @@ interface IAudioCapture { /** * @brief Sets extra audio parameters. * + * @param handle Indicates the audio handle. * @param keyValueList Indicates the pointer to the key-value list of the extra audio parameters. * The format is key=value. Separate multiple key-value pairs by semicolons (;). * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -226,6 +244,7 @@ interface IAudioCapture { /** * @brief Obtains extra audio parameters. * + * @param handle Indicates the audio handle. * @param keyValueList Indicates the pointer to the key-value list of the extra audio parameters. * The format is key=value. Separate multiple key-value pairs by semicolons (;). * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -235,6 +254,7 @@ interface IAudioCapture { /** * @brief Requests a mmap buffer. * + * @param handle Indicates the audio handle. * @param reqSize Indicates the size of the request mmap buffer. * @param desc Indicates the pointer to the mmap buffer descriptor. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -244,6 +264,7 @@ interface IAudioCapture { /** * @brief Obtains the read/write position of the current mmap buffer. * + * @param handle Indicates the audio handle. * @param frames Indicates the pointer to the frame where the read/write starts. * @param time Indicates the pointer to the timestamp associated with the frame where the read/write starts. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -253,6 +274,7 @@ interface IAudioCapture { /** * @brief Add the audio effect which the effectid indicated. * + * @param handle Indicates the audio handle. * @param effectid Indicates the audio effect instance identifier which is going to be added. * @return Returns 0 if the audio effect were added succesffully; returns a negative value otherwise. */ @@ -261,6 +283,7 @@ interface IAudioCapture { /** * @brief Remove the audio effect which the effectid indicated. * + * @param handle Indicates the audio handle. * @param effectid Indicates the audio effect which is going to be removed. * @return Returns 0 if the audio effect were removed succesffully; returns a negative value otherwise. */ @@ -269,6 +292,7 @@ interface IAudioCapture { /** * @brief Get the buffer size of render or capturer * + * @param handle Indicates the audio handle. * @param bufferSize Indicates the buffer size (in bytes) queried from the vendor * @return Returns 0 if the operation is successful; returns a negative value otherwise. */ @@ -277,6 +301,7 @@ interface IAudioCapture { /** * @brief Starts audio rendering or capturing. * + * @param handle Indicates the audio handle. * @return Returns 0 if the rendering or capturing is successfully started; * returns a negative value otherwise. * @see Stop @@ -286,6 +311,7 @@ interface IAudioCapture { /** * @brief Stops audio rendering or capturing. * + * @param handle Indicates the audio handle. * @return Returns 0 if the rendering or capturing is successfully stopped; * returns a negative value otherwise. * @see Start @@ -294,6 +320,8 @@ interface IAudioCapture { /** * @brief Pauses audio rendering or capturing. + * + * @param handle Indicates the audio handle. * @return Returns 0 if the rendering or capturing is successfully paused; * returns a negative value otherwise. * @see Resume @@ -303,6 +331,7 @@ interface IAudioCapture { /** * @brief Resumes audio rendering or capturing. * + * @param handle Indicates the audio handle. * @return Returns 0 if the rendering or capturing is successfully resumed; * returns a negative value otherwise. * @see Pause @@ -312,6 +341,7 @@ interface IAudioCapture { /** * @brief Flushes data in the audio buffer. * + * @param handle Indicates the audio handle. * @return Returns 0 if the flush is successful; returns a negative value otherwise. */ Flush(); @@ -319,6 +349,7 @@ interface IAudioCapture { /** * @brief Sets or cancels the standby mode of the audio device. * + * @param handle Indicates the audio handle. * @return Returns 0 if the device is set to standby mode; returns a positive value if the standby mode is * canceled; returns a negative value if the setting fails. */ @@ -327,6 +358,7 @@ interface IAudioCapture { /** * @brief Dumps information about the audio device. * + * @param handle Indicates the audio handle. * @param range Indicates the range of the device information to dump, which can be brief or full information. * @param fd Indicates the file to which the device information will be dumped. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -336,6 +368,7 @@ interface IAudioCapture { /** * @brief Query whether the vendor support pause and resume. * + * @param handle Indicates the audio handle. * @param supportPause Indicates the state whether the vendor supports pausing. Value true means that * the vendor supports, and false means the opposite. * @param supportResume Indicates the state whether the vendor supports resuming. Value true means that -- Gitee From 458baf197f7b0b1a8c4aac33c56310ba06cff81f Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Thu, 28 Aug 2025 07:21:02 +0000 Subject: [PATCH 6/8] update audio/v1_0/IAudioRender.idl. Signed-off-by: wanghongenaf --- audio/v1_0/IAudioRender.idl | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/audio/v1_0/IAudioRender.idl b/audio/v1_0/IAudioRender.idl index 67e058a1..e856c1c0 100644 --- a/audio/v1_0/IAudioRender.idl +++ b/audio/v1_0/IAudioRender.idl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -43,6 +43,7 @@ interface IAudioRender { /** * @brief Obtains the estimated latency of the audio device driver. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param ms Indicates the pointer to the latency (in milliseconds) to be obtained. * @return Returns 0 if the latency is obtained; returns a negative value otherwise. */ @@ -51,7 +52,9 @@ interface IAudioRender { /** * @brief Writes a frame of output data (downlink data) into the audio driver for rendering. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param frame Indicates the pointer to the frame to write. + * @param requestBytes Indicates the size of the frame, in bytes. * @param replyBytes Indicates the pointer to the actual length (in bytes) of the audio data to write. * @return Returns 0 if the data is written successfully; returns a negative value otherwise. */ @@ -60,6 +63,7 @@ interface IAudioRender { /** * @brief Obtains the last number of output audio frames. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param frames Indicates the pointer to the last number of output audio frames. * @param time Indicates the pointer to the timestamp associated with the frame. * @return Returns 0 if the last number is obtained; returns a negative value otherwise. @@ -70,6 +74,7 @@ interface IAudioRender { /** * @brief Sets the audio rendering speed. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param speed Indicates the rendering speed to set. * @return Returns 0 if the setting is successful; returns a negative value otherwise. * @see GetRenderSpeed @@ -79,6 +84,7 @@ interface IAudioRender { /** * @brief Obtains the current audio rendering speed. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param speed Indicates the pointer to the current rendering speed to obtain. * @return Returns 0 if the speed is successfully obtained; returns a negative value otherwise. * @see SetRenderSpeed @@ -88,6 +94,7 @@ interface IAudioRender { /** * @brief Sets the channel mode for audio rendering. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param mode Indicates the channel mode to set. * @return Returns 0 if the setting is successful; returns a negative value otherwise. * @see GetChannelMode @@ -97,6 +104,7 @@ interface IAudioRender { /** * @brief Obtains the current channel mode for audio rendering. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param mode Indicates the pointer to the channel mode to obtain. * @return Returns 0 if the mode is successfully obtained; returns a negative value otherwise. * @see SetChannelMode @@ -107,6 +115,7 @@ interface IAudioRender { * @brief Registers an audio callback that will be invoked during playback when buffer data writing or * buffer drain is complete. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param callback Indicates the callback to register. * @param cookie Indicates the pointer to the callback parameters. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -117,6 +126,7 @@ interface IAudioRender { /** * @brief Drains the buffer. * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param type Indicates the pointer to the execution type of this function. For details, * see {@link AudioDrainNotifyType}. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -127,6 +137,7 @@ interface IAudioRender { /** * @brief query whether the vendor supports draining buffer * + * @param render Indicates the pointer to the IAudioRender object to operate. * @param support indicates the state whether the vendor supports draining buffer. Value true means that * the vendor supports, and false means the opposite. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -137,6 +148,7 @@ interface IAudioRender { /** * @brief Checks whether the configuration of an audio scene is supported. * + * @param handle Indicates the audio handle. * @param scene Indicates the pointer to the descriptor of the audio scene. * @param supported Indicates the pointer to the variable specifying whether the configuration is supported. * Value true means that the configuration is supported, and false means the opposite. @@ -161,6 +173,7 @@ interface IAudioRender { *
  • To select only the output device, such as media receiver, speaker, or headset, you can set * scene to receiver, speaker, or headset, respectively.
  • * + * @param handle Indicates the audio handle. * @param scene Indicates the pointer to the descriptor of the audio scene to select. * @return Returns 0 if the scene is selected successfully; returns a negative value otherwise. * @see CheckSceneCapability @@ -170,6 +183,7 @@ interface IAudioRender { /** * @brief Sets the mute operation for the audio. * + * @param handle Indicates the audio handle. * @param mute Specifies whether to mute the audio. Value true means to mute the audio, * and false means the opposite. * @return Returns 0 if the setting is successful; returns a negative value otherwise. @@ -180,6 +194,7 @@ interface IAudioRender { /** * @brief Obtains the mute operation set for the audio. * + * @param handle Indicates the audio handle. * @param mute Indicates the pointer to the mute operation set for the audio. Value true means that * the audio is muted, and false means the opposite. * @return Returns 0 if the mute operation is obtained; returns a negative value otherwise. @@ -193,6 +208,7 @@ interface IAudioRender { * The volume ranges from 0.0 to 1.0. If the volume level in an audio service ranges from 0 to 15, * 0.0 indicates that the audio is muted, and 1.0 indicates the maximum volume level (15). * + * @param handle Indicates the audio handle. * @param volume Indicates the volume to set. The value ranges from 0.0 to 1.0. * @return Returns 0 if the setting is successful; returns a negative value otherwise. * @see GetVolume @@ -202,6 +218,7 @@ interface IAudioRender { /** * @brief Obtains the audio volume. * + * @param handle Indicates the audio handle. * @param volume Indicates the pointer to the volume to obtain. The value ranges from 0.0 to 1.0. * @return Returns 0 if the volume is obtained; returns a negative value otherwise. * @see SetVolume @@ -218,6 +235,7 @@ interface IAudioRender { *
  • Float numbers ranging from 0.0 to 1.0, where 0.0 means to mute the audio, * and 1.0 means the maximum gain value, for example, 6 dB
  • * + * @param handle Indicates the audio handle. * @param min Indicates the pointer to the minimum value of the range. * @param max Indicates the pointer to the maximum value of the range. * @return Returns 0 if the range is obtained; returns a negative value otherwise. @@ -229,6 +247,7 @@ interface IAudioRender { /** * @brief Obtains the audio gain. * + * @param handle Indicates the audio handle. * @param gain Indicates the pointer to the audio gain. * @return Returns 0 if the audio gain is obtained; returns a negative value otherwise. * @see GetGainThreshold @@ -239,6 +258,7 @@ interface IAudioRender { /** * @brief Sets the audio gain. * + * @param handle Indicates the audio handle. * @param gain Indicates the audio gain to set. * @return Returns 0 if the setting is successful; returns a negative value otherwise. * @see GetGainThreshold @@ -249,6 +269,7 @@ interface IAudioRender { /** * @brief Obtains the audio frame size, that is, the length (in bytes) of a frame. * + * @param handle Indicates the audio handle. * @param size Indicates the pointer to the audio frame size (in bytes). * @return Returns 0 if the audio frame size is obtained; returns a negative value otherwise. */ @@ -257,6 +278,7 @@ interface IAudioRender { /** * @brief Obtains the number of audio frames in the audio buffer. * + * @param handle Indicates the audio handle. * @param count Indicates the pointer to the number of audio frames in the audio buffer. * @return Returns 0 if the number of audio frames is obtained; returns a negative value otherwise. */ @@ -265,6 +287,7 @@ interface IAudioRender { /** * @brief Sets audio sampling attributes. * + * @param handle Indicates the audio handle. * @param attrs Indicates the pointer to the audio sampling attributes to set, such as the sampling rate, * sampling precision, and channel. * @return Returns 0 if the setting is successful; returns a negative value otherwise. @@ -275,6 +298,7 @@ interface IAudioRender { /** * @brief Obtains audio sampling attributes. * + * @param handle Indicates the audio handle. * @param attrs Indicates the pointer to the audio sampling attributes, such as the sampling rate, * sampling precision, and channel. * @return Returns 0 if audio sampling attributes are obtained; returns a negative value otherwise. @@ -285,6 +309,7 @@ interface IAudioRender { /** * @brief Obtains the data channel ID of the audio. * + * @param handle Indicates the audio handle. * @param channelId Indicates the pointer to the data channel ID. * @return Returns 0 if the data channel ID is obtained; returns a negative value otherwise. */ @@ -293,6 +318,7 @@ interface IAudioRender { /** * @brief Sets extra audio parameters. * + * @param handle Indicates the audio handle. * @param keyValueList Indicates the pointer to the key-value list of the extra audio parameters. * The format is key=value. Separate multiple key-value pairs by semicolons (;). * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -312,6 +338,7 @@ interface IAudioRender { /** * @brief Requests a mmap buffer. * + * @param handle Indicates the audio handle. * @param reqSize Indicates the size of the request mmap buffer. * @param desc Indicates the pointer to the mmap buffer descriptor. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -321,6 +348,7 @@ interface IAudioRender { /** * @brief Obtains the read/write position of the current mmap buffer. * + * @param handle Indicates the audio handle. * @param frames Indicates the pointer to the frame where the read/write starts. * @param time Indicates the pointer to the timestamp associated with the frame where the read/write starts. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -330,6 +358,7 @@ interface IAudioRender { /** * @brief Add the audio effect which the effectid indicated. * + * @param handle Indicates the audio handle. * @param effectid Indicates the audio effect instance identifier which is going to be added. * @return Returns 0 if the audio effect were added succesffully; returns a negative value otherwise. */ @@ -338,6 +367,7 @@ interface IAudioRender { /** * @brief Remove the audio effect which the effectid indicated. * + * @param handle Indicates the audio handle. * @param effectid Indicates the audio effect which is going to be removed. * @return Returns 0 if the audio effect were removed succesffully; returns a negative value otherwise. */ @@ -346,6 +376,7 @@ interface IAudioRender { /** * @brief Get the buffer size of render or capturer * + * @param handle Indicates the audio handle. * @param bufferSize Indicates the buffer size (in bytes) queried from the vendor * @return Returns 0 if the operation is successful; returns a negative value otherwise. */ @@ -354,6 +385,7 @@ interface IAudioRender { /** * @brief Starts audio rendering or capturing. * + * @param handle Indicates the audio handle. * @return Returns 0 if the rendering or capturing is successfully started; * returns a negative value otherwise. * @see Stop @@ -373,6 +405,7 @@ interface IAudioRender { /** * @brief Pauses audio rendering or capturing. * + * @param handle Indicates the audio handle. * @return Returns 0 if the rendering or capturing is successfully paused; * returns a negative value otherwise. * @see Resume @@ -382,6 +415,7 @@ interface IAudioRender { /** * @brief Resumes audio rendering or capturing. * + * @param handle Indicates the audio handle. * @return Returns 0 if the rendering or capturing is successfully resumed; * returns a negative value otherwise. * @see Pause @@ -391,6 +425,7 @@ interface IAudioRender { /** * @brief Flushes data in the audio buffer. * + * @param handle Indicates the audio handle. * @return Returns 0 if the flush is successful; returns a negative value otherwise. */ Flush(); @@ -398,6 +433,7 @@ interface IAudioRender { /** * @brief Sets or cancels the standby mode of the audio device. * + * @param handle Indicates the audio handle. * @return Returns 0 if the device is set to standby mode; returns a positive value if the standby mode is * canceled; returns a negative value if the setting fails. */ @@ -406,6 +442,7 @@ interface IAudioRender { /** * @brief Dumps information about the audio device. * + * @param handle Indicates the audio handle. * @param range Indicates the range of the device information to dump, which can be brief or full information. * @param fd Indicates the file to which the device information will be dumped. * @return Returns 0 if the operation is successful; returns a negative value otherwise. @@ -415,6 +452,7 @@ interface IAudioRender { /** * @brief Query whether the vendor support pause and resume. * + * @param handle Indicates the audio handle. * @param supportPause Indicates the state whether the vendor supports pausing. Value true means that * the vendor supports, and false means the opposite. * @param supportResume Indicates the state whether the vendor supports resuming. Value true means that @@ -427,6 +465,7 @@ interface IAudioRender { /** * @brief Set offload buffer size. * + * @param handle Indicates the audio handle. * @param size Indicates the buffer size which contains the audio data. * @return Returns 0 if the operation is successful; returns a negative value otherwise. */ -- Gitee From 028b162e7523478de8dfc15d000ff8bcd4b539f0 Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Thu, 28 Aug 2025 07:21:50 +0000 Subject: [PATCH 7/8] update audio/v5_0/BUILD.gn. Signed-off-by: wanghongenaf --- audio/v5_0/BUILD.gn | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/audio/v5_0/BUILD.gn b/audio/v5_0/BUILD.gn index c08b6c7a..be05301b 100644 --- a/audio/v5_0/BUILD.gn +++ b/audio/v5_0/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2025 Huawei Device Co., Ltd +# Copyright (c) 2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -35,9 +35,6 @@ if (defined(ohos_lite)) { language = "c" subsystem_name = "hdf" - innerapi_tags = [ - "chipsetsdk", - ] part_name = "drivers_interface_audio" } -} +} \ No newline at end of file -- Gitee From 95e4f748a2809c465da78546abf3b03acb754341 Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Thu, 28 Aug 2025 07:27:06 +0000 Subject: [PATCH 8/8] update audio/v5_0/BUILD.gn. Signed-off-by: wanghongenaf --- audio/v5_0/BUILD.gn | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/audio/v5_0/BUILD.gn b/audio/v5_0/BUILD.gn index be05301b..e1f062b2 100644 --- a/audio/v5_0/BUILD.gn +++ b/audio/v5_0/BUILD.gn @@ -10,9 +10,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - + import("//build/config/components/hdi/hdi.gni") - + if (defined(ohos_lite)) { group("libaudio_proxy_5.0") { deps = [] @@ -21,7 +21,7 @@ if (defined(ohos_lite)) { } else { hdi("audio") { module_name = "audio_service" - + sources = [ "AudioTypes.idl", "IAudioAdapter.idl", @@ -30,11 +30,14 @@ if (defined(ohos_lite)) { "IAudioManager.idl", "IAudioRender.idl", ] - + branch_protector_ret = "pac_ret" - + language = "c" subsystem_name = "hdf" + innerapi_tags = [ + "chipsetsdk", + ] part_name = "drivers_interface_audio" } } \ No newline at end of file -- Gitee