From 582a15744be109fb630db7dbd1d1bdf22ff44f12 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Wed, 10 Aug 2011 20:16:23 -0700 Subject: AudioPolicyManager: register effect CPU on enable Audio effect CPU usage is now registered on enable and unregistered on disable instead of when the effect is created or destroyed. Change-Id: Icffcede9558d8d41887278f0efef2df430927381 --- include/hardware_legacy/AudioPolicyInterface.h | 1 + include/hardware_legacy/AudioPolicyManagerBase.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/hardware_legacy/AudioPolicyInterface.h b/include/hardware_legacy/AudioPolicyInterface.h index 78f87da..94b7759 100644 --- a/include/hardware_legacy/AudioPolicyInterface.h +++ b/include/hardware_legacy/AudioPolicyInterface.h @@ -147,6 +147,7 @@ public: int session, int id) = 0; virtual status_t unregisterEffect(int id) = 0; + virtual status_t setEffectEnabled(int id, bool enabled); virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const = 0; diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index ddcce71..21cf872 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -117,6 +117,7 @@ public: int session, int id); virtual status_t unregisterEffect(int id); + virtual status_t setEffectEnabled(int id, bool enabled); virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const; @@ -216,6 +217,7 @@ protected: routing_strategy mStrategy; // routing strategy the effect is associated to int mSession; // audio session the effect is on effect_descriptor_t mDesc; // effect descriptor + bool mEnabled; // enabled state: CPU load being used or not }; void addOutput(audio_io_handle_t id, AudioOutputDescriptor *outputDesc); @@ -307,6 +309,8 @@ protected: int testOutputIndex(audio_io_handle_t output); #endif //AUDIO_POLICY_TEST + status_t setEffectEnabled(EffectDescriptor *pDesc, bool enabled); + AudioPolicyClientInterface *mpClientInterface; // audio policy client interface audio_io_handle_t mHardwareOutput; // hardware output handler audio_io_handle_t mA2dpOutput; // A2DP output handler -- cgit v1.2.3