From 200594f945f49831c61a2701aabeb8379751b13b Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Thu, 29 Feb 2024 10:27:38 +0800 Subject: [PATCH 01/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../audio_renderer/native_audiorenderer.h | 24 +++++++++++ .../common/native_audiostream_base.h | 41 +++++++++++++++++++ .../common/native_audiostreambuilder.h | 27 +++++++++++- 3 files changed, 91 insertions(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 990aae20d59..c3e2d3477d4 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -250,6 +250,30 @@ OH_AudioStream_Result OH_AudioRenderer_GetSpeed(OH_AudioRenderer* renderer, floa */ OH_AudioStream_Result OH_AudioRenderer_SetSpeed(OH_AudioRenderer* renderer, float speed); +/* + * Query current audio effect mode. + * + * @since 12 + * + * @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer() + * @param effectMode Pointer to a variable to receive current audio effect mode + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + */ +OH_AudioStream_Result OH_AudioRenderer_GetEffectMode(OH_AudioRenderer* renderer, + OH_AudioStream_AudioEffectMode* effectMode); + +/* + * Set current audio effect mode. + * + * @since 12 + * + * @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer() + * @param effectMode Audio effect mode that will be set for the stream + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + */ +OH_AudioStream_Result OH_AudioRenderer_SetEffectMode(OH_AudioRenderer* renderer, + OH_AudioStream_AudioEffectMode effectMode); + #ifdef __cplusplus } #endif diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 10332c357e5..9aa9f099ffa 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -144,6 +144,12 @@ typedef enum { * @since 10 */ AUDIOSTREAM_ENCODING_TYPE_RAW = 0, + /** + * AudioVivid encoding type. + * + * @since 12 + */ + AUDIOSTREAM_ENCODING_TYPE_AUDIOVIVID = 1, } OH_AudioStream_EncodingType; /** @@ -420,6 +426,26 @@ typedef enum { AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION = 7 } OH_AudioStream_SourceType; +/** + * @brief Defines the audio effect mode. + * + * @since 12 + */ +typedef enum { + /** + * Audio Effect Mode effect none. + * + * @since 12 + */ + EFFECT_NONE = 0, + /** + * Audio Effect Mode effect default. + * + * @since 12 + */ + EFFECT_DEFAULT = 1, +} OH_AudioStream_AudioEffectMode; + /** * Declaring the audio stream builder. * The instance of builder is used for creating audio stream. @@ -577,6 +603,21 @@ typedef enum { */ typedef void (*OH_AudioRenderer_OutputDeviceChangeCallback)(OH_AudioRenderer* renderer, void* userData, OH_AudioStream_DeviceChangeReason reason); + +/** + * @brief This function pointer will point to the callback function that + * is used to write audio data with metadata + * + * @param renderer AudioRenderer where this event occurs. + * @param userData User data which is passed by user. + * @param audioData Audio data which is written by user. + * @param audioDataSize Audio data size which is the size of audio data written by user. + * @param metadata Metadata which is written by user. + * @param metadataSize Metadata size which is the size of metadata written by user. + * @since 12 + */ +typedef OH_AudioStream_Result (*OH_AudioRenderer_WriteDataWithMetadataCallback)(OH_AudioRenderer* renderer, + void* userData, void* audioData, int32_t audioDataSize, void* metadata, int32_t metadataSize); #ifdef __cplusplus } #endif diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 44b1e4ae268..f87fa9913f3 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -109,7 +109,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetSampleFormat(OH_AudioStreamBuilde * @since 10 * * @param builder Reference provided by OH_AudioStreamBuilder_Create() - * @param encodingType Encoding type for the stream client, {@link #AUDIOSTREAM_ENCODING_PCM} + * @param encodingType Encoding type for the stream client * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. */ OH_AudioStream_Result OH_AudioStreamBuilder_SetEncodingType(OH_AudioStreamBuilder* builder, @@ -227,6 +227,31 @@ OH_AudioStream_Result OH_AudioStreamBuilder_GenerateCapturer(OH_AudioStreamBuild OH_AudioStream_Result OH_AudioStreamBuilder_SetFrameSizeInCallback(OH_AudioStreamBuilder* builder, int32_t frameSize); +/* + * Set the channel layout to the stream client + * + * @since 12 + * + * @param builder Reference provided by OH_AudioStreamBuilder_Create() + * @param channelLayout is the layout of the speaker. + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + */ +OH_AudioStream_Result OH_AudioStreamBuilder_SetChannelLayout(OH_AudioStreamBuilder* builder, + uint64_t channelLayout); + +/* + * Set the callback of writing metadata to the renderer client + * + * @since 12 + * + * @param builder Reference provided by OH_AudioStreamBuilder_Create() + * @param callback Callback to the functions that will write audio data with metadata to the renderer. + * @param userData Pointer to an application data structure that will be passed to the callback functions. + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + */ +OH_AudioStream_Result OH_AudioStreamBuilder_SetWriteDataWithMetadataCallback(OH_AudioStreamBuilder* builder, + OH_AudioRenderer_WriteDataWithMetadataCallback callback, void* userData); + #ifdef __cplusplus } #endif -- Gitee From 8eee54f9c5dfc8d9caed5df1f9ae899812b877df Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Thu, 29 Feb 2024 14:14:45 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../common/native_audiostreambuilder.h | 4 ++-- multimedia/audio_framework/ohaudio.ndk.json | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index f87fa9913f3..68dec24fab2 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -109,7 +109,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetSampleFormat(OH_AudioStreamBuilde * @since 10 * * @param builder Reference provided by OH_AudioStreamBuilder_Create() - * @param encodingType Encoding type for the stream client + * @param encodingType Encoding type for the stream client, {@link #AUDIOSTREAM_ENCODING_PCM} * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. */ OH_AudioStream_Result OH_AudioStreamBuilder_SetEncodingType(OH_AudioStreamBuilder* builder, @@ -237,7 +237,7 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetFrameSizeInCallback(OH_AudioStrea * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. */ OH_AudioStream_Result OH_AudioStreamBuilder_SetChannelLayout(OH_AudioStreamBuilder* builder, - uint64_t channelLayout); + OH_AudioChannelLayout channelLayout); /* * Set the callback of writing metadata to the renderer client diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 3294a8a937f..9bf83d9cf1e 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -194,5 +194,21 @@ { "first_introduced": "11", "name": "OH_AudioRenderer_SetSpeed" + }, + { + "first_introduced": "12", + "name": "OH_AudioRenderer_GetEffectMode" + }, + { + "first_introduced": "12", + "name": "OH_AudioRenderer_SetEffectMode" + }, + { + "first_introduced": "12", + "name": "OH_AudioStreamBuilder_SetChannelLayout" + }, + { + "first_introduced": "12", + "name": "OH_AudioStreamBuilder_SetWriteDataWithMetadataCallback" } ] -- Gitee From 21996873983a23f05081c4c4ac12916c18eb1186 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Thu, 29 Feb 2024 18:58:23 +0800 Subject: [PATCH 03/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/common/native_audiostreambuilder.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 68dec24fab2..6195204436d 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -40,6 +40,7 @@ #include "native_audiostream_base.h" #include "native_audiorenderer.h" +#include "../../media_foundation/native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { #endif -- Gitee From afb7f6d98f9fec985646b58fec54bf424b665b4f Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Fri, 1 Mar 2024 10:47:51 +0800 Subject: [PATCH 04/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/BUILD.gn | 2 ++ multimedia/audio_framework/common/native_audiostreambuilder.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/multimedia/audio_framework/BUILD.gn b/multimedia/audio_framework/BUILD.gn index 52780d5141b..9fbc8edbf51 100644 --- a/multimedia/audio_framework/BUILD.gn +++ b/multimedia/audio_framework/BUILD.gn @@ -21,6 +21,7 @@ ohos_ndk_headers("ohaudio_header") { "audio_renderer/native_audiorenderer.h", "common/native_audiostream_base.h", "common/native_audiostreambuilder.h", + "../media_foundation/native_audio_channel_layout.h", ] } @@ -34,5 +35,6 @@ ohos_ndk_library("libohaudio_ndk") { "ohaudio/native_audiostreambuilder.h", "ohaudio/native_audiorenderer.h", "ohaudio/native_audiocapturer.h", + "ohaudio/native_audio_channel_layout.h", ] } diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 6195204436d..18eccb2aaea 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -40,7 +40,7 @@ #include "native_audiostream_base.h" #include "native_audiorenderer.h" -#include "../../media_foundation/native_audio_channel_layout.h" +#include "native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { #endif -- Gitee From 197b510e76c76c66e4952823f24b42588b3e5d95 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Mon, 4 Mar 2024 11:06:09 +0800 Subject: [PATCH 05/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../audio_renderer/native_audiorenderer.h | 13 +++++++++++++ .../common/native_audiostreambuilder.h | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index c3e2d3477d4..8ebec0a893c 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -40,6 +40,7 @@ #include #include "native_audiostream_base.h" +#include "native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { #endif @@ -250,6 +251,18 @@ OH_AudioStream_Result OH_AudioRenderer_GetSpeed(OH_AudioRenderer* renderer, floa */ OH_AudioStream_Result OH_AudioRenderer_SetSpeed(OH_AudioRenderer* renderer, float speed); +/* + * Query the channel layout of the renderer client. + * + * @since 12 + * + * @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer() + * @param channelLayout Pointer to a variable to receive the channel layout + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + */ +OH_AudioStream_Result OH_AudioRenderer_GetChannelLayout(OH_AudioRenderer* renderer, + OH_AudioChannelLayout* channelLayout); + /* * Query current audio effect mode. * diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 18eccb2aaea..68dec24fab2 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -40,7 +40,6 @@ #include "native_audiostream_base.h" #include "native_audiorenderer.h" -#include "native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { #endif -- Gitee From 5b269112d910b5691d3268218596899e36eb9ae2 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 5 Mar 2024 10:28:08 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/BUILD.gn b/multimedia/audio_framework/BUILD.gn index 9fbc8edbf51..9373358c1cd 100644 --- a/multimedia/audio_framework/BUILD.gn +++ b/multimedia/audio_framework/BUILD.gn @@ -21,7 +21,7 @@ ohos_ndk_headers("ohaudio_header") { "audio_renderer/native_audiorenderer.h", "common/native_audiostream_base.h", "common/native_audiostreambuilder.h", - "../media_foundation/native_audio_channel_layout.h", + "common/native_audio_channel_layout.h", ] } -- Gitee From 0c484f15f74ee962772f9631f40ebeb8a59d3746 Mon Sep 17 00:00:00 2001 From: chongteng wang Date: Tue, 5 Mar 2024 10:30:26 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chongteng wang --- multimedia/audio_framework/common/native_audio_channel_layout.h | 1 + 1 file changed, 1 insertion(+) create mode 120000 multimedia/audio_framework/common/native_audio_channel_layout.h diff --git a/multimedia/audio_framework/common/native_audio_channel_layout.h b/multimedia/audio_framework/common/native_audio_channel_layout.h new file mode 120000 index 00000000000..e7c46aace85 --- /dev/null +++ b/multimedia/audio_framework/common/native_audio_channel_layout.h @@ -0,0 +1 @@ +./media_foundation/native_audio_channel_layout.h \ No newline at end of file -- Gitee From 4eb825c99da142febb62168d31c8c72521a49fc2 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 5 Mar 2024 10:39:01 +0800 Subject: [PATCH 08/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../common/native_audiostreambuilder.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 68dec24fab2..4bdaa0c599a 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -127,6 +127,18 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetEncodingType(OH_AudioStreamBuilde OH_AudioStream_Result OH_AudioStreamBuilder_SetLatencyMode(OH_AudioStreamBuilder* builder, OH_AudioStream_LatencyMode latencyMode); +/* + * Set the channel layout to the stream client + * + * @since 12 + * + * @param builder Reference provided by OH_AudioStreamBuilder_Create() + * @param channelLayout is the layout of the speaker. + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + */ +OH_AudioStream_Result OH_AudioStreamBuilder_SetChannelLayout(OH_AudioStreamBuilder* builder, + OH_AudioChannelLayout channelLayout); + /* * Set the renderer information of the stream client * @@ -227,18 +239,6 @@ OH_AudioStream_Result OH_AudioStreamBuilder_GenerateCapturer(OH_AudioStreamBuild OH_AudioStream_Result OH_AudioStreamBuilder_SetFrameSizeInCallback(OH_AudioStreamBuilder* builder, int32_t frameSize); -/* - * Set the channel layout to the stream client - * - * @since 12 - * - * @param builder Reference provided by OH_AudioStreamBuilder_Create() - * @param channelLayout is the layout of the speaker. - * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. - */ -OH_AudioStream_Result OH_AudioStreamBuilder_SetChannelLayout(OH_AudioStreamBuilder* builder, - OH_AudioChannelLayout channelLayout); - /* * Set the callback of writing metadata to the renderer client * -- Gitee From b309693ffbb3250e94a0fa97b7aff5018da83892 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 5 Mar 2024 12:07:09 +0800 Subject: [PATCH 09/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../audio_capturer/native_audiocapturer.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index 68d5796ca55..05c9f561808 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -40,6 +40,7 @@ #include #include "native_audiostream_base.h" +#include "native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { #endif @@ -228,6 +229,18 @@ 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); + +/* + * Query the channel layout of the renderer client. + * + * @since 12 + * + * @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer() + * @param channelLayout Pointer to a variable to receive the channel layout + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + */ +OH_AudioStream_Result OH_AudioRenderer_GetChannelLayout(OH_AudioCapturer* capturer, + OH_AudioChannelLayout* channelLayout); #ifdef __cplusplus } #endif -- Gitee From 8bfb563fb0906ab12c40beb9bfba0827d014bf2b Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 5 Mar 2024 12:10:46 +0800 Subject: [PATCH 10/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../audio_framework/audio_capturer/native_audiocapturer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index 05c9f561808..55cc76bdefc 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -239,7 +239,7 @@ OH_AudioStream_Result OH_AudioCapturer_GetFramesRead(OH_AudioCapturer* capturer, * @param channelLayout Pointer to a variable to receive the channel layout * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. */ -OH_AudioStream_Result OH_AudioRenderer_GetChannelLayout(OH_AudioCapturer* capturer, +OH_AudioStream_Result OH_AudioCapturer_GetChannelLayout(OH_AudioCapturer* capturer, OH_AudioChannelLayout* channelLayout); #ifdef __cplusplus } -- Gitee From 02f5d664c58a683b94e01feccb76b6a11fb787a6 Mon Sep 17 00:00:00 2001 From: chongteng wang Date: Tue, 5 Mar 2024 14:20:10 +0800 Subject: [PATCH 11/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chongteng wang --- multimedia/audio_framework/common/native_audio_channel_layout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/common/native_audio_channel_layout.h b/multimedia/audio_framework/common/native_audio_channel_layout.h index e7c46aace85..200e9c54102 120000 --- a/multimedia/audio_framework/common/native_audio_channel_layout.h +++ b/multimedia/audio_framework/common/native_audio_channel_layout.h @@ -1 +1 @@ -./media_foundation/native_audio_channel_layout.h \ No newline at end of file +../../media_foundation/native_audio_channel_layout.h \ No newline at end of file -- Gitee From fdcf6a79a4dfdf8e4e27e7f544d09df38f5e0f39 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 5 Mar 2024 14:22:33 +0800 Subject: [PATCH 12/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../audio_framework/audio_capturer/native_audiocapturer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index 55cc76bdefc..51b66b217cf 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -231,11 +231,11 @@ OH_AudioStream_Result OH_AudioCapturer_GetTimestamp(OH_AudioCapturer* capturer, OH_AudioStream_Result OH_AudioCapturer_GetFramesRead(OH_AudioCapturer* capturer, int64_t* frames); /* - * Query the channel layout of the renderer client. + * Query the channel layout of the capturer client. * * @since 12 * - * @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer() + * @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer() * @param channelLayout Pointer to a variable to receive the channel layout * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. */ -- Gitee From 96b6fb40d1812fdb928dece3a1b6d8a0a08dbd74 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 5 Mar 2024 14:42:31 +0800 Subject: [PATCH 13/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/BUILD.gn b/multimedia/audio_framework/BUILD.gn index 9373358c1cd..bad8f6cdc76 100644 --- a/multimedia/audio_framework/BUILD.gn +++ b/multimedia/audio_framework/BUILD.gn @@ -19,9 +19,9 @@ ohos_ndk_headers("ohaudio_header") { sources = [ "audio_capturer/native_audiocapturer.h", "audio_renderer/native_audiorenderer.h", + "common/native_audio_channel_layout.h", "common/native_audiostream_base.h", "common/native_audiostreambuilder.h", - "common/native_audio_channel_layout.h", ] } -- Gitee From 24fb5ad2e171ebe1049654e78316b2625ddc0d6c Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Sat, 9 Mar 2024 09:47:48 +0800 Subject: [PATCH 14/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../audio_framework/audio_capturer/native_audiocapturer.h | 2 +- .../audio_framework/audio_renderer/native_audiorenderer.h | 2 +- multimedia/audio_framework/common/native_audio_channel_layout.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 120000 multimedia/audio_framework/common/native_audio_channel_layout.h diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index 51b66b217cf..e8bbada64a4 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -40,7 +40,7 @@ #include #include "native_audiostream_base.h" -#include "native_audio_channel_layout.h" +#include "multimedia/native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { #endif diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 8ebec0a893c..3a93c935e72 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -40,7 +40,7 @@ #include #include "native_audiostream_base.h" -#include "native_audio_channel_layout.h" +#include "multimedia/native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { #endif diff --git a/multimedia/audio_framework/common/native_audio_channel_layout.h b/multimedia/audio_framework/common/native_audio_channel_layout.h deleted file mode 120000 index 200e9c54102..00000000000 --- a/multimedia/audio_framework/common/native_audio_channel_layout.h +++ /dev/null @@ -1 +0,0 @@ -../../media_foundation/native_audio_channel_layout.h \ No newline at end of file -- Gitee From f7eba6661ff3b2c7263b52bbd5a1f892bb9aad8c Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Sat, 9 Mar 2024 09:49:37 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/BUILD.gn | 2 -- 1 file changed, 2 deletions(-) diff --git a/multimedia/audio_framework/BUILD.gn b/multimedia/audio_framework/BUILD.gn index bad8f6cdc76..52780d5141b 100644 --- a/multimedia/audio_framework/BUILD.gn +++ b/multimedia/audio_framework/BUILD.gn @@ -19,7 +19,6 @@ ohos_ndk_headers("ohaudio_header") { sources = [ "audio_capturer/native_audiocapturer.h", "audio_renderer/native_audiorenderer.h", - "common/native_audio_channel_layout.h", "common/native_audiostream_base.h", "common/native_audiostreambuilder.h", ] @@ -35,6 +34,5 @@ ohos_ndk_library("libohaudio_ndk") { "ohaudio/native_audiostreambuilder.h", "ohaudio/native_audiorenderer.h", "ohaudio/native_audiocapturer.h", - "ohaudio/native_audio_channel_layout.h", ] } -- Gitee From 30d88f0379bc30776b8e7dbc6d1ea1b498637840 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Wed, 13 Mar 2024 14:08:20 +0800 Subject: [PATCH 16/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/ohaudio.ndk.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 9bf83d9cf1e..614e0bf563f 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -203,6 +203,14 @@ "first_introduced": "12", "name": "OH_AudioRenderer_SetEffectMode" }, + { + "first_introduced": "12", + "name": "OH_AudioRenderer_GetChannelLayout" + }, + { + "first_introduced": "12", + "name": "OH_AudioCapturer_GetChannelLayout" + }, { "first_introduced": "12", "name": "OH_AudioStreamBuilder_SetChannelLayout" -- Gitee From 00f69dc1850259199f19fecd99ba730313255563 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Mon, 18 Mar 2024 19:00:37 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../audio_capturer/native_audiocapturer.h | 13 ------------- multimedia/audio_framework/ohaudio.ndk.json | 4 ---- 2 files changed, 17 deletions(-) diff --git a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h index e8bbada64a4..68d5796ca55 100644 --- a/multimedia/audio_framework/audio_capturer/native_audiocapturer.h +++ b/multimedia/audio_framework/audio_capturer/native_audiocapturer.h @@ -40,7 +40,6 @@ #include #include "native_audiostream_base.h" -#include "multimedia/native_audio_channel_layout.h" #ifdef __cplusplus extern "C" { #endif @@ -229,18 +228,6 @@ 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); - -/* - * Query the channel layout of the capturer client. - * - * @since 12 - * - * @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer() - * @param channelLayout Pointer to a variable to receive the channel layout - * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. - */ -OH_AudioStream_Result OH_AudioCapturer_GetChannelLayout(OH_AudioCapturer* capturer, - OH_AudioChannelLayout* channelLayout); #ifdef __cplusplus } #endif diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 614e0bf563f..996588b3c07 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -207,10 +207,6 @@ "first_introduced": "12", "name": "OH_AudioRenderer_GetChannelLayout" }, - { - "first_introduced": "12", - "name": "OH_AudioCapturer_GetChannelLayout" - }, { "first_introduced": "12", "name": "OH_AudioStreamBuilder_SetChannelLayout" -- Gitee From cd2bbcbf2c0db709a9060841c02ce825ead85e20 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Mon, 18 Mar 2024 19:58:57 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/common/native_audiostream_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 9aa9f099ffa..526ae10cc66 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -616,7 +616,7 @@ typedef void (*OH_AudioRenderer_OutputDeviceChangeCallback)(OH_AudioRenderer* re * @param metadataSize Metadata size which is the size of metadata written by user. * @since 12 */ -typedef OH_AudioStream_Result (*OH_AudioRenderer_WriteDataWithMetadataCallback)(OH_AudioRenderer* renderer, +typedef int32_t (*OH_AudioRenderer_WriteDataWithMetadataCallback)(OH_AudioRenderer* renderer, void* userData, void* audioData, int32_t audioDataSize, void* metadata, int32_t metadataSize); #ifdef __cplusplus } -- Gitee From 7a35097e0ed6a50a0d10aa569a8a4347858145cd Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 19 Mar 2024 16:28:52 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- .../audio_renderer/native_audiorenderer.h | 12 ++++++------ .../common/native_audiostreambuilder.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h index 3a93c935e72..77b7a1c7914 100644 --- a/multimedia/audio_framework/audio_renderer/native_audiorenderer.h +++ b/multimedia/audio_framework/audio_renderer/native_audiorenderer.h @@ -251,8 +251,8 @@ OH_AudioStream_Result OH_AudioRenderer_GetSpeed(OH_AudioRenderer* renderer, floa */ OH_AudioStream_Result OH_AudioRenderer_SetSpeed(OH_AudioRenderer* renderer, float speed); -/* - * Query the channel layout of the renderer client. +/** + * @brief Query the channel layout of the renderer client. * * @since 12 * @@ -263,8 +263,8 @@ OH_AudioStream_Result OH_AudioRenderer_SetSpeed(OH_AudioRenderer* renderer, floa OH_AudioStream_Result OH_AudioRenderer_GetChannelLayout(OH_AudioRenderer* renderer, OH_AudioChannelLayout* channelLayout); -/* - * Query current audio effect mode. +/** + * @brief Query current audio effect mode. * * @since 12 * @@ -275,8 +275,8 @@ OH_AudioStream_Result OH_AudioRenderer_GetChannelLayout(OH_AudioRenderer* render OH_AudioStream_Result OH_AudioRenderer_GetEffectMode(OH_AudioRenderer* renderer, OH_AudioStream_AudioEffectMode* effectMode); -/* - * Set current audio effect mode. +/** + * @brief Set current audio effect mode. * * @since 12 * diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 4bdaa0c599a..79a64dbf510 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -127,8 +127,8 @@ OH_AudioStream_Result OH_AudioStreamBuilder_SetEncodingType(OH_AudioStreamBuilde OH_AudioStream_Result OH_AudioStreamBuilder_SetLatencyMode(OH_AudioStreamBuilder* builder, OH_AudioStream_LatencyMode latencyMode); -/* - * Set the channel layout to the stream client +/** + * @brief Set the channel layout to the stream client * * @since 12 * @@ -239,8 +239,8 @@ OH_AudioStream_Result OH_AudioStreamBuilder_GenerateCapturer(OH_AudioStreamBuild OH_AudioStream_Result OH_AudioStreamBuilder_SetFrameSizeInCallback(OH_AudioStreamBuilder* builder, int32_t frameSize); -/* - * Set the callback of writing metadata to the renderer client +/** + * @brief Set the callback of writing metadata to the renderer client * * @since 12 * -- Gitee From d72774a6975ddaee00f10b13d09b19a8c8bab655 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 19 Mar 2024 17:05:35 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/common/native_audiostream_base.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 526ae10cc66..6412fd6f166 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -614,6 +614,7 @@ typedef void (*OH_AudioRenderer_OutputDeviceChangeCallback)(OH_AudioRenderer* re * @param audioDataSize Audio data size which is the size of audio data written by user. * @param metadata Metadata which is written by user. * @param metadataSize Metadata size which is the size of metadata written by user. + * @return Error code of the callback function. * @since 12 */ typedef int32_t (*OH_AudioRenderer_WriteDataWithMetadataCallback)(OH_AudioRenderer* renderer, -- Gitee From 8ed451d369eb2c2e450541c94db1862cee82d04b Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Tue, 19 Mar 2024 17:10:41 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E6=96=B0=E5=A2=9EAudioVivid=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Wang Chongteng --- multimedia/audio_framework/common/native_audiostream_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index 6412fd6f166..5ddbbd5bb61 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -614,7 +614,7 @@ typedef void (*OH_AudioRenderer_OutputDeviceChangeCallback)(OH_AudioRenderer* re * @param audioDataSize Audio data size which is the size of audio data written by user. * @param metadata Metadata which is written by user. * @param metadataSize Metadata size which is the size of metadata written by user. - * @return Error code of the callback function. + * @return Error code of the callback function returned by user. * @since 12 */ typedef int32_t (*OH_AudioRenderer_WriteDataWithMetadataCallback)(OH_AudioRenderer* renderer, -- Gitee