Add extern "C" for the exported header and plugin entry point function 05/296405/5 accepted/tizen/unified/20230731.175315
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 27 Jul 2023 04:24:52 +0000 (13:24 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 27 Jul 2023 08:42:28 +0000 (17:42 +0900)
[Version] 0.0.11
[Issue Type] Cleanup

Change-Id: I82bdba7adbb6c1510352427327756eb3e2e8b85d

include/audio_effect.h
include/audio_effect_interface.h
include/audio_effect_log.h
include/audio_effect_util.h
packaging/libaudio-effect.spec
src/plugin_aec_webrtc.cpp
src/plugin_agc_speex.c
src/plugin_amplify.c
src/plugin_ns_rnnoise.c
src/plugin_ns_srid.c
src/plugin_refcopy.c

index 599160cffeb9d4ec6a75962c9a3efd962b51264e..b89c130b389717abbc62db2a5a747931f62f4186 100644 (file)
 #ifndef __AUDIO_EFFECT_H__
 #define __AUDIO_EFFECT_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stddef.h>
 
 typedef struct audio_effect_interface audio_effect_interface_s;
@@ -57,4 +61,8 @@ int audio_effect_process_reference(audio_effect_s *ae, void *in, void *ref, void
 void audio_effect_destroy(audio_effect_s *ae);
 size_t audio_effect_get_process_framesize(audio_effect_s *ae);
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif // __AUDIO_EFFECT_H__
index 7ea12ed1589a613d0dd9b924abed0d9cbdc67755..ff1407c8a972dacadc60eb0efa199252dcd50999 100644 (file)
 #ifndef __AUDIO_EFFECT_INTERFACE_H__
 #define __AUDIO_EFFECT_INTERFACE_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "audio_effect.h"
 
 typedef void *(*dl_create_t)(int, int, audio_effect_format_e, size_t);
@@ -56,11 +60,15 @@ void audio_effect_interface_free(audio_effect_interface_s *intf);
 
 #define PLUGIN_ENTRY_POINT __audio_effect_plugin_entry_point__
 #define PLUGIN_ENTRY_POINT_DEFINE_FUNC(s) \
-    audio_effect_plugin_info_s *PLUGIN_ENTRY_POINT(void) { return &s; } \
+       audio_effect_plugin_info_s *PLUGIN_ENTRY_POINT(void) { return &s; }
 
 #define PLUGIN_CONVERT_TO_STRING(X) #X
 #define PLUGIN_ENTRY_POINT_CONVERT(X) PLUGIN_CONVERT_TO_STRING(X)
 #define PLUGIN_ENTRY_POINT_STRING PLUGIN_ENTRY_POINT_CONVERT(PLUGIN_ENTRY_POINT)
 
+#ifdef __cplusplus
+}
 #endif
 
+#endif // __AUDIO_EFFECT_INTERFACE_H__
+
index 18ad7230da165e548208ea0092ab716a802d2243..3936f10dc7c898b9f48647014d9191e6d8931426 100644 (file)
 #ifndef __AUDIO_EFFECT_LOG_H__
 #define __AUDIO_EFFECT_LOG_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef USE_DLOG
 #include <dlog.h>
 #ifdef LOG_TAG
@@ -37,4 +41,8 @@
 #define LOG_VERBOSE(...)       { printf(__VA_ARGS__); printf("\n"); }
 #endif
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif // __AUDIO_EFFECT_LOG_H__
index 9286068e90bf543b51ec89a4edaafd971f09e379..cf0f0676c3de3baa65d232f3492c1c70aef8d02a 100644 (file)
 #ifndef __AUDIO_EFFECT_UTIL_H__
 #define __AUDIO_EFFECT_UTIL_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <audio_effect.h>
 
 size_t audio_effect_util_get_sample_size(audio_effect_format_e format);
@@ -30,4 +34,8 @@ void audio_effect_util_convert_float_to_s16le(size_t n, const float *a, short *b
 void audio_effect_util_interleave(const void **src, void *dst, int channels, size_t sample_size, size_t frames);
 void audio_effect_util_deinterleave(const void *src, void **dst, int channels, size_t sample_size, size_t frames);
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif // __AUDIO_EFFECT_UTIL_H__
index 2beb14d31e68126f46f23a1a11b2fa5af585e661..ec9e63a291c85a5d976abf5b63202e8f59b6d7ac 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libaudio-effect
 Summary:    audio effect library
-Version:    0.0.10
+Version:    0.0.11
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 14a37f13b9d71fb7f55c44f34820c1171d296251..86605ac7681636fd8b28da29102fd7efe0fe1944 100644 (file)
 #include <assert.h>
 #include <webrtc/modules/audio_processing/include/audio_processing.h>
 
-extern "C" {
 #include <audio_effect_interface.h>
 #include <audio_effect_util.h>
 #include <audio_effect_log.h>
 
-audio_effect_plugin_info_s *__audio_effect_plugin_entry_point__(void);
-}
-
 #define FIXED_FRAME_SIZE_MSEC 10
 #define CHANNELS_MAX 2
 
@@ -254,5 +250,4 @@ static audio_effect_plugin_info_s aec_webrtc_desc = {
        },
 };
 
-PLUGIN_ENTRY_POINT_DEFINE_FUNC(aec_webrtc_desc);
-
+extern "C" PLUGIN_ENTRY_POINT_DEFINE_FUNC(aec_webrtc_desc);
index 72a85b35e634370451c1915aa58c758e8380094c..2c4f02bbbccbe7690b6ed20fc01230cb8f1612bb 100644 (file)
@@ -102,4 +102,3 @@ static audio_effect_plugin_info_s agc_speex_desc = {
 };
 
 PLUGIN_ENTRY_POINT_DEFINE_FUNC(agc_speex_desc);
-
index fd4533004bb80e134322918baa73357a30c1730c..3f8490ad37ecb5c3f050a189abafdfadcf7f21eb 100644 (file)
@@ -86,4 +86,3 @@ static audio_effect_plugin_info_s amplify_desc = {
 };
 
 PLUGIN_ENTRY_POINT_DEFINE_FUNC(amplify_desc);
-
index 2d8b47ba4f503899264a5bb2b8fbe5750390c28c..9de572d899c402c458374c8418fea646460300be 100644 (file)
@@ -34,8 +34,6 @@ struct userdata {
        float *buffer;
 };
 
-static audio_effect_plugin_info_s ns_rnnoise_desc;
-
 static void *ns_rnnoise_create(int rate, int channels, audio_effect_format_e format, size_t frames)
 {
        struct userdata *u;
@@ -122,4 +120,3 @@ static audio_effect_plugin_info_s ns_rnnoise_desc = {
 };
 
 PLUGIN_ENTRY_POINT_DEFINE_FUNC(ns_rnnoise_desc);
-
index b298b5810147736e431c65878a7a651e40037b9b..3c45f136c2b8fee90addaf1774bf6986ea924da1 100644 (file)
@@ -57,6 +57,7 @@ static void *ns_srid_create(int rate, int channels, audio_effect_format_e format
        /* framesize could be 960 in case of 48K (16K 320) */
        u->frames = (size_t)frame_size;
        u->buffer = (float *)malloc(sizeof(float) * u->frames);
+
        ns_srid_desc.constraint.frames = u->frames;
 
        noise_suppression_set_level(u->handle, NOISE_SUPPRESSION_LEVEL_MID);
@@ -128,4 +129,3 @@ static audio_effect_plugin_info_s ns_srid_desc = {
 };
 
 PLUGIN_ENTRY_POINT_DEFINE_FUNC(ns_srid_desc);
-
index cba495c5d17e8b528392bf7d1844619dfbe03b87..5e5787183a2522b8756e9b220b4ca9ac986abd45 100644 (file)
@@ -96,4 +96,3 @@ static audio_effect_plugin_info_s reference_copy_desc = {
 };
 
 PLUGIN_ENTRY_POINT_DEFINE_FUNC(reference_copy_desc);
-