From c18047179646fbbefcb0838145951fbadda631d4 Mon Sep 17 00:00:00 2001 From: huchang Date: Mon, 11 Mar 2024 18:03:53 +0800 Subject: [PATCH] get underflow/overflow count on audio stream Signed-off-by: huchang Change-Id: Iafa74b1d096f754443ee3a5f5554884199ee38c9 --- .../audio_capturer/native_audiocapturer.h | 11 +++++++++++ .../audio_renderer/native_audiorenderer.h | 10 ++++++++++ multimedia/audio_framework/ohaudio.ndk.json | 8 ++++++++ 3 files changed, 29 insertions(+) diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index 68d5796ca..249891cf9 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -228,6 +228,17 @@ OH_AudioStream_Result OH_AudioCapturer_GetTimestamp(OH_AudioCapturer* capturer, * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. */ OH_AudioStream_Result OH_AudioCapturer_GetFramesRead(OH_AudioCapturer* capturer, int64_t* frames); + +/** + * @brief Gets the overflow count on this stream. + * + * @param capturer Capturer generated by OH_AudioStreamBuilder_GenerateCapturer() + * @param count Pointer to a variable that will be set for the overflow count number. + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + * @since 12 + */ +OH_AudioStream_Result OH_AudioCapturer_GetOverflowCount(OH_AudioCapturer* capturer, uint32_t* count); + #ifdef __cplusplus } #endif diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index be164c362..0a04b3795 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -304,6 +304,16 @@ OH_AudioStream_Result OH_AudioRenderer_SetMarkPosition(OH_AudioRenderer* rendere */ OH_AudioStream_Result OH_AudioRenderer_CancelMark(OH_AudioRenderer* renderer); +/** + * @brief Gets the underflow count on this stream. + * + * @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer() + * @param count Pointer to a variable to receive the underflow count number. + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + * @since 12 + */ +OH_AudioStream_Result OH_AudioRenderer_GetUnderflowCount(OH_AudioRenderer* renderer, uint32_t* count); + #ifdef __cplusplus } #endif diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 9365cd644..39b8be0ec 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -214,5 +214,13 @@ { "first_introduced": "12", "name": "OH_AudioRenderer_CancelMark" + }, + { + "first_introduced": "12", + "name": "OH_AudioRenderer_GetUnderflowCount" + }, + { + "first_introduced":"12", + "name": "OH_AudioCapturer_GetOverflowCount" } ] -- Gitee