From 3f6d83a68a2d95905904b3352db677e55363591c Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Thu, 26 Jan 2012 16:25:10 -0800 Subject: Declare more IAudioFlinger methods const This is just documentation, as C++ method const-ness doesn't mean anything for a binder API. Instead, here const means "no side effects". Change-Id: Iaa9cd2fe477db10ae9a40cac4f79f0faa9b4e5e6 --- services/audioflinger/AudioFlinger.cpp | 15 ++++++++------- services/audioflinger/AudioFlinger.h | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'services/audioflinger') diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index f71ba0a..e5f7ad2 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -816,7 +816,7 @@ status_t AudioFlinger::setParameters(int ioHandle, const String8& keyValuePairs) return BAD_VALUE; } -String8 AudioFlinger::getParameters(int ioHandle, const String8& keys) +String8 AudioFlinger::getParameters(int ioHandle, const String8& keys) const { // ALOGV("getParameters() io %d, keys %s, tid %d, calling tid %d", // ioHandle, keys.string(), gettid(), IPCThreadState::self()->getCallingPid()); @@ -846,7 +846,7 @@ String8 AudioFlinger::getParameters(int ioHandle, const String8& keys) return String8(""); } -size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) +size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const { status_t ret = initCheck(); if (ret != NO_ERROR) { @@ -856,7 +856,7 @@ size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t form return mPrimaryHardwareDev->get_input_buffer_size(mPrimaryHardwareDev, sampleRate, format, channelCount); } -unsigned int AudioFlinger::getInputFramesLost(int ioHandle) +unsigned int AudioFlinger::getInputFramesLost(int ioHandle) const { if (ioHandle == 0) { return 0; @@ -891,7 +891,7 @@ status_t AudioFlinger::setVoiceVolume(float value) return ret; } -status_t AudioFlinger::getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) +status_t AudioFlinger::getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) const { status_t status; @@ -5413,19 +5413,20 @@ uint32_t AudioFlinger::primaryOutputDevice_l() // ---------------------------------------------------------------------------- -status_t AudioFlinger::queryNumberEffects(uint32_t *numEffects) +status_t AudioFlinger::queryNumberEffects(uint32_t *numEffects) const { Mutex::Autolock _l(mLock); return EffectQueryNumberEffects(numEffects); } -status_t AudioFlinger::queryEffect(uint32_t index, effect_descriptor_t *descriptor) +status_t AudioFlinger::queryEffect(uint32_t index, effect_descriptor_t *descriptor) const { Mutex::Autolock _l(mLock); return EffectQueryEffect(index, descriptor); } -status_t AudioFlinger::getEffectDescriptor(effect_uuid_t *pUuid, effect_descriptor_t *descriptor) +status_t AudioFlinger::getEffectDescriptor(effect_uuid_t *pUuid, + effect_descriptor_t *descriptor) const { Mutex::Autolock _l(mLock); return EffectGetDescriptor(pUuid, descriptor); diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 3f3188c..4db7f15 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -105,12 +105,12 @@ public: virtual bool getMicMute() const; virtual status_t setParameters(int ioHandle, const String8& keyValuePairs); - virtual String8 getParameters(int ioHandle, const String8& keys); + virtual String8 getParameters(int ioHandle, const String8& keys) const; virtual void registerClient(const sp& client); - virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount); - virtual unsigned int getInputFramesLost(int ioHandle); + virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const; + virtual unsigned int getInputFramesLost(int ioHandle) const; virtual int openOutput(uint32_t *pDevices, uint32_t *pSamplingRate, @@ -139,7 +139,7 @@ public: virtual status_t setVoiceVolume(float volume); - virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output); + virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) const; virtual int newAudioSessionId(); @@ -147,11 +147,12 @@ public: virtual void releaseAudioSessionId(int audioSession); - virtual status_t queryNumberEffects(uint32_t *numEffects); + virtual status_t queryNumberEffects(uint32_t *numEffects) const; - virtual status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor); + virtual status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor) const; - virtual status_t getEffectDescriptor(effect_uuid_t *pUuid, effect_descriptor_t *descriptor); + virtual status_t getEffectDescriptor(effect_uuid_t *pUuid, + effect_descriptor_t *descriptor) const; virtual sp createEffect(pid_t pid, effect_descriptor_t *pDesc, -- cgit v1.1