diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index f2f256e49b492c8895f44798b638091ec5336a7a..e7fbd434133abe6165ab442733167f93a161e3ca 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -287,61 +287,61 @@ OH_AudioStream_Result OH_AudioCapturer_GetFramesRead(OH_AudioCapturer* capturer, OH_AudioStream_Result OH_AudioCapturer_GetOverflowCount(OH_AudioCapturer* capturer, uint32_t* count); /** - * @brief Callback function of read data. - * - * This function is similar with OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnReadData - * - * @param capturer AudioCapturer where this callback occurs. - * @param userData User data which is passed by user. - * @param audioData Audio data pointer, where user should read. - * @param audioDataSize Size of audio data that user should read. + * @brief Called when audio data is available to read. This function is similar to + * OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnReadData. + * + * @param capturer Pointer to the AudioCapturer instance that triggers the callback. + * @param userData Pointer to the user data passed when setting the callback via + * OH_AudioStreamBuilder_SetCapturerReadDataCallback. + * @param audioData Pointer to the available audio data. + * @param audioDataSize Size of the available audio data. * @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnReadData - * @since 19 + * @since 20 */ typedef void (*OH_AudioCapturer_OnReadDataCallback)(OH_AudioCapturer* capturer, void* userData, void* audioData, int32_t audioDataSize); /** - * @brief Callback when input device of an AudioCapturer changes. - * - * This function is similar with OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnStreamEvent + * @brief Called when the input device of an AudioCapturer instance changes. + * This function is similar to OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnStreamEvent. * - * @param capturer AudioCapturer where this callback occurs. - * @param userData User data which is passed by user. - * @param deviceArray Array of AudioDeviceDescriptor where the capturing data from. + * @param capturer Pointer to the AudioCapturer instance that triggers the callback. + * @param userData Pointer to the user data passed when setting the callback via + * OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback. + * @param deviceArray Pointer to an array of the new input devices. * @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnStreamEvent - * @since 19 + * @since 20 */ typedef void (*OH_AudioCapturer_OnDeviceChangeCallback)(OH_AudioCapturer* capturer, void* userData, OH_AudioDeviceDescriptorArray* deviceArray); /** - * @brief Callback function of interrupt event on AudioCapturer. - * - * This function is similar with OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnInterruptEvent. - * - * @param capturer AudioCapturer where this callback occurs. - * @param userData User data which is passed by user. - * @param type Force type of this interrupt event. - * @param hint Hint of this interrupt event. + * @brief Called when an interrupt event occurs in an AudioCapturer instance. + * This function is similar to OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnInterruptEvent. + * + * @param capturer Pointer to the AudioCapturer instance that triggers the callback. + * @param userData Pointer to the user data passed when setting the callback via + * OH_AudioStreamBuilder_SetCapturerInterruptCallback. + * @param type Type of force that causes the interrupt event. + * @param hint Hint provided along with the interrupt event. * @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnInterruptEvent. - * @since 19 + * @since 20 */ typedef void (*OH_AudioCapturer_OnInterruptCallback)(OH_AudioCapturer* capturer, void* userData, OH_AudioInterrupt_ForceType type, OH_AudioInterrupt_Hint hint); /** - * @brief Callback function of error on AudioCapturer. - * - * This function is similar with OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnError. + * @brief Called when an error event occurs in an AudioCapturer instance. + * This function is similar to OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnError. * - * @param renderer AudioCapturer where this callback occurs. - * @param userData User data which is passed by user. - * @param error Error while using AudioCapturer. + * @param capturer Pointer to the AudioCapturer instance that triggers the callback. + * @param userData Pointer to the user data passed when setting the callback via + * OH_AudioStreamBuilder_SetCapturerErrorCallback. + * @param error Specific error information. * @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnError - * @since 19 + * @since 20 */ -typedef void (*OH_AudioCapturer_OnErrorCallback)(OH_AudioCapturer* renderer, void* userData, +typedef void (*OH_AudioCapturer_OnErrorCallback)(OH_AudioCapturer* capturer, void* userData, OH_AudioStream_Result error); #ifdef __cplusplus diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index f048de6e57e0434b425da0c569508e18077185b9..087a53038ded628120a40d9ac6b37c3e030d9102 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -197,6 +197,7 @@ OH_AudioStream_Result OH_AudioRenderer_GetSampleFormat(OH_AudioRenderer* rendere */ OH_AudioStream_Result OH_AudioRenderer_GetLatencyMode(OH_AudioRenderer* renderer, OH_AudioStream_LatencyMode* latencyMode); + /** * Query the renderer info of the renderer client. * @@ -285,7 +286,6 @@ OH_AudioStream_Result OH_AudioRenderer_GetFrameSizeInCallback(OH_AudioRenderer* */ OH_AudioStream_Result OH_AudioRenderer_GetSpeed(OH_AudioRenderer* renderer, float* speed); - /** * Set the playback speed of the stream client * @@ -536,30 +536,30 @@ OH_AudioStream_Result OH_AudioRenderer_GetAudioTimestampInfo(OH_AudioRenderer* r int64_t* framePosition, int64_t* timestamp); /** - * @brief Callback function of interrupt event on AudioRenderer. - * - * This function is similar with OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnInterruptEvent. + * @brief Called when an interrupt event occurs in an AudioRenderer instance. + * This function is similar to OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnInterruptEvent. * - * @param renderer AudioRenderer where this callback occurs. - * @param userData User data which is passed by user. - * @param type Force type of this interrupt event. - * @param hint Hint of this interrupt event. + * @param renderer Pointer to the AudioRenderer instance that triggers the callback. + * @param userData Pointer to the user data passed when setting the callback via + * OH_AudioStreamBuilder_SetRendererInterruptCallback. + * @param type Type of force that causes the interrupt event. + * @param hint Hint provided along with the interrupt event. * @see OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnInterruptEvent. - * @since 19 + * @since 20 */ typedef void (*OH_AudioRenderer_OnInterruptCallback)(OH_AudioRenderer* renderer, void* userData, OH_AudioInterrupt_ForceType type, OH_AudioInterrupt_Hint hint); /** - * @brief Callback function of error on AudioRenderer. - * - * This function is similar with OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnError. + * @brief Called when an error event occurs in an AudioRenderer instance. + * This function is similar to OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnError. * - * @param renderer AudioRenderer where this callback occurs. - * @param userData User data which is passed by user. - * @param error Error while using AudioRenderer. + * @param renderer Pointer to the AudioRenderer instance that triggers the callback. + * @param userData Pointer to the user data passed when setting the callback via + * OH_AudioStreamBuilder_SetRendererErrorCallback. + * @param error Specific error information. * @see OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnError - * @since 19 + * @since 20 */ typedef void (*OH_AudioRenderer_OnErrorCallback)(OH_AudioRenderer* renderer, void* userData, OH_AudioStream_Result error); diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 28643a2469467b7917a896712d932200b6ee3083..a951df9adb415355e5ec86a8d49e2500c583ab04 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -350,7 +350,7 @@ typedef enum { /** * @brief Define the audio event. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioRenderer_OutputDeviceChangeCallback. * @since 10 */ @@ -358,7 +358,7 @@ typedef enum { /** * The routing of the audio has changed. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioRenderer_OutputDeviceChangeCallback. * @since 10 */ @@ -618,7 +618,7 @@ typedef struct OH_AudioCapturerStruct OH_AudioCapturer; /** * @brief Declaring the callback struct for renderer stream. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead Use the callback type: OH_AudioRenderer_OnWriteDataCallback, OH_AudioRenderer_OutputDeviceChangeCallback, * OH_AudioRenderer_OnInterruptEvent, OH_AudioRenderer_OnErrorCallback separately. * @since 10 @@ -628,7 +628,7 @@ typedef struct OH_AudioRenderer_Callbacks_Struct { * This function pointer will point to the callback function that * is used to write audio data * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioRenderer_OnWriteDataCallback. * @since 10 */ @@ -642,7 +642,7 @@ typedef struct OH_AudioRenderer_Callbacks_Struct { * This function pointer will point to the callback function that * is used to handle audio renderer stream events. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioRenderer_OutputDeviceChangeCallback. * @since 10 */ @@ -655,7 +655,7 @@ typedef struct OH_AudioRenderer_Callbacks_Struct { * This function pointer will point to the callback function that * is used to handle audio interrupt events. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioRenderer_OnInterruptCallback. * @since 10 */ @@ -669,7 +669,7 @@ typedef struct OH_AudioRenderer_Callbacks_Struct { * This function pointer will point to the callback function that * is used to handle audio error result. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioRenderer_OnErrorCallback. * @since 10 */ @@ -682,7 +682,7 @@ typedef struct OH_AudioRenderer_Callbacks_Struct { /** * @brief Declaring the callback struct for capturer stream. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead Use the callback type: OH_AudioCapturer_OnReadDataCallback, OH_AudioCapturer_OnDeviceChangeCallback, * OH_AudioCapturer_OnInterruptCallback and OH_AudioCapturer_OnErrorCallback separately. * @since 10 @@ -692,7 +692,7 @@ typedef struct OH_AudioCapturer_Callbacks_Struct { * This function pointer will point to the callback function that * is used to read audio data. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioCapturer_OnReadDataCallback * @since 10 */ @@ -706,7 +706,7 @@ typedef struct OH_AudioCapturer_Callbacks_Struct { * This function pointer will point to the callback function that * is used to handle audio capturer stream events. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioRenderer_OutputDeviceChangeCallback * @since 10 */ @@ -719,7 +719,7 @@ typedef struct OH_AudioCapturer_Callbacks_Struct { * This function pointer will point to the callback function that * is used to handle audio interrupt events. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioCapturer_OnInterruptCallback * @since 10 */ @@ -733,7 +733,7 @@ typedef struct OH_AudioCapturer_Callbacks_Struct { * This function pointer will point to the callback function that * is used to handle audio error result. * - * @deprecated since 19 + * @deprecated since 20 * @useinstead OH_AudioCapturer_OnErrorCallback * @since 10 */ diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index dd84c6e4678d0b64b9b1cfea1fcf0b44fcd50c3a..79920d0fb6d586c98ace963645a3e491d9accad1 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -197,7 +197,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerInfo(OH_AudioStreamBuilde /** * Set the callbacks for the renderer client * - * @deprecated since 19 + * @deprecated since 20 * @useinstead Set the callback functions separately using OH_AudioStreamBuilder_SetRendererWriteDataCallback, * OH_AudioStreamBuilder_SetRendererInterruptCallback, OH_AudioStreamBuilder_SetRendererOutputDeviceChangeCallback * and OH_AudioStreamBuilder_SetRendererErrorCallback. @@ -251,7 +251,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererPrivacy(OH_AudioStreamBui /** * Set the callbacks for the capturer client * - * @deprecated since 19 + * @deprecated since 20 * @useinstead Set the callback functions separately using OH_AudioStreamBuilder_SetCapturerReadDataCallback, * OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback, OH_AudioStreamBuilder_SetCapturerInterruptCallback * and OH_AudioStreamBuilder_SetCapturerErrorCallback. @@ -272,22 +272,6 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerCallback(OH_AudioStreamBu /** * Create the audio renderer client. * - * The AudioRenderer instance is used to play streaming audio data. - * When using AudioRenderer apis, there are many instructions for application - * to achieve better performance and lower power consumption: - * In music or audiobook background playback situation, you can have low power - * consumption by following this best practices document [Low-Power Rules in Music Playback Scenarios]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-music-playback-scenarios}. - * And for navigation situation, you can follow [Low-Power Rules in Navigation and Positioning Scenarios]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-navigation-scenarios}. - * - * Application developer should also be careful when app goes to background, please check if your audio playback - * is still needed, see [Audio Resources]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-reasonable-audio-use}. - * And avoiding to send silence audio data continuously to waste system resources, otherwise system will take - * control measures when this behavior is detected, see [Audio Playback]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-reasonable-audio-playback-use}. - * * @since 10 * * @param builder Reference provided by OH_AudioStreamBuilder_Create() @@ -403,103 +387,106 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetVolumeMode(OH_AudioStreamBuilder* OH_AudioStream_VolumeMode volumeMode); /** - * @brief Set the callback of interrupt event on AudioRenderer. - * - * This function is similar with {@link OH_AudioStreamBuilder_SetRendererCallback}. Only the last callback set by - * OH_AudioStreamBuilder_SetRendererCallback or this function will become effective. + * @brief Sets a callback to handle interrupt events for an AudioRenderer instance. This function is similar to + * {@link OH_AudioStreamBuilder_SetRendererCallback}. If both OH_AudioStreamBuilder_SetRendererCallback and this + * function are called, the most recently set callback takes effect. * - * @param builder Builder provided by OH_AudioStreamBuilder_Create() - * @param callback Callback function that will receive the interrupt event. - * @param userData Pointer to an application data structure that will be passed to the callback functions. + * @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create(). + * @param callback Callback used to handle the interrupt events. + * @param userData Pointer to user-defined data, which will be passed back to the application in the callback. * @return Result code. - * {@link AUDIOSTREAM_SUCCESS} Success. - * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 19 + * {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful. + * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder + * is nullptr. + * @since 20 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInterruptCallback(OH_AudioStreamBuilder* builder, OH_AudioRenderer_OnInterruptCallback callback, void* userData); /** - * @brief Set the callback of error event on AudioRenderer. - * - * This function is similar with {@link OH_AudioStreamBuilder_SetRendererCallback}. Only the last callback set by - * OH_AudioStreamBuilder_SetRendererCallback or this function will become effective. - * - * @param builder Builder provided by OH_AudioStreamBuilder_Create() - * @param callback Callback function that will recevie the error event. - * @param userData Pointer to an application data structure that will be passed to the callback functions. + * @brief Sets a callback to handle error events for an AudioRenderer instance. + * This function is similar to {@link OH_AudioStreamBuilder_SetRendererCallback}. If both + * OH_AudioStreamBuilder_SetRendererCallback and this function are called, the most recently set callback takes + * effect. + * + * @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create(). + * @param callback Callback used to handle the error events. + * @param userData Pointer to user-defined data, which will be passed back to the application in the callback. * @return Result code. - * {@link AUDIOSTREAM_SUCCESS} Success. - * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 19 + * {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful. + * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder + * is nullptr. + * @since 20 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererErrorCallback(OH_AudioStreamBuilder* builder, OH_AudioRenderer_OnErrorCallback callback, void* userData); /** - * @brief Set the callback of reading data on AudioCapturer. - * - * This function is similar with {@link OH_AudioStreamBuilder_SetCapturerCallback}. Only the last callback set by - * OH_AudioStreamBuilder_SetCapturerCallback or this function will become effective. - * - * @param builder Builder provided by OH_AudioStreamBuilder_Create() - * @param callback Callback function that will recevie the reading data event. - * @param userData Pointer to an application data structure that will be passed to the callback functions. + * @brief Sets a callback to handle audio data read events for an AudioCapturer instance. This function is + * similar to {@link OH_AudioStreamBuilder_SetCapturerCallback}. If both {@link + * OH_AudioStreamBuilder_SetCapturerCallback} and this function are called, the most recently set callback takes + * effect. + * + * @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create(). + * @param callback Callback used to handle incoming audio data. + * @param userData Pointer to user-defined data, which will be passed back to the application in the callback. * @return Result code. - * {@link AUDIOSTREAM_SUCCESS} Success. - * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 19 + * {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful. + * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder + * is nullptr. + * @since 20 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerReadDataCallback(OH_AudioStreamBuilder* builder, OH_AudioCapturer_OnReadDataCallback callback, void* userData); /** - * @brief Set the callback of device change on AudioCapturer. + * @brief Sets a callback to handle device change events for an AudioCapturer instance. This function is + * similar to {@link OH_AudioStreamBuilder_SetCapturerCallback}. If both OH_AudioStreamBuilder_SetCapturerCallback + * and this function are called, the most recently set callback takes effect. * - * This function is similar with {@link OH_AudioStreamBuilder_SetCapturerCallback}. Only the last callback set by - * OH_AudioStreamBuilder_SetCapturerCallback or this function will become effective. - * - * @param builder Builder provided by OH_AudioStreamBuilder_Create() - * @param callback Callback function that will recevie the device change event. - * @param userData Pointer to an application data structure that will be passed to the callback functions. + * @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create(). + * @param callback Callback used to handle the device change events. + * @param userData Pointer to user-defined data, which will be passed back to the application in the callback. * @return Result code. - * {@link AUDIOSTREAM_SUCCESS} Success. - * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 19 + * {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful. + * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder + * is nullptr. + * @since 20 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback(OH_AudioStreamBuilder* builder, OH_AudioCapturer_OnDeviceChangeCallback callback, void* userData); /** - * @brief Set the callback of interrupt event on AudioCapturer. - * - * This function is similar with {@link OH_AudioStreamBuilder_SetCapturerCallback}. Only the last callback set by - * OH_AudioStreamBuilder_SetCapturerCallback or this function will become effective. - * - * @param builder Builder provided by OH_AudioStreamBuilder_Create() - * @param callback Callback function that will recevie the interrupt event. - * @param userData Pointer to an application data structure that will be passed to the callback functions. + * @brief Sets a callback to handle interrupt events for an AudioCapturer instance. + * This function is similar to {@link OH_AudioStreamBuilder_SetCapturerCallback}. If both + * OH_AudioStreamBuilder_SetCapturerCallback and this function are called, the most recently set callback takes + * effect. + * + * @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create(). + * @param callback Callback used to handle the interrupt events. + * @param userData Pointer to user-defined data, which will be passed back to the application in the callback. * @return Result code. - * {@link AUDIOSTREAM_SUCCESS} Success. - * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 19 + * {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful. + * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder + * is nullptr. + * @since 20 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerInterruptCallback(OH_AudioStreamBuilder* builder, OH_AudioCapturer_OnInterruptCallback callback, void* userData); /** - * @brief Set the callback of error event on AudioCapturer. - * - * This function is similar with {@link OH_AudioStreamBuilder_SetCapturerCallback}. Only the last callback set by - * OH_AudioStreamBuilder_SetCapturerCallback or this function will become effective. + * @brief Sets a callback to handle error events for an AudioCapturer instance. This function is similar to + * {@link OH_AudioStreamBuilder_SetCapturerCallback}. If both OH_AudioStreamBuilder_SetCapturerCallback and this + * function are called, the most recently set callback takes effect. * - * @param builder Builder provided by OH_AudioStreamBuilder_Create() - * @param callback Callback function that will recevie the error event. - * @param userData Pointer to an application data structure that will be passed to the callback functions. + * @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create(). + * @param callback Callback used to handle the error events. + * @param userData Pointer to user-defined data, which will be passed back to the application in the callback. * @return Result code. - * {@link AUDIOSTREAM_SUCCESS} Success. - * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 19 + * {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful. + * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder + * is nullptr. + * @since 20 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerErrorCallback(OH_AudioStreamBuilder* builder, OH_AudioCapturer_OnErrorCallback callback, void* userData); @@ -516,7 +503,6 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerErrorCallback(OH_AudioStr */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerWillMuteWhenInterrupted(OH_AudioStreamBuilder* builder, bool muteWhenInterrupted); - #ifdef __cplusplus } #endif diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 048a15b035fb726b4e9b022855a27b3c461726a3..94c965bd4e4f20f523e1f28dd34a3737918bc69a 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -389,36 +389,36 @@ }, { "first_introduced": "19", - "name": "OH_AudioStreamBuilder_SetRendererInterruptCallback" + "name": "OH_AudioManager_GetAudioStreamManager" }, { "first_introduced": "19", + "name": "OH_AudioStreamManager_GetDirectPlaybackSupport" + }, + { + "first_introduced": "20", + "name": "OH_AudioStreamBuilder_SetRendererInterruptCallback" + }, + { + "first_introduced": "20", "name": "OH_AudioStreamBuilder_SetRendererErrorCallback" }, { - "first_introduced": "19", + "first_introduced": "20", "name": "OH_AudioStreamBuilder_SetCapturerReadDataCallback" }, { - "first_introduced": "19", + "first_introduced": "20", "name": "OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback" }, { - "first_introduced": "19", + "first_introduced": "20", "name": "OH_AudioStreamBuilder_SetCapturerInterruptCallback" }, { - "first_introduced": "19", + "first_introduced": "20", "name": "OH_AudioStreamBuilder_SetCapturerErrorCallback" }, - { - "first_introduced": "19", - "name": "OH_AudioManager_GetAudioStreamManager" - }, - { - "first_introduced": "19", - "name": "OH_AudioStreamManager_GetDirectPlaybackSupport" - }, { "first_introduced": "20", "name": "OH_AudioStreamManager_IsAcousticEchoCancelerSupported"