Home | History | Annotate | Download | only in src
      1 /*
      2  * Copyright (c) 2010, Texas Instruments Incorporated
      3  * All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  *
      9  * *  Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  *
     12  * *  Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  *
     16  * *  Neither the name of Texas Instruments Incorporated nor the names of
     17  *    its contributors may be used to endorse or promote products derived
     18  *    from this software without specific prior written permission.
     19  *
     20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  */
     32 
     33 #ifdef _Android
     34 
     35 /* #include "OMX_RegLib.h" */
     36 #include "OMX_Component.h"
     37 #include "OMX_Core.h"
     38 #include "OMX_ComponentRegistry.h"
     39 
     40 #include "OMX_Core_Wrapper.h"
     41 #include "timm_osal_trace.h"
     42 #undef LOG_TAG
     43 #define LOG_TAG "OMX_CORE"
     44 
     45 /** determine capabilities of a component before acually using it */
     46 extern OMX_BOOL TIOMXConfigParser(OMX_PTR aInputParameters,
     47     OMX_PTR aOutputParameters);
     48 
     49 #endif
     50 
     51 
     52 #ifdef _Android
     53 #ifdef _FROYO
     54 OMX_BOOL TIOMXConfigParserRedirect(OMX_PTR aInputParameters,
     55     OMX_PTR aOutputParameters)
     56 {
     57 	TIMM_OSAL_Entering("OMXConfigParserRedirect +\n");
     58 	OMX_BOOL Status = OMX_FALSE;
     59 
     60 	Status = TIOMXConfigParser(aInputParameters, aOutputParameters);
     61 
     62 	TIMM_OSAL_Exiting("OMXConfigParserRedirect -\n");
     63 	return Status;
     64 }
     65 #endif
     66 OMX_ERRORTYPE TIComponentTable_EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
     67     OMX_IN OMX_PTR pAppData,
     68     OMX_IN OMX_EVENTTYPE eEvent,
     69     OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData)
     70 {
     71 	return OMX_ErrorNotImplemented;
     72 }
     73 
     74 OMX_ERRORTYPE TIComponentTable_EmptyBufferDone(OMX_OUT OMX_HANDLETYPE
     75     hComponent, OMX_OUT OMX_PTR pAppData,
     76     OMX_OUT OMX_BUFFERHEADERTYPE * pBuffer)
     77 {
     78 	return OMX_ErrorNotImplemented;
     79 }
     80 
     81 OMX_ERRORTYPE TIComponentTable_FillBufferDone(OMX_OUT OMX_HANDLETYPE
     82     hComponent, OMX_OUT OMX_PTR pAppData,
     83     OMX_OUT OMX_BUFFERHEADERTYPE * pBuffer)
     84 {
     85 	return OMX_ErrorNotImplemented;
     86 }
     87 
     88 
     89 OMX_API OMX_ERRORTYPE TIOMX_Init(void)
     90 {
     91 	TIMM_OSAL_Entering("TIOMX_Init\n");
     92 
     93 	return OMX_Init();
     94 }
     95 
     96 OMX_API OMX_ERRORTYPE TIOMX_Deinit(void)
     97 {
     98 	TIMM_OSAL_Entering("TIOMX_Deinit\n");
     99 
    100 	return OMX_Deinit();
    101 }
    102 
    103 OMX_API OMX_ERRORTYPE TIOMX_ComponentNameEnum(OMX_OUT OMX_STRING
    104     cComponentName, OMX_IN OMX_U32 nNameLength, OMX_IN OMX_U32 nIndex)
    105 {
    106 
    107 	TIMM_OSAL_Entering("TIOMX_ComponentNameEnum\n");
    108 
    109 	return OMX_ComponentNameEnum(cComponentName, nNameLength, nIndex);
    110 }
    111 
    112 OMX_API OMX_ERRORTYPE TIOMX_GetHandle(OMX_OUT OMX_HANDLETYPE * pHandle,
    113     OMX_IN OMX_STRING cComponentName,
    114     OMX_IN OMX_PTR pAppData, OMX_IN OMX_CALLBACKTYPE * pCallBacks)
    115 {
    116 
    117 	TIMM_OSAL_Entering("TIOMX_GetHandle\n");
    118 
    119 	return OMX_GetHandle(pHandle, cComponentName, pAppData, pCallBacks);
    120 }
    121 
    122 OMX_API OMX_ERRORTYPE TIOMX_FreeHandle(OMX_IN OMX_HANDLETYPE hComponent)
    123 {
    124 	TIMM_OSAL_Entering("TIOMX_FreeHandle\n");
    125 
    126 	return OMX_FreeHandle(hComponent);
    127 }
    128 
    129 OMX_API OMX_ERRORTYPE TIOMX_GetComponentsOfRole(OMX_IN OMX_STRING role,
    130     OMX_INOUT OMX_U32 * pNumComps, OMX_INOUT OMX_U8 ** compNames)
    131 {
    132 
    133 	TIMM_OSAL_Entering("TIOMX_GetComponentsOfRole\n");
    134 
    135 	return OMX_GetComponentsOfRole(role, pNumComps, compNames);
    136 }
    137 
    138 OMX_API OMX_ERRORTYPE TIOMX_GetRolesOfComponent(OMX_IN OMX_STRING compName,
    139     OMX_INOUT OMX_U32 * pNumRoles, OMX_OUT OMX_U8 ** roles)
    140 {
    141 
    142 	TIMM_OSAL_Entering("TIOMX_GetRolesOfComponent\n");
    143 
    144 	return OMX_GetRolesOfComponent(compName, pNumRoles, roles);
    145 }
    146 
    147 OMX_API OMX_ERRORTYPE TIOMX_SetupTunnel(OMX_IN OMX_HANDLETYPE hOutput,
    148     OMX_IN OMX_U32 nPortOutput,
    149     OMX_IN OMX_HANDLETYPE hInput, OMX_IN OMX_U32 nPortInput)
    150 {
    151 
    152 	TIMM_OSAL_Entering("TIOMX_SetupTunnel\n");
    153 
    154 	return OMX_SetupTunnel(hOutput, nPortOutput, hInput, nPortInput);
    155 }
    156 
    157 OMX_API OMX_ERRORTYPE TIOMX_GetContentPipe(OMX_OUT OMX_HANDLETYPE * hPipe,
    158     OMX_IN OMX_STRING szURI)
    159 {
    160 
    161 	TIMM_OSAL_Entering("TIOMX_GetContentPipe\n");
    162 
    163 	//return OMX_GetContentPipe(
    164 	//      hPipe,
    165 	//      szURI);
    166 	return 0;
    167 }
    168 #endif
    169