diff options
author | Eric Laurent <elaurent@google.com> | 2014-05-06 15:25:45 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-06 15:25:46 +0000 |
commit | 8fb04d474ed9e0d1302ae223ee76fafbe5fb41a3 (patch) | |
tree | 7f6d93406b9f7a9474412a02e764054e0d6503c1 /services/audioflinger/AudioPolicyService.h | |
parent | b231408849158baea8dddc0edf7e97fcfc2e3240 (diff) | |
parent | 48412dc92c4cc92a3f4821616e12290f5eeabd07 (diff) | |
download | frameworks_av-8fb04d474ed9e0d1302ae223ee76fafbe5fb41a3.zip frameworks_av-8fb04d474ed9e0d1302ae223ee76fafbe5fb41a3.tar.gz frameworks_av-8fb04d474ed9e0d1302ae223ee76fafbe5fb41a3.tar.bz2 |
Merge "Fix memory leak when filtering commands in insertCommand_l()"
Diffstat (limited to 'services/audioflinger/AudioPolicyService.h')
-rw-r--r-- | services/audioflinger/AudioPolicyService.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/services/audioflinger/AudioPolicyService.h b/services/audioflinger/AudioPolicyService.h index ae053a9..a38160f 100644 --- a/services/audioflinger/AudioPolicyService.h +++ b/services/audioflinger/AudioPolicyService.h @@ -197,6 +197,8 @@ private: void insertCommand_l(AudioCommand *command, int delayMs = 0); private: + class AudioCommandData; + // descriptor for requested tone playback event class AudioCommand { @@ -211,41 +213,48 @@ private: Condition mCond; // condition for status return status_t mStatus; // command status bool mWaitStatus; // true if caller is waiting for status - void *mParam; // command parameter (ToneData, VolumeData, ParametersData) + AudioCommandData *mParam; // command specific parameter data + }; + + class AudioCommandData { + public: + virtual ~AudioCommandData() {} + protected: + AudioCommandData() {} }; - class ToneData { + class ToneData : public AudioCommandData { public: ToneGenerator::tone_type mType; // tone type (START_TONE only) audio_stream_type_t mStream; // stream type (START_TONE only) }; - class VolumeData { + class VolumeData : public AudioCommandData { public: audio_stream_type_t mStream; float mVolume; audio_io_handle_t mIO; }; - class ParametersData { + class ParametersData : public AudioCommandData { public: audio_io_handle_t mIO; String8 mKeyValuePairs; }; - class VoiceVolumeData { + class VoiceVolumeData : public AudioCommandData { public: float mVolume; }; - class StopOutputData { + class StopOutputData : public AudioCommandData { public: audio_io_handle_t mIO; audio_stream_type_t mStream; int mSession; }; - class ReleaseOutputData { + class ReleaseOutputData : public AudioCommandData { public: audio_io_handle_t mIO; }; |