AudioFlinger methods const and inline
This saves 1063 bytes and probably improves performance.
Change-Id: I11cf0dfd925fbaec75e3d1b806852a538eae5518
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index f71ba0a..fdf1570 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1027,26 +1027,6 @@
requestExitAndWait();
}
-uint32_t AudioFlinger::ThreadBase::sampleRate() const
-{
- return mSampleRate;
-}
-
-int AudioFlinger::ThreadBase::channelCount() const
-{
- return (int)mChannelCount;
-}
-
-audio_format_t AudioFlinger::ThreadBase::format() const
-{
- return mFormat;
-}
-
-size_t AudioFlinger::ThreadBase::frameCount() const
-{
- return mFrameCount;
-}
-
status_t AudioFlinger::ThreadBase::setParameters(const String8& keyValuePairs)
{
status_t status;
@@ -1611,16 +1591,6 @@
return NO_ERROR;
}
-float AudioFlinger::PlaybackThread::masterVolume() const
-{
- return mMasterVolume;
-}
-
-bool AudioFlinger::PlaybackThread::masterMute() const
-{
- return mMasterMute;
-}
-
status_t AudioFlinger::PlaybackThread::setStreamVolume(audio_stream_type_t stream, float value)
{
mStreamTypes[stream].volume = value;
@@ -3368,23 +3338,10 @@
ALOGV("TrackBase::reset");
}
-sp<IMemory> AudioFlinger::ThreadBase::TrackBase::getCblk() const
-{
- return mCblkMemory;
-}
-
int AudioFlinger::ThreadBase::TrackBase::sampleRate() const {
return (int)mCblk->sampleRate;
}
-int AudioFlinger::ThreadBase::TrackBase::channelCount() const {
- return (const int)mChannelCount;
-}
-
-uint32_t AudioFlinger::ThreadBase::TrackBase::channelMask() const {
- return mChannelMask;
-}
-
void* AudioFlinger::ThreadBase::TrackBase::getBuffer(uint32_t offset, uint32_t frames) const {
audio_track_cblk_t* cblk = this->cblk();
size_t frameSize = cblk->frameSize;
@@ -6622,7 +6579,7 @@
return NO_ERROR;
}
-bool AudioFlinger::EffectModule::isEnabled()
+bool AudioFlinger::EffectModule::isEnabled() const
{
switch (mState) {
case RESTART:
@@ -6638,7 +6595,7 @@
}
}
-bool AudioFlinger::EffectModule::isProcessEnabled()
+bool AudioFlinger::EffectModule::isProcessEnabled() const
{
switch (mState) {
case RESTART:
@@ -7054,10 +7011,6 @@
return mEffect->command(cmdCode, cmdSize, pCmdData, replySize, pReplyData);
}
-sp<IMemory> AudioFlinger::EffectHandle::getCblk() const {
- return mCblkMemory;
-}
-
void AudioFlinger::EffectHandle::setControl(bool hasControl, bool signal, bool enabled)
{
ALOGV("setControl %p control %d", this, hasControl);