From 60c60df7db278d2fa5c90b0fa14f99a61d50272b Mon Sep 17 00:00:00 2001 From: jpadmana Date: Tue, 4 Jun 2013 16:03:29 +0530 Subject: Effect Offload Proxy for effects offload Effect Proxy abstracts the sub effects to the upper layers. It has the following functionalities: - creation and release of sub effects - routing the effect commands and process to the appropriate sub effect Bug: 8174034. Change-Id: I22d8136636048e7fe8f8807cbc6e348ffa200a22 Signed-off-by: jpadmana --- media/libeffects/proxy/EffectProxy.h | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 media/libeffects/proxy/EffectProxy.h (limited to 'media/libeffects/proxy/EffectProxy.h') diff --git a/media/libeffects/proxy/EffectProxy.h b/media/libeffects/proxy/EffectProxy.h new file mode 100644 index 0000000..8992f93 --- /dev/null +++ b/media/libeffects/proxy/EffectProxy.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +namespace android { +enum { + SUB_FX_HOST, // Index of HOST in the descriptor and handle arrays + // of the Proxy context + SUB_FX_OFFLOAD, // Index of OFFLOAD in the descriptor and handle arrays + // of the Proxy context + SUB_FX_COUNT // The number of sub effects for a Proxy(1 HW, 1 SW) +}; +#if __cplusplus +extern "C" { +#endif + +int EffectProxyCreate(const effect_uuid_t *uuid, + int32_t sessionId, + int32_t ioId, + effect_handle_t *pHandle); +int EffectProxyRelease(effect_handle_t handle); +int EffectProxyGetDescriptor(const effect_uuid_t *uuid, + effect_descriptor_t *pDescriptor); +/* Effect Control Interface Implementation: Process */ +int Effect_process(effect_handle_t self, + audio_buffer_t *inBuffer, + audio_buffer_t *outBuffer); + +/* Effect Control Interface Implementation: Command */ +int Effect_command(effect_handle_t self, + uint32_t cmdCode, + uint32_t cmdSize, + void *pCmdData, + uint32_t *replySize, + void *pReplyData); +int Effect_getDescriptor(effect_handle_t self, + effect_descriptor_t *pDescriptor); + +const struct effect_interface_s gEffectInterface = { + Effect_process, + Effect_command, + Effect_getDescriptor, + NULL, +}; + +struct EffectContext { + const struct effect_interface_s *common_itfe; // Holds the itfe of the Proxy + effect_descriptor_t* desc; // Points to the sub effect descriptors + effect_handle_t eHandle[SUB_FX_COUNT]; // The effect handles of the sub effects + int index; // The index that is currently active - HOST or OFFLOAD + int32_t sessionId; // The sessiond in which the effect is created. + // Stored in context to pass on to sub effect creation + int32_t ioId; // The ioId in which the effect is created. + // Stored in context to pass on to sub effect creation + effect_uuid_t uuid; // UUID of the Proxy +}; + +#if __cplusplus +} // extern "C" +#endif +} //namespace android -- cgit v1.1 From ddfbfaeb00295fff7351711f0f044f17d6c40f3c Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 20 Sep 2013 12:27:32 -0700 Subject: fix oflload effect proxy commmand handling Implement a more generic command handling in offload effect proxy. All commands are sent to both sub effects but only the reply from the active one is returned to the caller. Bug: 8174034. Change-Id: Ia45f9933b3bf338257ec70b37732fa1578d26b9f --- media/libeffects/proxy/EffectProxy.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'media/libeffects/proxy/EffectProxy.h') diff --git a/media/libeffects/proxy/EffectProxy.h b/media/libeffects/proxy/EffectProxy.h index 8992f93..acbe17e 100644 --- a/media/libeffects/proxy/EffectProxy.h +++ b/media/libeffects/proxy/EffectProxy.h @@ -57,6 +57,9 @@ const struct effect_interface_s gEffectInterface = { NULL, }; +#define PROXY_REPLY_SIZE_MAX (64 * 1024) // must be power of two +#define PROXY_REPLY_SIZE_DEFAULT 32 // must be power of two + struct EffectContext { const struct effect_interface_s *common_itfe; // Holds the itfe of the Proxy effect_descriptor_t* desc; // Points to the sub effect descriptors @@ -67,6 +70,8 @@ struct EffectContext { int32_t ioId; // The ioId in which the effect is created. // Stored in context to pass on to sub effect creation effect_uuid_t uuid; // UUID of the Proxy + char* replyData; // temporary buffer for non active sub effect command reply + uint32_t replySize; // current size of temporary reply buffer }; #if __cplusplus -- cgit v1.1 From 5b8ce24b849f6cd5629b4ba508f7c78d6227d250 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 27 Sep 2013 14:50:48 -0700 Subject: Revert "Effect Offload Proxy for effects offload" This reverts commit 60c60df7db278d2fa5c90b0fa14f99a61d50272b. Change-Id: Iafba9e02a9f3bfde6248d802e96c4e649686a87d --- media/libeffects/proxy/EffectProxy.h | 80 ------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 media/libeffects/proxy/EffectProxy.h (limited to 'media/libeffects/proxy/EffectProxy.h') diff --git a/media/libeffects/proxy/EffectProxy.h b/media/libeffects/proxy/EffectProxy.h deleted file mode 100644 index acbe17e..0000000 --- a/media/libeffects/proxy/EffectProxy.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -namespace android { -enum { - SUB_FX_HOST, // Index of HOST in the descriptor and handle arrays - // of the Proxy context - SUB_FX_OFFLOAD, // Index of OFFLOAD in the descriptor and handle arrays - // of the Proxy context - SUB_FX_COUNT // The number of sub effects for a Proxy(1 HW, 1 SW) -}; -#if __cplusplus -extern "C" { -#endif - -int EffectProxyCreate(const effect_uuid_t *uuid, - int32_t sessionId, - int32_t ioId, - effect_handle_t *pHandle); -int EffectProxyRelease(effect_handle_t handle); -int EffectProxyGetDescriptor(const effect_uuid_t *uuid, - effect_descriptor_t *pDescriptor); -/* Effect Control Interface Implementation: Process */ -int Effect_process(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); - -/* Effect Control Interface Implementation: Command */ -int Effect_command(effect_handle_t self, - uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *replySize, - void *pReplyData); -int Effect_getDescriptor(effect_handle_t self, - effect_descriptor_t *pDescriptor); - -const struct effect_interface_s gEffectInterface = { - Effect_process, - Effect_command, - Effect_getDescriptor, - NULL, -}; - -#define PROXY_REPLY_SIZE_MAX (64 * 1024) // must be power of two -#define PROXY_REPLY_SIZE_DEFAULT 32 // must be power of two - -struct EffectContext { - const struct effect_interface_s *common_itfe; // Holds the itfe of the Proxy - effect_descriptor_t* desc; // Points to the sub effect descriptors - effect_handle_t eHandle[SUB_FX_COUNT]; // The effect handles of the sub effects - int index; // The index that is currently active - HOST or OFFLOAD - int32_t sessionId; // The sessiond in which the effect is created. - // Stored in context to pass on to sub effect creation - int32_t ioId; // The ioId in which the effect is created. - // Stored in context to pass on to sub effect creation - effect_uuid_t uuid; // UUID of the Proxy - char* replyData; // temporary buffer for non active sub effect command reply - uint32_t replySize; // current size of temporary reply buffer -}; - -#if __cplusplus -} // extern "C" -#endif -} //namespace android -- cgit v1.1 From faca05e96744dfaa2f352e3dbb29eead4e55cfa0 Mon Sep 17 00:00:00 2001 From: jpadmana Date: Tue, 4 Jun 2013 16:03:29 +0530 Subject: Effect Offload Proxy for effects offload Effect Proxy abstracts the sub effects to the upper layers. It has the following functionalities: - creation and release of sub effects - routing the effect commands and process to the appropriate sub effect Bug: 8174034. Change-Id: Iec34b61104f0bbec4ef67c62f0710a5536dc325b Signed-off-by: jpadmana --- media/libeffects/proxy/EffectProxy.h | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 media/libeffects/proxy/EffectProxy.h (limited to 'media/libeffects/proxy/EffectProxy.h') diff --git a/media/libeffects/proxy/EffectProxy.h b/media/libeffects/proxy/EffectProxy.h new file mode 100644 index 0000000..8992f93 --- /dev/null +++ b/media/libeffects/proxy/EffectProxy.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +namespace android { +enum { + SUB_FX_HOST, // Index of HOST in the descriptor and handle arrays + // of the Proxy context + SUB_FX_OFFLOAD, // Index of OFFLOAD in the descriptor and handle arrays + // of the Proxy context + SUB_FX_COUNT // The number of sub effects for a Proxy(1 HW, 1 SW) +}; +#if __cplusplus +extern "C" { +#endif + +int EffectProxyCreate(const effect_uuid_t *uuid, + int32_t sessionId, + int32_t ioId, + effect_handle_t *pHandle); +int EffectProxyRelease(effect_handle_t handle); +int EffectProxyGetDescriptor(const effect_uuid_t *uuid, + effect_descriptor_t *pDescriptor); +/* Effect Control Interface Implementation: Process */ +int Effect_process(effect_handle_t self, + audio_buffer_t *inBuffer, + audio_buffer_t *outBuffer); + +/* Effect Control Interface Implementation: Command */ +int Effect_command(effect_handle_t self, + uint32_t cmdCode, + uint32_t cmdSize, + void *pCmdData, + uint32_t *replySize, + void *pReplyData); +int Effect_getDescriptor(effect_handle_t self, + effect_descriptor_t *pDescriptor); + +const struct effect_interface_s gEffectInterface = { + Effect_process, + Effect_command, + Effect_getDescriptor, + NULL, +}; + +struct EffectContext { + const struct effect_interface_s *common_itfe; // Holds the itfe of the Proxy + effect_descriptor_t* desc; // Points to the sub effect descriptors + effect_handle_t eHandle[SUB_FX_COUNT]; // The effect handles of the sub effects + int index; // The index that is currently active - HOST or OFFLOAD + int32_t sessionId; // The sessiond in which the effect is created. + // Stored in context to pass on to sub effect creation + int32_t ioId; // The ioId in which the effect is created. + // Stored in context to pass on to sub effect creation + effect_uuid_t uuid; // UUID of the Proxy +}; + +#if __cplusplus +} // extern "C" +#endif +} //namespace android -- cgit v1.1 From 5d6d86a4d102704f49b9235eaf282c428d7100b6 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 20 Sep 2013 12:27:32 -0700 Subject: fix oflload effect proxy commmand handling Implement a more generic command handling in offload effect proxy. All commands are sent to both sub effects but only the reply from the active one is returned to the caller. Bug: 8174034. Change-Id: I28aa0f0d806e846332bc29801ee40d34e4ea0c43 --- media/libeffects/proxy/EffectProxy.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'media/libeffects/proxy/EffectProxy.h') diff --git a/media/libeffects/proxy/EffectProxy.h b/media/libeffects/proxy/EffectProxy.h index 8992f93..acbe17e 100644 --- a/media/libeffects/proxy/EffectProxy.h +++ b/media/libeffects/proxy/EffectProxy.h @@ -57,6 +57,9 @@ const struct effect_interface_s gEffectInterface = { NULL, }; +#define PROXY_REPLY_SIZE_MAX (64 * 1024) // must be power of two +#define PROXY_REPLY_SIZE_DEFAULT 32 // must be power of two + struct EffectContext { const struct effect_interface_s *common_itfe; // Holds the itfe of the Proxy effect_descriptor_t* desc; // Points to the sub effect descriptors @@ -67,6 +70,8 @@ struct EffectContext { int32_t ioId; // The ioId in which the effect is created. // Stored in context to pass on to sub effect creation effect_uuid_t uuid; // UUID of the Proxy + char* replyData; // temporary buffer for non active sub effect command reply + uint32_t replySize; // current size of temporary reply buffer }; #if __cplusplus -- cgit v1.1