OSDN Git Service

Don't export DSO symbols from camera mio and audio mio for authoring.
authorJames Dong <jdong@google.com>
Wed, 10 Jun 2009 01:45:16 +0000 (18:45 -0700)
committerJames Dong <jdong@google.com>
Wed, 10 Jun 2009 19:00:50 +0000 (12:00 -0700)
The code size reduction is about 12 k for libopencore_author.so.

android/author/Android.mk
android/author/android_audio_input.h
android/author/android_camera_input.h

index 0df9dbd..260c357 100644 (file)
@@ -1,6 +1,9 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
+# don't export mio symbols
+LOCAL_CFLAGS += -DHIDE_MIO_SYMBOLS
+
 LOCAL_SRC_FILES := \
     authordriver.cpp \
     PVMediaRecorder.cpp \
index a5a21bd..ad1af24 100644 (file)
 
 #include <utils/RefBase.h>
 
+#ifdef HIDE_MIO_SYMBOLS
+#pragma GCC visibility push(hidden)
+#endif
+
 namespace android {
 
 static const int32 DEFAULT_AUDIO_NUMBER_OF_CHANNELS = 1;
@@ -209,72 +213,72 @@ public:
     virtual ~AndroidAudioInput();
 
     // Pure virtuals from PvmiMIOControl
-    OSCL_IMPORT_REF PVMFStatus connect(PvmiMIOSession& aSession, PvmiMIOObserver* aObserver);
-    OSCL_IMPORT_REF PVMFStatus disconnect(PvmiMIOSession aSession);
-    OSCL_IMPORT_REF PvmiMediaTransfer* createMediaTransfer(PvmiMIOSession& aSession,
+    PVMFStatus connect(PvmiMIOSession& aSession, PvmiMIOObserver* aObserver);
+    PVMFStatus disconnect(PvmiMIOSession aSession);
+    PvmiMediaTransfer* createMediaTransfer(PvmiMIOSession& aSession,
                                                          PvmiKvp* read_formats=NULL,
                                                          int32 read_flags=0,
                                                          PvmiKvp* write_formats=NULL,
                                                          int32 write_flags=0);
-    OSCL_IMPORT_REF void deleteMediaTransfer(PvmiMIOSession& aSession,
+    void deleteMediaTransfer(PvmiMIOSession& aSession,
                                            PvmiMediaTransfer* media_transfer);
-    OSCL_IMPORT_REF PVMFCommandId QueryUUID(const PvmfMimeString& aMimeType,
+    PVMFCommandId QueryUUID(const PvmfMimeString& aMimeType,
                                           Oscl_Vector<PVUuid, OsclMemAllocator>& aUuids,
                                           bool aExactUuidsOnly=false,
                                           const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId QueryInterface(const PVUuid& aUuid,
+    PVMFCommandId QueryInterface(const PVUuid& aUuid,
                                                PVInterface*& aInterfacePtr,
                                                const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Init(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Start(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Reset(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Pause(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Flush(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId DiscardData(PVMFTimestamp aTimestamp, const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId DiscardData(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Stop(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId CancelCommand(PVMFCommandId aCmdId, const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId CancelAllCommands(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF void ThreadLogon();
-    OSCL_IMPORT_REF void ThreadLogoff();
+    PVMFCommandId Init(const OsclAny* aContext=NULL);
+    PVMFCommandId Start(const OsclAny* aContext=NULL);
+    PVMFCommandId Reset(const OsclAny* aContext=NULL);
+    PVMFCommandId Pause(const OsclAny* aContext=NULL);
+    PVMFCommandId Flush(const OsclAny* aContext=NULL);
+    PVMFCommandId DiscardData(PVMFTimestamp aTimestamp, const OsclAny* aContext=NULL);
+    PVMFCommandId DiscardData(const OsclAny* aContext=NULL);
+    PVMFCommandId Stop(const OsclAny* aContext=NULL);
+    PVMFCommandId CancelCommand(PVMFCommandId aCmdId, const OsclAny* aContext=NULL);
+    PVMFCommandId CancelAllCommands(const OsclAny* aContext=NULL);
+    void ThreadLogon();
+    void ThreadLogoff();
 
     // Pure virtuals from PvmiMediaTransfer
-    OSCL_IMPORT_REF void setPeer(PvmiMediaTransfer* aPeer);
-    OSCL_IMPORT_REF void useMemoryAllocators(OsclMemAllocator* write_alloc=NULL);
-    OSCL_IMPORT_REF PVMFCommandId writeAsync(uint8 format_type, int32 format_index,
+    void setPeer(PvmiMediaTransfer* aPeer);
+    void useMemoryAllocators(OsclMemAllocator* write_alloc=NULL);
+    PVMFCommandId writeAsync(uint8 format_type, int32 format_index,
                                            uint8* data, uint32 data_len,
                                            const PvmiMediaXferHeader& data_header_info,
                                            OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF void writeComplete(PVMFStatus aStatus, PVMFCommandId write_cmd_id,
+    void writeComplete(PVMFStatus aStatus, PVMFCommandId write_cmd_id,
                                      OsclAny* aContext);
-    OSCL_IMPORT_REF PVMFCommandId readAsync(uint8* data, uint32 max_data_len, OsclAny* aContext=NULL,
+    PVMFCommandId readAsync(uint8* data, uint32 max_data_len, OsclAny* aContext=NULL,
                                           int32* formats=NULL, uint16 num_formats=0);
-    OSCL_IMPORT_REF void readComplete(PVMFStatus aStatus, PVMFCommandId read_cmd_id,
+    void readComplete(PVMFStatus aStatus, PVMFCommandId read_cmd_id,
                                     int32 format_index,
                                     const PvmiMediaXferHeader& data_header_info,
                                     OsclAny* aContext);
-    OSCL_IMPORT_REF void statusUpdate(uint32 status_flags);
-    OSCL_IMPORT_REF void cancelCommand(PVMFCommandId aCmdId);
-    OSCL_IMPORT_REF void cancelAllCommands();
+    void statusUpdate(uint32 status_flags);
+    void cancelCommand(PVMFCommandId aCmdId);
+    void cancelAllCommands();
 
     // Pure virtuals from PvmiCapabilityAndConfig
-    OSCL_IMPORT_REF void setObserver (PvmiConfigAndCapabilityCmdObserver* aObserver);
-    OSCL_IMPORT_REF PVMFStatus getParametersSync(PvmiMIOSession aSession, PvmiKeyType aIdentifier,
+    void setObserver (PvmiConfigAndCapabilityCmdObserver* aObserver);
+    PVMFStatus getParametersSync(PvmiMIOSession aSession, PvmiKeyType aIdentifier,
                                                PvmiKvp*& aParameters, int& num_parameter_elements,
                                                PvmiCapabilityContext aContext);
-    OSCL_IMPORT_REF PVMFStatus releaseParameters(PvmiMIOSession aSession, PvmiKvp* aParameters,
+    PVMFStatus releaseParameters(PvmiMIOSession aSession, PvmiKvp* aParameters,
                                                int num_elements);
-    OSCL_IMPORT_REF void createContext(PvmiMIOSession aSession, PvmiCapabilityContext& aContext);
-    OSCL_IMPORT_REF void setContextParameters(PvmiMIOSession aSession, PvmiCapabilityContext& aContext,
+    void createContext(PvmiMIOSession aSession, PvmiCapabilityContext& aContext);
+    void setContextParameters(PvmiMIOSession aSession, PvmiCapabilityContext& aContext,
                                             PvmiKvp* aParameters, int num_parameter_elements);
-    OSCL_IMPORT_REF void DeleteContext(PvmiMIOSession aSession, PvmiCapabilityContext& aContext);
-    OSCL_IMPORT_REF void setParametersSync(PvmiMIOSession aSession, PvmiKvp* aParameters,
+    void DeleteContext(PvmiMIOSession aSession, PvmiCapabilityContext& aContext);
+    void setParametersSync(PvmiMIOSession aSession, PvmiKvp* aParameters,
                                          int num_elements, PvmiKvp * & aRet_kvp);
-    OSCL_IMPORT_REF PVMFCommandId setParametersAsync(PvmiMIOSession aSession, PvmiKvp* aParameters,
+    PVMFCommandId setParametersAsync(PvmiMIOSession aSession, PvmiKvp* aParameters,
                                                    int num_elements, PvmiKvp*& aRet_kvp,
                                                    OsclAny* context=NULL);
-    OSCL_IMPORT_REF uint32 getCapabilityMetric (PvmiMIOSession aSession);
-    OSCL_IMPORT_REF PVMFStatus verifyParametersSync (PvmiMIOSession aSession,
+    uint32 getCapabilityMetric (PvmiMIOSession aSession);
+    PVMFStatus verifyParametersSync (PvmiMIOSession aSession,
                                                    PvmiKvp* aParameters, int num_elements);
 
     // Android-specific stuff
@@ -285,10 +289,10 @@ public:
     int maxAmplitude();
 
     /* Sets the input sampling rate */
-    OSCL_IMPORT_REF bool setAudioSamplingRate(int32 iSamplingRate);
+    bool setAudioSamplingRate(int32 iSamplingRate);
 
     /* Set the input number of channels */
-    OSCL_IMPORT_REF bool setAudioNumChannels(int32 iNumChannels);
+    bool setAudioNumChannels(int32 iNumChannels);
 
 private:
     AndroidAudioInput();
@@ -444,4 +448,8 @@ private:
 
 }; // namespace android
 
+#ifdef HIDE_MIO_SYMBOLS
+#pragma GCC visibility pop
+#endif
+
 #endif // ANDROID_AUDIO_INPUT_H_INCLUDED
index 6fb9717..ab449b7 100644 (file)
 #include "pvmf_simple_media_buffer.h"
 #endif
 
+#ifdef HIDE_MIO_SYMBOLS
+#pragma GCC visibility push(hidden)
+#endif
+
 using namespace android;
 
 class ISurface;
@@ -176,110 +180,110 @@ public:
     virtual ~AndroidCameraInput();
 
     // Pure virtuals from PvmiMIOControl
-    OSCL_IMPORT_REF PVMFStatus connect(PvmiMIOSession& aSession,
+    PVMFStatus connect(PvmiMIOSession& aSession,
         PvmiMIOObserver* aObserver);
 
-    OSCL_IMPORT_REF PVMFStatus disconnect(PvmiMIOSession aSession);
-    OSCL_IMPORT_REF PvmiMediaTransfer* createMediaTransfer(PvmiMIOSession& aSession,
+    PVMFStatus disconnect(PvmiMIOSession aSession);
+    PvmiMediaTransfer* createMediaTransfer(PvmiMIOSession& aSession,
         PvmiKvp* read_formats = NULL,
         int32 read_flags = 0,
         PvmiKvp* write_formats = NULL,
         int32 write_flags = 0);
 
-    OSCL_IMPORT_REF void deleteMediaTransfer(PvmiMIOSession& aSession,
+    void deleteMediaTransfer(PvmiMIOSession& aSession,
                                              PvmiMediaTransfer* media_transfer);
     
-    OSCL_IMPORT_REF PVMFCommandId QueryUUID(const PvmfMimeString& aMimeType,
+    PVMFCommandId QueryUUID(const PvmfMimeString& aMimeType,
         Oscl_Vector<PVUuid, OsclMemAllocator>& aUuids,
         bool aExactUuidsOnly = false,
         const OsclAny* aContext = NULL);
 
-    OSCL_IMPORT_REF PVMFCommandId QueryInterface(const PVUuid& aUuid,
+    PVMFCommandId QueryInterface(const PVUuid& aUuid,
         PVInterface*& aInterfacePtr,
         const OsclAny* aContext = NULL);
 
-    OSCL_IMPORT_REF PVMFCommandId Init(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Start(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Reset(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Pause(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId Flush(const OsclAny* aContext=NULL);
-    OSCL_IMPORT_REF PVMFCommandId DiscardData(PVMFTimestamp aTimestamp,
+    PVMFCommandId Init(const OsclAny* aContext=NULL);
+    PVMFCommandId Start(const OsclAny* aContext=NULL);
+    PVMFCommandId Reset(const OsclAny* aContext=NULL);
+    PVMFCommandId Pause(const OsclAny* aContext=NULL);
+    PVMFCommandId Flush(const OsclAny* aContext=NULL);
+    PVMFCommandId DiscardData(PVMFTimestamp aTimestamp,
         const OsclAny* aContext=NULL);
 
-    OSCL_IMPORT_REF PVMFCommandId DiscardData(const OsclAny* aContext = NULL);
-    OSCL_IMPORT_REF PVMFCommandId Stop(const OsclAny* aContext = NULL);
-    OSCL_IMPORT_REF PVMFCommandId CancelCommand(PVMFCommandId aCmdId,
+    PVMFCommandId DiscardData(const OsclAny* aContext = NULL);
+    PVMFCommandId Stop(const OsclAny* aContext = NULL);
+    PVMFCommandId CancelCommand(PVMFCommandId aCmdId,
         const OsclAny* aContext=NULL);
 
-    OSCL_IMPORT_REF PVMFCommandId CancelAllCommands(const OsclAny* aContext = NULL);
-    OSCL_IMPORT_REF void ThreadLogon();
-    OSCL_IMPORT_REF void ThreadLogoff();
+    PVMFCommandId CancelAllCommands(const OsclAny* aContext = NULL);
+    void ThreadLogon();
+    void ThreadLogoff();
 
     // Pure virtuals from PvmiMediaTransfer
-    OSCL_IMPORT_REF void setPeer(PvmiMediaTransfer* aPeer);
-    OSCL_IMPORT_REF void useMemoryAllocators(OsclMemAllocator* write_alloc = NULL);
-    OSCL_IMPORT_REF PVMFCommandId writeAsync(uint8 format_type,
+    void setPeer(PvmiMediaTransfer* aPeer);
+    void useMemoryAllocators(OsclMemAllocator* write_alloc = NULL);
+    PVMFCommandId writeAsync(uint8 format_type,
         int32 format_index,
         uint8* data,
         uint32 data_len,
         const PvmiMediaXferHeader& data_header_info,
         OsclAny* aContext = NULL);
 
-    OSCL_IMPORT_REF void writeComplete(PVMFStatus aStatus,
+    void writeComplete(PVMFStatus aStatus,
         PVMFCommandId write_cmd_id,
         OsclAny* aContext);
 
-    OSCL_IMPORT_REF PVMFCommandId readAsync(uint8* data,
+    PVMFCommandId readAsync(uint8* data,
         uint32 max_data_len,
         OsclAny* aContext = NULL,
         int32* formats = NULL,
         uint16 num_formats = 0);
 
-    OSCL_IMPORT_REF void readComplete(PVMFStatus aStatus,
+    void readComplete(PVMFStatus aStatus,
         PVMFCommandId read_cmd_id,
         int32 format_index,
         const PvmiMediaXferHeader& data_header_info,
         OsclAny* aContext);
 
-    OSCL_IMPORT_REF void statusUpdate(uint32 status_flags);
-    OSCL_IMPORT_REF void cancelCommand(PVMFCommandId aCmdId);
-    OSCL_IMPORT_REF void cancelAllCommands();
+    void statusUpdate(uint32 status_flags);
+    void cancelCommand(PVMFCommandId aCmdId);
+    void cancelAllCommands();
 
     // Pure virtuals from PvmiCapabilityAndConfig
-    OSCL_IMPORT_REF void setObserver (PvmiConfigAndCapabilityCmdObserver* aObserver);
-    OSCL_IMPORT_REF PVMFStatus getParametersSync(PvmiMIOSession aSession,
+    void setObserver (PvmiConfigAndCapabilityCmdObserver* aObserver);
+    PVMFStatus getParametersSync(PvmiMIOSession aSession,
         PvmiKeyType aIdentifier,
         PvmiKvp*& aParameters, int& num_parameter_elements,
         PvmiCapabilityContext aContext);
 
-    OSCL_IMPORT_REF PVMFStatus releaseParameters(PvmiMIOSession aSession,
+    PVMFStatus releaseParameters(PvmiMIOSession aSession,
         PvmiKvp* aParameters,
         int num_elements);
 
-    OSCL_IMPORT_REF void createContext(PvmiMIOSession aSession,
+    void createContext(PvmiMIOSession aSession,
         PvmiCapabilityContext& aContext);
 
-    OSCL_IMPORT_REF void setContextParameters(PvmiMIOSession aSession,
+    void setContextParameters(PvmiMIOSession aSession,
         PvmiCapabilityContext& aContext,
         PvmiKvp* aParameters,
         int num_parameter_elements);
 
-    OSCL_IMPORT_REF void DeleteContext(PvmiMIOSession aSession,
+    void DeleteContext(PvmiMIOSession aSession,
         PvmiCapabilityContext& aContext);
 
-    OSCL_IMPORT_REF void setParametersSync(PvmiMIOSession aSession,
+    void setParametersSync(PvmiMIOSession aSession,
         PvmiKvp* aParameters,
         int num_elements,
         PvmiKvp * & aRet_kvp);
 
-    OSCL_IMPORT_REF PVMFCommandId setParametersAsync(PvmiMIOSession aSession,
+    PVMFCommandId setParametersAsync(PvmiMIOSession aSession,
         PvmiKvp* aParameters,
         int num_elements,
         PvmiKvp*& aRet_kvp,
         OsclAny* context = NULL);
 
-    OSCL_IMPORT_REF uint32 getCapabilityMetric (PvmiMIOSession aSession);
-    OSCL_IMPORT_REF PVMFStatus verifyParametersSync (PvmiMIOSession aSession,
+    uint32 getCapabilityMetric (PvmiMIOSession aSession);
+    PVMFStatus verifyParametersSync (PvmiMIOSession aSession,
         PvmiKvp* aParameters,
         int num_elements);
 
@@ -402,4 +406,8 @@ private:
 
 };
 
+#ifdef HIDE_MIO_SYMBOLS
+#pragma GCC visibility pop
+#endif
+
 #endif // ANDROID_CAMERA_INPUT_H_INCLUDED