From fea771788d7ffae72093b3cc0dac52b90d70a40e Mon Sep 17 00:00:00 2001 From: zhangwt3652 Date: Tue, 8 Apr 2025 10:13:57 +0800 Subject: [PATCH] Modify callback API version of Audio. Signed-off-by: zhangwt3652 --- .../audio_capturer/native_audiocapturer.h | 8 ++++---- .../audio_renderer/native_audiorenderer.h | 4 ++-- .../common/native_audiostream_base.h | 20 +++++++++---------- .../common/native_audiostreambuilder.h | 12 +++++------ multimedia/audio_framework/ohaudio.ndk.json | 12 +++++------ 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index bbe32247e..f2f256e49 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -296,7 +296,7 @@ OH_AudioStream_Result OH_AudioCapturer_GetOverflowCount(OH_AudioCapturer* captur * @param audioData Audio data pointer, where user should read. * @param audioDataSize Size of audio data that user should read. * @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnReadData - * @since 18 + * @since 19 */ typedef void (*OH_AudioCapturer_OnReadDataCallback)(OH_AudioCapturer* capturer, void* userData, void* audioData, int32_t audioDataSize); @@ -310,7 +310,7 @@ typedef void (*OH_AudioCapturer_OnReadDataCallback)(OH_AudioCapturer* capturer, * @param userData User data which is passed by user. * @param deviceArray Array of AudioDeviceDescriptor where the capturing data from. * @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnStreamEvent - * @since 18 + * @since 19 */ typedef void (*OH_AudioCapturer_OnDeviceChangeCallback)(OH_AudioCapturer* capturer, void* userData, OH_AudioDeviceDescriptorArray* deviceArray); @@ -325,7 +325,7 @@ typedef void (*OH_AudioCapturer_OnDeviceChangeCallback)(OH_AudioCapturer* captur * @param type Force type of this interrupt event. * @param hint Hint of this interrupt event. * @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnInterruptEvent. - * @since 18 + * @since 19 */ typedef void (*OH_AudioCapturer_OnInterruptCallback)(OH_AudioCapturer* capturer, void* userData, OH_AudioInterrupt_ForceType type, OH_AudioInterrupt_Hint hint); @@ -339,7 +339,7 @@ typedef void (*OH_AudioCapturer_OnInterruptCallback)(OH_AudioCapturer* capturer, * @param userData User data which is passed by user. * @param error Error while using AudioCapturer. * @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnError - * @since 18 + * @since 19 */ typedef void (*OH_AudioCapturer_OnErrorCallback)(OH_AudioCapturer* renderer, void* userData, OH_AudioStream_Result error); diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index be7722f07..f048de6e5 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -545,7 +545,7 @@ OH_AudioStream_Result OH_AudioRenderer_GetAudioTimestampInfo(OH_AudioRenderer* r * @param type Force type of this interrupt event. * @param hint Hint of this interrupt event. * @see OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnInterruptEvent. - * @since 18 + * @since 19 */ typedef void (*OH_AudioRenderer_OnInterruptCallback)(OH_AudioRenderer* renderer, void* userData, OH_AudioInterrupt_ForceType type, OH_AudioInterrupt_Hint hint); @@ -559,7 +559,7 @@ typedef void (*OH_AudioRenderer_OnInterruptCallback)(OH_AudioRenderer* renderer, * @param userData User data which is passed by user. * @param error Error while using AudioRenderer. * @see OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnError - * @since 18 + * @since 19 */ 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 042f1f3ed..bb0c02c36 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -528,7 +528,7 @@ typedef struct OH_AudioCapturerStruct OH_AudioCapturer; /** * @brief Declaring the callback struct for renderer stream. * - * @deprecated since 18 + * @deprecated since 19 * @useinstead Use the callback type: OH_AudioRenderer_OnWriteDataCallback, OH_AudioRenderer_OutputDeviceChangeCallback, * OH_AudioRenderer_OnInterruptEvent, OH_AudioRenderer_OnErrorCallback separately. * @since 10 @@ -538,7 +538,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 18 + * @deprecated since 19 * @useinstead OH_AudioRenderer_OnWriteDataCallback. * @since 10 */ @@ -552,7 +552,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 18 + * @deprecated since 19 * @useinstead OH_AudioRenderer_OutputDeviceChangeCallback. * @since 10 */ @@ -565,7 +565,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 18 + * @deprecated since 19 * @useinstead OH_AudioRenderer_OnInterruptCallback. * @since 10 */ @@ -579,7 +579,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 18 + * @deprecated since 19 * @useinstead OH_AudioRenderer_OnErrorCallback. * @since 10 */ @@ -592,7 +592,7 @@ typedef struct OH_AudioRenderer_Callbacks_Struct { /** * @brief Declaring the callback struct for capturer stream. * - * @deprecated since 18 + * @deprecated since 19 * @useinstead Use the callback type: OH_AudioCapturer_OnReadDataCallback, OH_AudioCapturer_OnDeviceChangeCallback, * OH_AudioCapturer_OnInterruptCallback and OH_AudioCapturer_OnErrorCallback separately. * @since 10 @@ -602,7 +602,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 18 + * @deprecated since 19 * @useinstead OH_AudioCapturer_OnReadDataCallback * @since 10 */ @@ -616,7 +616,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 18 + * @deprecated since 19 * @useinstead OH_AudioRenderer_OutputDeviceChangeCallback * @since 10 */ @@ -629,7 +629,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 18 + * @deprecated since 19 * @useinstead OH_AudioCapturer_OnInterruptCallback * @since 10 */ @@ -643,7 +643,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 18 + * @deprecated since 19 * @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 5fb946d81..0e240fa24 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -399,7 +399,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetVolumeMode(OH_AudioStreamBuilder* * @return Result code. * {@link AUDIOSTREAM_SUCCESS} Success. * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 18 + * @since 19 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInterruptCallback(OH_AudioStreamBuilder* builder, OH_AudioRenderer_OnInterruptCallback callback, void* userData); @@ -416,7 +416,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInterruptCallback(OH_Audi * @return Result code. * {@link AUDIOSTREAM_SUCCESS} Success. * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 18 + * @since 19 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererErrorCallback(OH_AudioStreamBuilder* builder, OH_AudioRenderer_OnErrorCallback callback, void* userData); @@ -433,7 +433,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererErrorCallback(OH_AudioStr * @return Result code. * {@link AUDIOSTREAM_SUCCESS} Success. * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 18 + * @since 19 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerReadDataCallback(OH_AudioStreamBuilder* builder, OH_AudioCapturer_OnReadDataCallback callback, void* userData); @@ -450,7 +450,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerReadDataCallback(OH_Audio * @return Result code. * {@link AUDIOSTREAM_SUCCESS} Success. * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 18 + * @since 19 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback(OH_AudioStreamBuilder* builder, OH_AudioCapturer_OnDeviceChangeCallback callback, void* userData); @@ -467,7 +467,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback(OH_A * @return Result code. * {@link AUDIOSTREAM_SUCCESS} Success. * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 18 + * @since 19 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerInterruptCallback(OH_AudioStreamBuilder* builder, OH_AudioCapturer_OnInterruptCallback callback, void* userData); @@ -484,7 +484,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerInterruptCallback(OH_Audi * @return Result code. * {@link AUDIOSTREAM_SUCCESS} Success. * {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c. - * @since 18 + * @since 19 */ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerErrorCallback(OH_AudioStreamBuilder* builder, OH_AudioCapturer_OnErrorCallback callback, void* userData); diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 9366ddd75..34356ac42 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -388,27 +388,27 @@ "name": "OH_AudioStreamBuilder_SetVolumeMode" }, { - "first_introduced": "18", + "first_introduced": "19", "name": "OH_AudioStreamBuilder_SetRendererInterruptCallback" }, { - "first_introduced": "18", + "first_introduced": "19", "name": "OH_AudioStreamBuilder_SetRendererErrorCallback" }, { - "first_introduced": "18", + "first_introduced": "19", "name": "OH_AudioStreamBuilder_SetCapturerReadDataCallback" }, { - "first_introduced": "18", + "first_introduced": "19", "name": "OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback" }, { - "first_introduced": "18", + "first_introduced": "19", "name": "OH_AudioStreamBuilder_SetCapturerInterruptCallback" }, { - "first_introduced": "18", + "first_introduced": "19", "name": "OH_AudioStreamBuilder_SetCapturerErrorCallback" } ] -- Gitee