summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-30 14:54:39 -0800
committerGlenn Kasten <gkasten@google.com>2012-02-03 14:42:43 -0800
commitc19e22450e6e3d07594c935c7a9522e85e909e82 (patch)
tree2a81eb366d10425b83b6bbf9997d9c8813515ea1 /services/audioflinger
parent787bae0578fbaab6219ebf23494866b224d01438 (diff)
downloadframeworks_av-c19e22450e6e3d07594c935c7a9522e85e909e82.zip
frameworks_av-c19e22450e6e3d07594c935c7a9522e85e909e82.tar.gz
frameworks_av-c19e22450e6e3d07594c935c7a9522e85e909e82.tar.bz2
Use virtual destructors
It turns out to be just a comment, as all except AudioMixer are RefBase. There are only a few performance-sensitive cases where it's worth thinking about whether you need a virtual destructor, and the headache usually outweighs the benefit. Change-Id: I716292f9556ec17c29ce8c76ac8ae602cb496533
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/AudioFlinger.h18
-rw-r--r--services/audioflinger/AudioMixer.h2
-rw-r--r--services/audioflinger/AudioResamplerSinc.h2
3 files changed, 11 insertions, 11 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 3f3188c..1a1a686 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -322,7 +322,7 @@ private:
uint32_t flags,
const sp<IMemory>& sharedBuffer,
int sessionId);
- ~TrackBase();
+ virtual ~TrackBase();
virtual status_t start() = 0;
virtual void stop() = 0;
@@ -581,7 +581,7 @@ private:
int frameCount,
const sp<IMemory>& sharedBuffer,
int sessionId);
- ~Track();
+ virtual ~Track();
void dump(char* buffer, size_t size);
virtual status_t start();
@@ -664,7 +664,7 @@ private:
audio_format_t format,
uint32_t channelMask,
int frameCount);
- ~OutputTrack();
+ virtual ~OutputTrack();
virtual status_t start();
virtual void stop();
@@ -845,7 +845,7 @@ private:
public:
DirectOutputThread (const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, int id, uint32_t device);
- ~DirectOutputThread();
+ virtual ~DirectOutputThread();
// Thread virtuals
virtual bool threadLoop();
@@ -871,7 +871,7 @@ private:
class DuplicatingThread : public MixerThread {
public:
DuplicatingThread (const sp<AudioFlinger>& audioFlinger, MixerThread* mainThread, int id);
- ~DuplicatingThread();
+ virtual ~DuplicatingThread();
// Thread virtuals
virtual bool threadLoop();
@@ -946,7 +946,7 @@ private:
int frameCount,
uint32_t flags,
int sessionId);
- ~RecordTrack();
+ virtual ~RecordTrack();
virtual status_t start();
virtual void stop();
@@ -975,7 +975,7 @@ private:
uint32_t channels,
int id,
uint32_t device);
- ~RecordThread();
+ virtual ~RecordThread();
virtual bool threadLoop();
virtual status_t readyToRun();
@@ -1064,7 +1064,7 @@ private:
effect_descriptor_t *desc,
int id,
int sessionId);
- ~EffectModule();
+ virtual ~EffectModule();
enum effect_state {
IDLE,
@@ -1241,7 +1241,7 @@ mutable Mutex mLock; // mutex for process, commands and handl
class EffectChain: public RefBase {
public:
EffectChain(const wp<ThreadBase>& wThread, int sessionId);
- ~EffectChain();
+ virtual ~EffectChain();
// special key used for an entry in mSuspendedEffects keyed vector
// corresponding to a suspend all request.
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 84f6330..40a508e 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -33,7 +33,7 @@ class AudioMixer
public:
AudioMixer(size_t frameCount, uint32_t sampleRate);
- ~AudioMixer();
+ /*virtual*/ ~AudioMixer(); // non-virtual saves a v-table, restore if sub-classed
static const uint32_t MAX_NUM_TRACKS = 32;
static const uint32_t MAX_NUM_CHANNELS = 2;
diff --git a/services/audioflinger/AudioResamplerSinc.h b/services/audioflinger/AudioResamplerSinc.h
index 0e1bc44..f0a07b8 100644
--- a/services/audioflinger/AudioResamplerSinc.h
+++ b/services/audioflinger/AudioResamplerSinc.h
@@ -31,7 +31,7 @@ class AudioResamplerSinc : public AudioResampler {
public:
AudioResamplerSinc(int bitDepth, int inChannelCount, int32_t sampleRate);
- ~AudioResamplerSinc();
+ virtual ~AudioResamplerSinc();
virtual void resample(int32_t* out, size_t outFrameCount,
AudioBufferProvider* provider);