diff options
author | Sarthak Aggarwal <sarthak@ti.com> | 2011-08-11 10:57:11 +0530 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-08-24 18:25:36 -0700 |
commit | f94e0fb97765a9927e21028499f43771264f37cb (patch) | |
tree | 465b161a55627df622808c56781fe12e0418da15 /domx | |
parent | 8c8691b5400ae97b5ee2cfd87c3945344a035674 (diff) | |
download | hardware_ti_omap4xxx-f94e0fb97765a9927e21028499f43771264f37cb.zip hardware_ti_omap4xxx-f94e0fb97765a9927e21028499f43771264f37cb.tar.gz hardware_ti_omap4xxx-f94e0fb97765a9927e21028499f43771264f37cb.tar.bz2 |
Add new OMX component for secure playback
Change-Id: Ib55f6a1dd3ef6e9c99798b1bffabeae63671efad
Signed-Off-By:Sarthak Aggarwal<sarthak@ti.com>
Diffstat (limited to 'domx')
-rw-r--r-- | domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_secure.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_secure.c b/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_secure.c new file mode 100644 index 0000000..616d699 --- /dev/null +++ b/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_secure.c @@ -0,0 +1,58 @@ +#include <stdio.h> +#include <string.h> +#include <assert.h> +#include "omx_proxy_common.h" +#include <timm_osal_interfaces.h> + +#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.DECODER.secure" + +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) +{ + OMX_ERRORTYPE eError = OMX_ErrorNone; + OMX_COMPONENTTYPE *pHandle = NULL; + PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL; + pHandle = (OMX_COMPONENTTYPE *) hComponent; + + DOMX_ENTER(""); + + DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME); + + pHandle->pComponentPrivate = + (PROXY_COMPONENT_PRIVATE *) + TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE, + 0, TIMMOSAL_MEM_SEGMENT_INT); + + PROXY_assert(pHandle->pComponentPrivate != NULL, + OMX_ErrorInsufficientResources, + "ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE"); + + pComponentPrivate = + (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate; + + TIMM_OSAL_Memset(pComponentPrivate, 0, + sizeof(PROXY_COMPONENT_PRIVATE)); + + pComponentPrivate->cCompName = + TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8), + TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT); + + PROXY_assert(pComponentPrivate->cCompName != NULL, + OMX_ErrorInsufficientResources, + " Error in Allocating space for proxy component table"); + + // Copying component Name - this will be picked up in the proxy common + PROXY_assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH, + OMX_ErrorInvalidComponentName, + "Length of component name is longer than the max allowed"); + TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME, + strlen(COMPONENT_NAME) + 1); + + eError = OMX_ProxyViddecInit(hComponent); + +#ifdef USE_ION + pComponentPrivate->bUseIon = OMX_TRUE; + pComponentPrivate->bMapIonBuffers = OMX_FALSE; +#endif + EXIT: + return eError; +} |