diff options
Diffstat (limited to 'domx/omx_proxy_component/omx_sample')
-rwxr-xr-x | domx/omx_proxy_component/omx_sample/Makefile | 103 | ||||
-rwxr-xr-x | domx/omx_proxy_component/omx_sample/src/omx_proxy_sample.c | 109 |
2 files changed, 212 insertions, 0 deletions
diff --git a/domx/omx_proxy_component/omx_sample/Makefile b/domx/omx_proxy_component/omx_sample/Makefile new file mode 100755 index 0000000..499d1a6 --- /dev/null +++ b/domx/omx_proxy_component/omx_sample/Makefile @@ -0,0 +1,103 @@ +# +# Copyright (C) Texas Instruments - http://www.ti.com/ +# +# 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. +# +# ---------------------------------------------------------------------------- +# Revision History +# +# +# REF=ORG +# Original version. +# ---------------------------------------------------------------------------- + + + +include $(PROJROOT)/make/start.mk + +# Do not change above "include" line(s) + +# Arguments to tools, will move to make system once finalized. + +CFLAGS = +CDEFS = +ifeq ($(BUILD),udeb) +CDEFS += DEBUG +endif +CDEFS += + +EXEC_ARGS = +ST_LIB_ARGS = +SH_LIB_ARGS = + +# Define this macro if target runs in kernel mode +#__KERNEL__ = 1 + +# Target name and extension +# static library (ST_LIB): filename.a +# shared library soname (SH_LIB): filename.so.maj_ver.min_ver +# executable (EXEC) : filename.out + +TARGETNAME = libOMX.TI.DUCATI1.MISC.SAMPLE.so + + +# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case. + +TARGETTYPE = SH_LIB + +# install directory relative to the HOSTTARGET directory +HOSTRELEASE = lib + +# install directory relative to the root filesystem +ROOTFSRELEASE = lib + +# Folders in which gmake will run before building current target + +SUBMODULES = \ + +# Filename must not begin with '.', '/' or '\' + +SOURCES = \ +src/omx_proxy_sample.c \ + + + +# Search path for include files + +INCLUDES = \ + $(PROJROOT)/omx_core/inc \ + $(PROJROOT)/mm_osal/inc \ + $(PROJROOT)/domx \ + $(PROJROOT)/domx/omx_rpc/inc \ + + +# Libraries needed for linking. + +ST_LIBS = +#mm_osal domx +SH_LIBS = domx omx_core mm_osal +#pthread rt utils procmgr ipc rcm notify +#SH_LIBS += sysmgr sysmemmgr + + +# Search path for library (and linker command) files. +# Current folder and target folder are included by default. + +LIBINCLUDES = $(PROJROOT)/mm_osal \ + $(PROJROOT)/domx \ + $(PROJROOT)/omx_core + + +# Do not change below "include" line(s) + +include $(PROJROOT)/make/build.mk diff --git a/domx/omx_proxy_component/omx_sample/src/omx_proxy_sample.c b/domx/omx_proxy_component/omx_sample/src/omx_proxy_sample.c new file mode 100755 index 0000000..b270186 --- /dev/null +++ b/domx/omx_proxy_component/omx_sample/src/omx_proxy_sample.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file omx_proxy_sample.c + * This file contains methods that provides the functionality for + * the OpenMAX1.1 DOMX Framework Tunnel Proxy component. + ********************************************************************************************* + This is the proxy specific wrapper that passes the component name to the generic proxy init() + The proxy wrapper also does some runtime/static time onfig on per proxy basis + This is a thin wrapper that is called when componentiit() of the proxy is called + static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData); + this layer gets called first whenever a proxy s get handle is called + ************************************************************************************************ + * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src + * + * @rev 1.0 + */ + +/*============================================================== + *! Revision History + *! ============================ + *! 19-August-2009 B Ravi Kiran ravi.kiran@ti.com: Initial Version + *================================================================*/ + +/****************************************************************** + * INCLUDE FILES + ******************************************************************/ +#include <stdio.h> +#include <string.h> +#include <assert.h> +#include "omx_proxy_common.h" +#include <timm_osal_interfaces.h> +//change to ducati1 later +#define COMPONENT_NAME "OMX.TI.DUCATI1.MISC.SAMPLE" // needs to be specific for every configuration wrapper + +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) +{ + OMX_ERRORTYPE eError = OMX_ErrorNone; + OMX_COMPONENTTYPE *pHandle = NULL; + PROXY_COMPONENT_PRIVATE *pComponentPrivate; + pHandle = (OMX_COMPONENTTYPE *) hComponent; + + DOMX_DEBUG + ("_____________________INSISDE PROXY WRAPPER__________________________\n"); + + pHandle->pComponentPrivate = + (PROXY_COMPONENT_PRIVATE *) + TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE, + 0, TIMMOSAL_MEM_SEGMENT_INT); + + pComponentPrivate = + (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate; + if (pHandle->pComponentPrivate == NULL) + { + DOMX_DEBUG + (" ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE"); + eError = OMX_ErrorInsufficientResources; + goto EXIT; + } + pComponentPrivate->cCompName = + TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8), + TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT); + // Copying component Name - this will be picked up in the proxy common + assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH); + TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME, + strlen(COMPONENT_NAME) + 1); + eError = OMX_ProxyCommonInit(hComponent); // Calling Proxy Common Init() + + if (eError != OMX_ErrorNone) + { + DOMX_DEBUG("\Error in Initializing Proxy"); + TIMM_OSAL_Free(pComponentPrivate->cCompName); + TIMM_OSAL_Free(pComponentPrivate); + } + + + EXIT: + return eError; +} |