Effects factory: Restrict visibility to public functions
The next patches will split EffectFactory.c in several files,
thus symbols with internal linkage (static) will be exposed to other
libraries.
To avoid that only export the symbols that are supposed to be public.
Test: Link and boot
Bug: 37492580
Change-Id: Ice2b11b0bc868591a1e17c658ecf26d82cffdaa4
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/media/libeffects/factory/Android.bp b/media/libeffects/factory/Android.bp
index 16680bd..fe01781 100644
--- a/media/libeffects/factory/Android.bp
+++ b/media/libeffects/factory/Android.bp
@@ -17,6 +17,7 @@
"liblog",
"libdl",
],
+ cflags: ["-fvisibility=hidden"],
include_dirs: ["system/media/audio_effects/include"],
diff --git a/media/libeffects/factory/EffectsFactory.c b/media/libeffects/factory/EffectsFactory.c
index 37c0bb7..0dcc358 100644
--- a/media/libeffects/factory/EffectsFactory.c
+++ b/media/libeffects/factory/EffectsFactory.c
@@ -29,6 +29,7 @@
#include <cutils/properties.h>
#include <log/log.h>
+#include <media/EffectsFactoryApi.h>
#include <system/audio_effects/audio_effects_conf.h>
static list_elem_t *gEffectList; // list of effect_entry_t: all currently created effects
diff --git a/media/libeffects/factory/EffectsFactory.h b/media/libeffects/factory/EffectsFactory.h
index 72e0931..cdba362 100644
--- a/media/libeffects/factory/EffectsFactory.h
+++ b/media/libeffects/factory/EffectsFactory.h
@@ -21,6 +21,7 @@
#include <pthread.h>
#include <android/log.h>
+#include <cutils/compiler.h>
#include <hardware/audio_effect.h>
#if __cplusplus
@@ -96,6 +97,7 @@
// *pDescriptor: updated with the sub effect descriptors.
//
////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
int EffectGetSubEffects(const effect_uuid_t *pEffectUuid,
sub_effect_entry_t **pSube,
size_t size);
diff --git a/media/libeffects/factory/include/media/EffectsFactoryApi.h b/media/libeffects/factory/include/media/EffectsFactoryApi.h
index 64a3212..a5a12eb 100644
--- a/media/libeffects/factory/include/media/EffectsFactoryApi.h
+++ b/media/libeffects/factory/include/media/EffectsFactoryApi.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_EFFECTSFACTORYAPI_H_
#define ANDROID_EFFECTSFACTORYAPI_H_
+#include <cutils/compiler.h>
#include <errno.h>
#include <stdint.h>
#include <sys/types.h>
@@ -52,6 +53,7 @@
// *pNumEffects: updated with number of effects in factory
//
////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
int EffectQueryNumberEffects(uint32_t *pNumEffects);
////////////////////////////////////////////////////////////////////////////////
@@ -79,6 +81,7 @@
// *pDescriptor: updated with the effect descriptor.
//
////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
int EffectQueryEffect(uint32_t index, effect_descriptor_t *pDescriptor);
////////////////////////////////////////////////////////////////////////////////
@@ -110,6 +113,7 @@
// *pHandle: updated with the effect handle.
//
////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
int EffectCreate(const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId,
effect_handle_t *pHandle);
@@ -130,6 +134,7 @@
// -EINVAL invalid interface handle
//
////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
int EffectRelease(effect_handle_t handle);
////////////////////////////////////////////////////////////////////////////////
@@ -153,6 +158,7 @@
// *pDescriptor: updated with the effect descriptor.
//
////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
int EffectGetDescriptor(const effect_uuid_t *pEffectUuid, effect_descriptor_t *pDescriptor);
////////////////////////////////////////////////////////////////////////////////
@@ -169,8 +175,10 @@
// 1 if uuid is equal to EFFECT_UUID_NULL.
//
////////////////////////////////////////////////////////////////////////////////
+ANDROID_API
int EffectIsNullUuid(const effect_uuid_t *pEffectUuid);
+ANDROID_API
int EffectDumpEffects(int fd);
#if __cplusplus