OMX_WbAmrDec_Utils.h revision 00f4c8bed7990ebaff8e20bd13b5dbdacbe22c29
1 2/* 3 * Copyright (C) Texas Instruments - http://www.ti.com/ 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21#ifndef OMX_WBAMR_DEC_UTILS__H 22#define OMX_WBAMR_DEC_UTILS__H 23 24#include <OMX_Component.h> 25#include "OMX_TI_Common.h" 26#include "OMX_WbAmrDecoder.h" 27/* #include <ResourceManagerProxyAPI.h> */ 28 29 30 31/* ======================================================================= */ 32/** 33 * @def WBAMR_DEC__XXX_VER Component version 34 */ 35/* ======================================================================= */ 36#define WBAMR_DEC_MAJOR_VER 0xF1 37#define WBAMR_DEC_MINOR_VER 0xF2 38/* ======================================================================= */ 39/** 40 * @def WBAMR_DEC_NOT_USED Defines a value for "don't care" parameters 41 */ 42/* ======================================================================= */ 43#define WBAMR_DEC_NOT_USED 10 44/* ======================================================================= */ 45/** 46 * @def WBAMR_DEC_NORMAL_BUFFER Defines the flag value with all flags turned off 47 */ 48/* ======================================================================= */ 49#define WBAMR_DEC_NORMAL_BUFFER 0 50/* ======================================================================= */ 51/** 52 * @def OMX_WBAMR_DEC_DEFAULT_SEGMENT Default segment ID for the LCML 53 */ 54/* ======================================================================= */ 55#define OMX_WBAMR_DEC_DEFAULT_SEGMENT (0) 56/* ======================================================================= */ 57/** 58 * @def OMX_WBAMR_DEC_SN_TIMEOUT Timeout value for the socket node 59 */ 60/* ======================================================================= */ 61#define OMX_WBAMR_DEC_SN_TIMEOUT (-1) 62/* ======================================================================= */ 63/** 64 * @def OMX_WBAMR_DEC_SN_PRIORITY Priority for the socket node 65 */ 66/* ======================================================================= */ 67#define OMX_WBAMR_DEC_SN_PRIORITY (10) 68/* ======================================================================= */ 69/** 70 * @def OMX_WBAMR_DEC_NUM_DLLS number of DLL's 71 */ 72 /* =================================================================================== */ 73/* 74* Different Frame sizes 75*/ 76/* ================================================================================== */ 77#define WBAMR_DEC_FRAME_SIZE_18 18 78#define WBAMR_DEC_FRAME_SIZE_23 23 79#define WBAMR_DEC_FRAME_SIZE_24 24 80#define WBAMR_DEC_FRAME_SIZE_33 33 81#define WBAMR_DEC_FRAME_SIZE_37 37 82#define WBAMR_DEC_FRAME_SIZE_41 41 83#define WBAMR_DEC_FRAME_SIZE_47 47 84#define WBAMR_DEC_FRAME_SIZE_51 51 85#define WBAMR_DEC_FRAME_SIZE_59 59 86#define WBAMR_DEC_FRAME_SIZE_61 61 87#define WBAMR_DEC_FRAME_SIZE_6 6 88#define WBAMR_DEC_FRAME_SIZE_1 1 89#define WBAMR_DEC_FRAME_SIZE_0 0 90 91#define WBAMRDEC_APP_ID 100 92 93 94 /* ======================================================================= */ 95/** 96 * @def INPUT_WBAMRDEC_BUFFER_SIZE_IF2 Default input buffer size IF2 97 * 98 */ 99/* ======================================================================= */ 100#define INPUT_WBAMRDEC_BUFFER_SIZE_IF2 61 101 102/* ======================================================================= */ 103/** WBAMRENC_MimeMode format types 104* 105* @param WBAMRENC_MIMEMODE MIME 106* 107* @param WBAMRENC_NONMIMEMODE WBAMR mode 108* 109*/ 110/* ======================================================================= */ 111enum WBAMRDEC_MimeMode { 112 WBAMRDEC_FORMATCONFORMANCE = 0, 113 WBAMRDEC_MIMEMODE, 114 WBAMRDEC_IF2 115}; 116 117/* ======================================================================= */ 118#define OMX_WBAMR_DEC_NUM_DLLS (2) 119/* ======================================================================= */ 120/** 121 * @def WBAMR_DEC_USN_DLL_NAME USN DLL name 122 */ 123/* ======================================================================= */ 124#ifdef UNDER_CE 125#define WBAMR_DEC_USN_DLL_NAME "\\windows\\usn.dll64P" 126#else 127#define WBAMR_DEC_USN_DLL_NAME "usn.dll64P" 128#endif 129 130/* ======================================================================= */ 131/** 132 * @def WBAMR_DEC_DLL_NAME WB AMR Decoder socket node dll name 133 */ 134/* ======================================================================= */ 135#ifdef UNDER_CE 136#define WBAMR_DEC_DLL_NAME "\\windows\\wbamrdec_sn.dll64P" 137#else 138#define WBAMR_DEC_DLL_NAME "wbamrdec_sn.dll64P" 139#endif 140 141 142/* =========================================================== */ 143/** 144* WBAMR_DEC_StartComponentThread() Starts component thread 145* 146* 147* @param hComp OMX Handle 148* 149* @return OMX_ErrorNone = Successful 150* Other error code = fail 151* 152*/ 153/*================================================================== */ 154OMX_ERRORTYPE WBAMR_DEC_StartComponentThread(OMX_HANDLETYPE pHandle); 155/* =========================================================== */ 156/** 157* WBAMR_DEC_StopComponentThread() Stops component thread 158* 159* 160* @param hComp OMX Handle 161* 162* @return OMX_ErrorNone = Successful 163* Other error code = fail 164* 165*/ 166/*================================================================== */ 167OMX_ERRORTYPE WBAMR_DEC_StopComponentThread(OMX_HANDLETYPE pHandle); 168/* =========================================================== */ 169/** 170* WBAMR_DEC_FreeCompResources() Frees allocated memory 171* 172* 173* @param hComp OMX Handle 174* 175* @return OMX_ErrorNone = Successful 176* Other error code = fail 177* 178*/ 179/*================================================================== */ 180OMX_ERRORTYPE WBAMR_DEC_FreeCompResources(OMX_HANDLETYPE pComponent); 181/* =========================================================== */ 182/** 183* WBAMR_DEC_GetCorresponding_LCMLHeader() Returns LCML header 184* that corresponds to the given buffer 185* 186* @param pComponentPrivate Component private data 187* 188* @return OMX_ErrorNone = Successful 189* Other error code = fail 190*/ 191/*================================================================== */ 192OMX_ERRORTYPE WBAMR_DEC_GetCorresponding_LCMLHeader(WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate, 193 OMX_U8 *pBuffer, 194 OMX_DIRTYPE eDir, 195 LCML_WBAMR_DEC_BUFHEADERTYPE **ppLcmlHdr); 196/* =========================================================== */ 197/** 198* WBAMR_DEC_LCML_Callback() Callback from LCML 199* 200* @param event Codec Event 201* 202* @param args Arguments from LCML 203* 204* @return OMX_ErrorNone = Successful 205* Other error code = fail 206*/ 207/*================================================================== */ 208OMX_ERRORTYPE WBAMR_DEC_LCML_Callback (TUsnCodecEvent event,void * args [10]); 209/* =========================================================== */ 210/** 211* WBAMR_DEC_Fill_LCMLInitParams() Fills the parameters needed 212* to initialize the LCML 213* 214* @param pHandle OMX Handle 215* 216* @param plcml_Init LCML initialization parameters 217* 218* @return OMX_ErrorNone = Successful 219* Other error code = fail 220* 221*/ 222/*================================================================== */ 223OMX_ERRORTYPE WBAMR_DEC_Fill_LCMLInitParams(OMX_HANDLETYPE pHandle, 224 LCML_DSP *plcml_Init,OMX_U16 arr[]); 225/* =========================================================== */ 226/** 227* WBAMR_DEC_GetBufferDirection() Returns direction of pBufHeader 228* 229* @param pBufHeader Buffer header 230* 231* @param eDir Buffer direction 232* 233* @param pComponentPrivate Component private data 234* 235* @return OMX_ErrorNone = Successful 236* Other error code = fail 237*/ 238/*================================================================== */ 239OMX_ERRORTYPE WBAMR_DEC_GetBufferDirection(OMX_BUFFERHEADERTYPE *pBufHeader, OMX_DIRTYPE *eDir); 240/* =========================================================== */ 241/** 242* WBAMR_DEC_HandleCommand() Handles commands sent via SendCommand() 243* 244* @param pComponentPrivate Component private data 245* 246* @return OMX_ErrorNone = Successful 247* Other error code = fail 248* @return OMX_ErrorNone = Successful 249* Other error code = fail 250*/ 251/*================================================================== */ 252OMX_U32 WBAMR_DEC_HandleCommand (WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate); 253/* =========================================================== */ 254/** 255* WBAMR_DEC_HandleDataBuf_FromApp() Handles data buffers received 256* from the IL Client 257* 258* @param pComponentPrivate Component private data 259* 260* @return OMX_ErrorNone = Successful 261* Other error code = fail 262* @return OMX_ErrorNone = Successful 263* Other error code = fail 264*/ 265/*================================================================== */ 266OMX_ERRORTYPE WBAMR_DEC_HandleDataBuf_FromApp(OMX_BUFFERHEADERTYPE *pBufHeader, 267 WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate); 268/* =========================================================== */ 269/** 270* WBAMR_DEC_GetLCMLHandle() Get the handle to the LCML 271* 272* 273* @return OMX_ErrorNone = Successful 274* Other error code = fail 275*/ 276/*================================================================== */ 277OMX_HANDLETYPE WBAMR_DEC_GetLCMLHandle(WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate); 278/* =========================================================== */ 279/** 280* WBAMR_DEC_FreeLCMLHandle() Frees the handle to the LCML 281* 282* 283* @return OMX_ErrorNone = Successful 284* Other error code = fail 285*/ 286/*================================================================== */ 287OMX_ERRORTYPE WBAMR_DEC_FreeLCMLHandle(WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate); 288/* =========================================================== */ 289/** 290* WBAMR_DEC_CleanupInitParams() Starts component thread 291* 292* @param pComponent OMX Handle 293* 294* @return OMX_ErrorNone = Successful 295* Other error code = fail 296*/ 297/*================================================================== */ 298OMX_ERRORTYPE WBAMR_DEC_CleanupInitParams(OMX_HANDLETYPE pComponent); 299/* =========================================================== */ 300/** 301* WBAMR_DEC_SetPending() Called when the component queues a buffer 302* to the LCML 303* 304* @param pComponentPrivate Component private data 305* 306* @param pBufHdr Buffer header 307* 308* @param eDir Direction of the buffer 309* 310* @return None 311*/ 312/*================================================================== */ 313void WBAMR_DEC_SetPending(WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_BUFFERHEADERTYPE *pBufHdr, OMX_DIRTYPE eDir, OMX_U32 lineNumber); 314/* =========================================================== */ 315/** 316* WBAMR_DEC_ClearPending() Called when a buffer is returned 317* from the LCML 318* 319* @param pComponentPrivate Component private data 320* 321* @param pBufHdr Buffer header 322* 323* @param eDir Direction of the buffer 324* 325* @return None 326*/ 327/*================================================================== */ 328void WBAMR_DEC_ClearPending(WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_BUFFERHEADERTYPE *pBufHdr, OMX_DIRTYPE eDir, OMX_U32 lineNumber) ; 329/* =========================================================== */ 330/** 331* WMADEC_IsPending() 332* 333* 334* @param pComponentPrivate Component private data 335* 336* @return OMX_ErrorNone = Successful 337* Other error code = fail 338*/ 339/*================================================================== */ 340OMX_U32 WBAMR_DEC_IsPending(WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_BUFFERHEADERTYPE *pBufHdr, OMX_DIRTYPE eDir); 341/* =========================================================== */ 342/** 343* WMADEC_Fill_LCMLInitParamsEx() Fills the parameters needed 344* to initialize the LCML without recreating the socket node 345* 346* @param pComponent OMX Handle 347* 348* @return None 349*/ 350 351/*================================================================== */ 352OMX_ERRORTYPE WBAMR_DEC_Fill_LCMLInitParamsEx(OMX_HANDLETYPE pComponent); 353/* =========================================================== */ 354/** 355* WMADEC_IsValid() Returns whether a buffer is valid 356* 357* 358* @param pComponentPrivate Component private data 359* 360* @param pBuffer Data buffer 361* 362* @param eDir Buffer direction 363* 364* @return OMX_True = Valid 365* OMX_False= Invalid 366*/ 367/*================================================================== */ 368OMX_U32 WBAMR_DEC_IsValid(WBAMR_DEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_U8 *pBuffer, OMX_DIRTYPE eDir) ; 369 370/* void WBAMRDEC_ResourceManagerCallback(RMPROXY_COMMANDDATATYPE cbData); */ 371 372OMX_ERRORTYPE OMX_DmmMap(DSP_HPROCESSOR ProcHandle, int size, void* pArmPtr, DMM_BUFFER_OBJ* pDmmBuf, struct OMX_TI_Debug dbg); 373 374OMX_ERRORTYPE OMX_DmmUnMap(DSP_HPROCESSOR ProcHandle, void* pMapPtr, void* pResPtr, struct OMX_TI_Debug dbg); 375 376#ifdef UNDER_CE 377 #ifndef _OMX_EVENT_ 378 #define _OMX_EVENT_ 379 typedef struct OMX_Event { 380 HANDLE event; 381 } OMX_Event; 382 #endif 383 int OMX_CreateEvent(OMX_Event *event); 384 int OMX_SignalEvent(OMX_Event *event); 385 int OMX_WaitForEvent(OMX_Event *event); 386 int OMX_DestroyEvent(OMX_Event *event); 387#endif 388 389#endif 390