diff options
author | Eric Laurent <elaurent@google.com> | 2009-07-28 08:44:33 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2009-08-07 00:27:19 -0700 |
commit | ddb78e7753be03937ad57ce7c3c842c52bdad65e (patch) | |
tree | a1f4d8105448525973897933a3494dd4d439274c /include | |
parent | 4c35e2c59afa28f9ed3fab1788570ef933f29b1a (diff) | |
download | frameworks_base-ddb78e7753be03937ad57ce7c3c842c52bdad65e.zip frameworks_base-ddb78e7753be03937ad57ce7c3c842c52bdad65e.tar.gz frameworks_base-ddb78e7753be03937ad57ce7c3c842c52bdad65e.tar.bz2 |
Fix issue 2001214: AudioFlinger and AudioPolicyService interfaces should not use pointers as handles to inputs and outputs.
Use integers instead of void* as input/output handles at IAudioFlinger and IAudioPolicyService interfaces.
AudioFlinger maintains an always increasing count of opened inputs or outputs as unique ID.
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioSystem.h | 8 | ||||
-rw-r--r-- | include/media/IAudioFlinger.h | 38 | ||||
-rw-r--r-- | include/media/IAudioFlingerClient.h | 2 |
3 files changed, 24 insertions, 24 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index 1243502..1f726fe 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -24,7 +24,7 @@ namespace android { typedef void (*audio_error_callback)(status_t err); -typedef void * audio_io_handle_t; +typedef int audio_io_handle_t; class IAudioPolicyService; class String8; @@ -184,8 +184,8 @@ public: static status_t getMasterMute(bool* mute); // set/get stream volume on specified output - static status_t setStreamVolume(int stream, float value, void *output); - static status_t getStreamVolume(int stream, float* volume, void *output); + static status_t setStreamVolume(int stream, float value, int output); + static status_t getStreamVolume(int stream, float* volume, int output); // mute/unmute stream static status_t setStreamMute(int stream, bool mute); @@ -383,7 +383,7 @@ private: // indicate a change in the configuration of an output or input: keeps the cached // values for output/input parameters upto date in client process - virtual void ioConfigChanged(int event, void *param1, void *param2); + virtual void ioConfigChanged(int event, int ioHandle, void *param2); }; class AudioPolicyServiceClient: public IBinder::DeathRecipient diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h index 26e6972..8018568 100644 --- a/include/media/IAudioFlinger.h +++ b/include/media/IAudioFlinger.h @@ -50,12 +50,12 @@ public: int frameCount, uint32_t flags, const sp<IMemory>& sharedBuffer, - void *output, + int output, status_t *status) = 0; virtual sp<IAudioRecord> openRecord( pid_t pid, - void *input, + int input, uint32_t sampleRate, int format, int channelCount, @@ -66,11 +66,11 @@ public: /* query the audio hardware state. This state never changes, * and therefore can be cached. */ - virtual uint32_t sampleRate(void *output) const = 0; - virtual int channelCount(void *output) const = 0; - virtual int format(void *output) const = 0; - virtual size_t frameCount(void *output) const = 0; - virtual uint32_t latency(void *output) const = 0; + virtual uint32_t sampleRate(int output) const = 0; + virtual int channelCount(int output) const = 0; + virtual int format(int output) const = 0; + virtual size_t frameCount(int output) const = 0; + virtual uint32_t latency(int output) const = 0; /* set/get the audio hardware state. This will probably be used by * the preference panel, mostly. @@ -84,10 +84,10 @@ public: /* set/get stream type state. This will probably be used by * the preference panel, mostly. */ - virtual status_t setStreamVolume(int stream, float value, void *output) = 0; + virtual status_t setStreamVolume(int stream, float value, int output) = 0; virtual status_t setStreamMute(int stream, bool muted) = 0; - virtual float streamVolume(int stream, void *output) const = 0; + virtual float streamVolume(int stream, int output) const = 0; virtual bool streamMute(int stream) const = 0; // set audio mode @@ -100,8 +100,8 @@ public: // is a music stream active? virtual bool isMusicActive() const = 0; - virtual status_t setParameters(void *ioHandle, const String8& keyValuePairs) = 0; - virtual String8 getParameters(void *ioHandle, const String8& keys) = 0; + virtual status_t setParameters(int ioHandle, const String8& keyValuePairs) = 0; + virtual String8 getParameters(int ioHandle, const String8& keys) = 0; // register a current process for audio output change notifications virtual void registerClient(const sp<IAudioFlingerClient>& client) = 0; @@ -109,25 +109,25 @@ public: // retrieve the audio recording buffer size virtual size_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount) = 0; - virtual void *openOutput(uint32_t *pDevices, + virtual int openOutput(uint32_t *pDevices, uint32_t *pSamplingRate, uint32_t *pFormat, uint32_t *pChannels, uint32_t *pLatencyMs, uint32_t flags) = 0; - virtual void *openDuplicateOutput(void *output1, void *output2) = 0; - virtual status_t closeOutput(void *output) = 0; - virtual status_t suspendOutput(void *output) = 0; - virtual status_t restoreOutput(void *output) = 0; + virtual int openDuplicateOutput(int output1, int output2) = 0; + virtual status_t closeOutput(int output) = 0; + virtual status_t suspendOutput(int output) = 0; + virtual status_t restoreOutput(int output) = 0; - virtual void *openInput(uint32_t *pDevices, + virtual int openInput(uint32_t *pDevices, uint32_t *pSamplingRate, uint32_t *pFormat, uint32_t *pChannels, uint32_t acoustics) = 0; - virtual status_t closeInput(void *input) = 0; + virtual status_t closeInput(int input) = 0; - virtual status_t setStreamOutput(uint32_t stream, void *output) = 0; + virtual status_t setStreamOutput(uint32_t stream, int output) = 0; }; diff --git a/include/media/IAudioFlingerClient.h b/include/media/IAudioFlingerClient.h index 78142ce..aa0cdcf 100644 --- a/include/media/IAudioFlingerClient.h +++ b/include/media/IAudioFlingerClient.h @@ -32,7 +32,7 @@ public: DECLARE_META_INTERFACE(AudioFlingerClient); // Notifies a change of audio input/output configuration. - virtual void ioConfigChanged(int event, void *param1, void *param2) = 0; + virtual void ioConfigChanged(int event, int ioHandle, void *param2) = 0; }; |