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 <utils/Log.h> 42 #undef LOG_TAG 43 #define LOG_TAG "OMX_CORE" 44 45 /** determine capabilities of a component before acually using it */ 46 #if 0 47 #include "ti_omx_config_parser.h" 48 #else 49 extern OMX_BOOL TIOMXConfigParser(OMX_PTR aInputParameters, 50 OMX_PTR aOutputParameters); 51 #endif 52 53 #endif 54 55 56 #ifdef _Android 57 #ifdef _FROYO 58 OMX_BOOL TIOMXConfigParserRedirect(OMX_PTR aInputParameters, 59 OMX_PTR aOutputParameters) 60 { 61 ALOGV("OMXConfigParserRedirect +\n"); 62 OMX_BOOL Status = OMX_FALSE; 63 64 Status = TIOMXConfigParser(aInputParameters, aOutputParameters); 65 66 ALOGV("OMXConfigParserRedirect -\n"); 67 return Status; 68 } 69 #endif 70 OMX_ERRORTYPE TIComponentTable_EventHandler(OMX_IN OMX_HANDLETYPE hComponent, 71 OMX_IN OMX_PTR pAppData, 72 OMX_IN OMX_EVENTTYPE eEvent, 73 OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData) 74 { 75 return OMX_ErrorNotImplemented; 76 } 77 78 OMX_ERRORTYPE TIComponentTable_EmptyBufferDone(OMX_OUT OMX_HANDLETYPE 79 hComponent, OMX_OUT OMX_PTR pAppData, 80 OMX_OUT OMX_BUFFERHEADERTYPE * pBuffer) 81 { 82 return OMX_ErrorNotImplemented; 83 } 84 85 OMX_ERRORTYPE TIComponentTable_FillBufferDone(OMX_OUT OMX_HANDLETYPE 86 hComponent, OMX_OUT OMX_PTR pAppData, 87 OMX_OUT OMX_BUFFERHEADERTYPE * pBuffer) 88 { 89 return OMX_ErrorNotImplemented; 90 } 91 92 93 OMX_API OMX_ERRORTYPE TIOMX_Init(void) 94 { 95 ALOGV("TIOMX_Init\n"); 96 97 return OMX_Init(); 98 } 99 100 OMX_API OMX_ERRORTYPE TIOMX_Deinit(void) 101 { 102 ALOGV("TIOMX_Deinit\n"); 103 104 return OMX_Deinit(); 105 } 106 107 OMX_API OMX_ERRORTYPE TIOMX_ComponentNameEnum(OMX_OUT OMX_STRING 108 cComponentName, OMX_IN OMX_U32 nNameLength, OMX_IN OMX_U32 nIndex) 109 { 110 111 ALOGV("TIOMX_ComponentNameEnum\n"); 112 113 return OMX_ComponentNameEnum(cComponentName, nNameLength, nIndex); 114 } 115 116 OMX_API OMX_ERRORTYPE TIOMX_GetHandle(OMX_OUT OMX_HANDLETYPE * pHandle, 117 OMX_IN OMX_STRING cComponentName, 118 OMX_IN OMX_PTR pAppData, OMX_IN OMX_CALLBACKTYPE * pCallBacks) 119 { 120 121 ALOGV("TIOMX_GetHandle\n"); 122 123 return OMX_GetHandle(pHandle, cComponentName, pAppData, pCallBacks); 124 } 125 126 OMX_API OMX_ERRORTYPE TIOMX_FreeHandle(OMX_IN OMX_HANDLETYPE hComponent) 127 { 128 ALOGV("TIOMX_FreeHandle\n"); 129 130 return OMX_FreeHandle(hComponent); 131 } 132 133 OMX_API OMX_ERRORTYPE TIOMX_GetComponentsOfRole(OMX_IN OMX_STRING role, 134 OMX_INOUT OMX_U32 * pNumComps, OMX_INOUT OMX_U8 ** compNames) 135 { 136 137 ALOGV("TIOMX_GetComponentsOfRole\n"); 138 139 return OMX_GetComponentsOfRole(role, pNumComps, compNames); 140 } 141 142 OMX_API OMX_ERRORTYPE TIOMX_GetRolesOfComponent(OMX_IN OMX_STRING compName, 143 OMX_INOUT OMX_U32 * pNumRoles, OMX_OUT OMX_U8 ** roles) 144 { 145 146 ALOGV("TIOMX_GetRolesOfComponent\n"); 147 148 return OMX_GetRolesOfComponent(compName, pNumRoles, roles); 149 } 150 151 OMX_API OMX_ERRORTYPE TIOMX_SetupTunnel(OMX_IN OMX_HANDLETYPE hOutput, 152 OMX_IN OMX_U32 nPortOutput, 153 OMX_IN OMX_HANDLETYPE hInput, OMX_IN OMX_U32 nPortInput) 154 { 155 156 ALOGV("TIOMX_SetupTunnel\n"); 157 158 return OMX_SetupTunnel(hOutput, nPortOutput, hInput, nPortInput); 159 } 160 161 OMX_API OMX_ERRORTYPE TIOMX_GetContentPipe(OMX_OUT OMX_HANDLETYPE * hPipe, 162 OMX_IN OMX_STRING szURI) 163 { 164 165 ALOGV("TIOMX_GetContentPipe\n"); 166 167 //return OMX_GetContentPipe( 168 // hPipe, 169 // szURI); 170 return 0; 171 } 172 #endif 173