diff options
author | Eric Laurent <elaurent@google.com> | 2011-08-11 14:40:04 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-11 14:40:04 -0700 |
commit | 45bd6086cc112b2a2cf192af01c7f444867b7f75 (patch) | |
tree | 9a4de881b4e8eaaffc7f6b0952e2a82cd7d3aed9 /media | |
parent | 7797d7b66001f4181621d4b37ce350bebb6d6d63 (diff) | |
parent | 6752ec80b25cb1f39507d18745c7e62323772cda (diff) | |
download | frameworks_base-45bd6086cc112b2a2cf192af01c7f444867b7f75.zip frameworks_base-45bd6086cc112b2a2cf192af01c7f444867b7f75.tar.gz frameworks_base-45bd6086cc112b2a2cf192af01c7f444867b7f75.tar.bz2 |
Merge "Audio effects: track CPU and memory use separately"
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioSystem.cpp | 7 | ||||
-rw-r--r-- | media/libmedia/IAudioPolicyService.cpp | 21 |
2 files changed, 27 insertions, 1 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index b26ed71..bb91fa9 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -710,6 +710,13 @@ status_t AudioSystem::unregisterEffect(int id) return aps->unregisterEffect(id); } +status_t AudioSystem::setEffectEnabled(int id, bool enabled) +{ + const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); + if (aps == 0) return PERMISSION_DENIED; + return aps->setEffectEnabled(id, enabled); +} + status_t AudioSystem::isStreamActive(int stream, bool* state, uint32_t inPastMs) { const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service(); diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp index 15f4be0..50b4855 100644 --- a/media/libmedia/IAudioPolicyService.cpp +++ b/media/libmedia/IAudioPolicyService.cpp @@ -53,7 +53,8 @@ enum { UNREGISTER_EFFECT, IS_STREAM_ACTIVE, GET_DEVICES_FOR_STREAM, - QUERY_DEFAULT_PRE_PROCESSING + QUERY_DEFAULT_PRE_PROCESSING, + SET_EFFECT_ENABLED }; class BpAudioPolicyService : public BpInterface<IAudioPolicyService> @@ -313,6 +314,16 @@ public: return static_cast <status_t> (reply.readInt32()); } + virtual status_t setEffectEnabled(int id, bool enabled) + { + Parcel data, reply; + data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor()); + data.writeInt32(id); + data.writeInt32(enabled); + remote()->transact(SET_EFFECT_ENABLED, data, &reply); + return static_cast <status_t> (reply.readInt32()); + } + virtual bool isStreamActive(int stream, uint32_t inPastMs) const { Parcel data, reply; @@ -577,6 +588,14 @@ status_t BnAudioPolicyService::onTransact( return NO_ERROR; } break; + case SET_EFFECT_ENABLED: { + CHECK_INTERFACE(IAudioPolicyService, data, reply); + int id = data.readInt32(); + bool enabled = static_cast <bool>(data.readInt32()); + reply->writeInt32(static_cast <int32_t>(setEffectEnabled(id, enabled))); + return NO_ERROR; + } break; + case IS_STREAM_ACTIVE: { CHECK_INTERFACE(IAudioPolicyService, data, reply); int stream = data.readInt32(); |