From 2dc0f28dd7f285cafd28c674da4831d8f112a0e2 Mon Sep 17 00:00:00 2001 From: magekkkk Date: Mon, 28 Apr 2025 11:32:04 +0000 Subject: [PATCH 1/3] add perf doc part 2 Signed-off-by: magekkkk --- .../audio_framework/audio_renderer/native_audiorenderer.h | 8 ++++++++ .../audio_framework/common/native_audiostreambuilder.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 6ad655177..bf38bad7e 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -242,6 +242,10 @@ OH_AudioStream_Result OH_AudioRenderer_GetFramesWritten(OH_AudioRenderer* render /** * Query the the time at which a particular frame was presented. + * + * It is recommended to use new api {@link OH_AudioRenderer_GetAudioTimestampInfo} + * because it adapts to playback speed change, but current api does not. The + * increasing speed for position will not change when speed become fast. * * @since 10 * @@ -517,6 +521,10 @@ OH_AudioStream_Result OH_AudioRenderer_SetDefaultOutputDevice( * This interface also adapts to playback speed change. For example, the increseing speed for * position will be double for 2x speed playback. * + * For video synchronization usage, there is a best practice document for developer to refer + * [AV Synchronization]{@link + * https://}. + * * @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer() * @param framePosition Pointer to a variable to receive the position * @param timestamp Pointer to a variable to receive the timestamp diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index acd0beba1..4d055545b 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -287,6 +287,10 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerCallback(OH_AudioStreamBu * 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}. + * + * If you want to use AudioRenderer api to implement a music playback application, there are also many interactive + * scenes to consider, see [Developing an Audio Application]{@link + * https://}. * * @since 10 * -- Gitee From 15f94863be2273862adca6345ca5b78f8b499007 Mon Sep 17 00:00:00 2001 From: AOL Date: Tue, 29 Apr 2025 02:28:52 +0000 Subject: [PATCH 2/3] update urls Signed-off-by: AOL --- .../audio_framework/audio_renderer/native_audiorenderer.h | 2 +- multimedia/audio_framework/common/native_audiostreambuilder.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index bf38bad7e..6789003ec 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -523,7 +523,7 @@ OH_AudioStream_Result OH_AudioRenderer_SetDefaultOutputDevice( * * For video synchronization usage, there is a best practice document for developer to refer * [AV Synchronization]{@link - * https://}. + * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-audio-video-synchronization}. * * @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer() * @param framePosition Pointer to a variable to receive the position diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 4d055545b..67ee1de7f 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -290,7 +290,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerCallback(OH_AudioStreamBu * * If you want to use AudioRenderer api to implement a music playback application, there are also many interactive * scenes to consider, see [Developing an Audio Application]{@link - * https://}. + * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-audio-interaction-practice}. * * @since 10 * -- Gitee From 587bcac5d45a77004a365396ddcaa6b845c19c5c Mon Sep 17 00:00:00 2001 From: AOL Date: Wed, 7 May 2025 11:00:25 +0000 Subject: [PATCH 3/3] remove blank Signed-off-by: AOL Change-Id: Ie262ea254aaf5cf95f6ae0c65857f5f1655648c3 --- .../audio_renderer/native_audiorenderer.h | 5 ++--- .../common/native_audiostreambuilder.h | 17 ++++++----------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 6789003ec..8a59ae479 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -242,7 +242,7 @@ OH_AudioStream_Result OH_AudioRenderer_GetFramesWritten(OH_AudioRenderer* render /** * Query the the time at which a particular frame was presented. - * + * * It is recommended to use new api {@link OH_AudioRenderer_GetAudioTimestampInfo} * because it adapts to playback speed change, but current api does not. The * increasing speed for position will not change when speed become fast. @@ -522,8 +522,7 @@ OH_AudioStream_Result OH_AudioRenderer_SetDefaultOutputDevice( * position will be double for 2x speed playback. * * For video synchronization usage, there is a best practice document for developer to refer - * [AV Synchronization]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-audio-video-synchronization}. + * **AV Synchronization**. * * @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer() * @param framePosition Pointer to a variable to receive the position diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 67ee1de7f..413d8d7f5 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -276,21 +276,16 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerCallback(OH_AudioStreamBu * 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}. + * consumption by following this best practices document **Low-Power Rules in Music Playback Scenarios**. + * And for navigation situation, you can follow **Low-Power Rules in Navigation and Positioning 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}. + * is still needed, see **Audio Resources** in best practices document. * 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}. - * + * control measures when this behavior is detected, see **Audio Playback** in best practices document. + * * If you want to use AudioRenderer api to implement a music playback application, there are also many interactive - * scenes to consider, see [Developing an Audio Application]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-audio-interaction-practice}. + * scenes to consider, see **Developing an Audio Application** in best practices document. * * @since 10 * -- Gitee