00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00029 #ifndef OMX_Core_h
00030 #define OMX_Core_h
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00036
00037
00038
00039
00040
00041
00042 #include <OMX_Index.h>
00043
00044
00049 typedef enum OMX_COMMANDTYPE
00050 {
00051 OMX_CommandStateSet,
00052 OMX_CommandFlush,
00053 OMX_CommandPortDisable,
00054 OMX_CommandPortEnable,
00055 OMX_CommandMarkBuffer,
00056 OMX_CommandMax = 0X7FFFFFFF
00057 } OMX_COMMANDTYPE;
00058
00059
00060
00090 typedef enum OMX_STATETYPE
00091 {
00092 OMX_StateInvalid,
00095 OMX_StateLoaded,
00100 OMX_StateIdle,
00103 OMX_StateExecuting,
00105 OMX_StatePause,
00106 OMX_StateWaitForResources,
00109 OMX_StateMax = 0X7FFFFFFF
00110 } OMX_STATETYPE;
00111
00122 typedef enum OMX_ERRORTYPE
00123 {
00124 OMX_ErrorNone = 0,
00125
00127 OMX_ErrorInsufficientResources = 0x80001000,
00128
00130 OMX_ErrorUndefined = 0x80001001,
00131
00133 OMX_ErrorInvalidComponentName = 0x80001002,
00134
00136 OMX_ErrorComponentNotFound = 0x80001003,
00137
00140 OMX_ErrorInvalidComponent = 0x80001004,
00141
00143 OMX_ErrorBadParameter = 0x80001005,
00144
00146 OMX_ErrorNotImplemented = 0x80001006,
00147
00149 OMX_ErrorUnderflow = 0x80001007,
00150
00152 OMX_ErrorOverflow = 0x80001008,
00153
00155 OMX_ErrorHardware = 0x80001009,
00156
00158 OMX_ErrorInvalidState = 0x8000100A,
00159
00161 OMX_ErrorStreamCorrupt = 0x8000100B,
00162
00164 OMX_ErrorPortsNotCompatible = 0x8000100C,
00165
00168 OMX_ErrorResourcesLost = 0x8000100D,
00169
00171 OMX_ErrorNoMore = 0x8000100E,
00172
00174 OMX_ErrorVersionMismatch = 0x8000100F,
00175
00177 OMX_ErrorNotReady = 0x80001010,
00178
00180 OMX_ErrorTimeout = 0x80001011,
00181
00183 OMX_ErrorSameState = 0x80001012,
00184
00187 OMX_ErrorResourcesPreempted = 0x80001013,
00188
00193 OMX_ErrorPortUnresponsiveDuringAllocation = 0x80001014,
00194
00199 OMX_ErrorPortUnresponsiveDuringDeallocation = 0x80001015,
00200
00205 OMX_ErrorPortUnresponsiveDuringStop = 0x80001016,
00206
00208 OMX_ErrorIncorrectStateTransition = 0x80001017,
00209
00210
00211 OMX_ErrorIncorrectStateOperation = 0x80001018,
00212
00214 OMX_ErrorUnsupportedSetting = 0x80001019,
00215
00217 OMX_ErrorUnsupportedIndex = 0x8000101A,
00218
00220 OMX_ErrorBadPortIndex = 0x8000101B,
00221
00223 OMX_ErrorPortUnpopulated = 0x8000101C,
00224
00226 OMX_ErrorComponentSuspended = 0x8000101D,
00227
00229 OMX_ErrorDynamicResourcesUnavailable = 0x8000101E,
00230
00233 OMX_ErrorMbErrorsInFrame = 0x8000101F,
00234
00236 OMX_ErrorFormatNotDetected = 0x80001020,
00237
00239 OMX_ErrorContentPipeOpenFailed = 0x80001021,
00240
00242 OMX_ErrorContentPipeCreationFailed = 0x80001022,
00243
00245 OMX_ErrorSeperateTablesUsed = 0x80001023,
00246
00248 OMX_ErrorTunnelingUnsupported = 0x80001024,
00249
00250 OMX_ErrorMax = 0x7FFFFFFF,
00251 } OMX_ERRORTYPE;
00252
00254 typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent);
00255
00257 typedef struct OMX_COMPONENTREGISTERTYPE
00258 {
00259 const char * pName;
00260 OMX_COMPONENTINITTYPE pInitialize;
00261 } OMX_COMPONENTREGISTERTYPE;
00262
00264 extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
00265
00267 typedef struct OMX_PRIORITYMGMTTYPE {
00268 OMX_U32 nSize;
00269 OMX_VERSIONTYPE nVersion;
00270 OMX_U32 nGroupPriority;
00271 OMX_U32 nGroupID;
00272 } OMX_PRIORITYMGMTTYPE;
00273
00274
00275 #define OMX_MAX_STRINGNAME_SIZE 128
00276
00278 typedef struct OMX_PARAM_COMPONENTROLETYPE {
00279 OMX_U32 nSize;
00280 OMX_VERSIONTYPE nVersion;
00281 OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE];
00282 } OMX_PARAM_COMPONENTROLETYPE;
00283
00293 #define OMX_BUFFERFLAG_EOS 0x00000001
00294
00320 #define OMX_BUFFERFLAG_STARTTIME 0x00000002
00321
00322
00323
00343 #define OMX_BUFFERFLAG_DECODEONLY 0x00000004
00344
00345
00346
00347
00348
00349
00350 #define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
00351
00352
00353
00354
00355
00356
00357 #define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
00358
00359
00360
00361
00362
00363 #define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
00364
00365
00366
00367
00368
00369 #define OMX_BUFFERFLAG_EXTRADATA 0x00000040
00370
00372 typedef struct OMX_BUFFERHEADERTYPE
00373 {
00374 OMX_U32 nSize;
00375 OMX_VERSIONTYPE nVersion;
00376 OMX_U8* pBuffer;
00378 OMX_U32 nAllocLen;
00379 OMX_U32 nFilledLen;
00381 OMX_U32 nOffset;
00383 OMX_PTR pAppPrivate;
00385 OMX_PTR pPlatformPrivate;
00387 OMX_PTR pInputPortPrivate;
00389 OMX_PTR pOutputPortPrivate;
00391 OMX_HANDLETYPE hMarkTargetComponent;
00393 OMX_PTR pMarkData;
00396 OMX_U32 nTickCount;
00405 OMX_TICKS nTimeStamp;
00412 OMX_U32 nFlags;
00413 OMX_U32 nOutputPortIndex;
00415 OMX_U32 nInputPortIndex;
00417 } OMX_BUFFERHEADERTYPE;
00418
00419
00420
00421
00422 #define OMX_EXTRADATAFLAG_QUANT 0x00000001
00423
00424 typedef struct OMX_OTHER_EXTRADATATYPE {
00425 OMX_U32 nSize;
00426 OMX_VERSIONTYPE nVersion;
00427 OMX_U32 nPortIndex;
00428 OMX_U32 nFlags;
00429 OMX_U32 nDataSize;
00430 OMX_U8 data[1];
00431 } OMX_OTHER_EXTRADATATYPE;
00432
00434 typedef struct OMX_PORT_PARAM_TYPE {
00435 OMX_U32 nSize;
00436 OMX_VERSIONTYPE nVersion;
00437 OMX_U32 nPorts;
00438 OMX_U32 nStartPortNumber;
00439 } OMX_PORT_PARAM_TYPE;
00440
00442 typedef enum OMX_EVENTTYPE
00443 {
00444 OMX_EventCmdComplete,
00445 OMX_EventError,
00446 OMX_EventMark,
00447 OMX_EventPortSettingsChanged,
00448 OMX_EventBufferFlag,
00449 OMX_EventResourcesAcquired,
00452 OMX_EventComponentResumed,
00453 OMX_EventDynamicResourcesAvailable,
00454 OMX_EventPortFormatDetected,
00455 OMX_EventMax = 0x7FFFFFFF
00456 } OMX_EVENTTYPE;
00457
00458 typedef struct OMX_CALLBACKTYPE
00459 {
00491 OMX_ERRORTYPE (*EventHandler)(
00492 OMX_IN OMX_HANDLETYPE hComponent,
00493 OMX_IN OMX_PTR pAppData,
00494 OMX_IN OMX_EVENTTYPE eEvent,
00495 OMX_IN OMX_U32 nData1,
00496 OMX_IN OMX_U32 nData2,
00497 OMX_IN OMX_PTR pEventData);
00498
00521 OMX_ERRORTYPE (*EmptyBufferDone)(
00522 OMX_IN OMX_HANDLETYPE hComponent,
00523 OMX_IN OMX_PTR pAppData,
00524 OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
00525
00550 OMX_ERRORTYPE (*FillBufferDone)(
00551 OMX_OUT OMX_HANDLETYPE hComponent,
00552 OMX_OUT OMX_PTR pAppData,
00553 OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
00554
00555 } OMX_CALLBACKTYPE;
00556
00561 typedef enum OMX_BUFFERSUPPLIERTYPE
00562 {
00563 OMX_BufferSupplyUnspecified = 0x0,
00565 OMX_BufferSupplyInput,
00566 OMX_BufferSupplyOutput,
00567 OMX_BufferSupplyMax = 0x7FFFFFFF
00568 } OMX_BUFFERSUPPLIERTYPE;
00569
00570
00574 typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
00575 OMX_U32 nSize;
00576 OMX_VERSIONTYPE nVersion;
00577 OMX_U32 nPortIndex;
00578 OMX_BUFFERSUPPLIERTYPE eBufferSupplier;
00579 } OMX_PARAM_BUFFERSUPPLIERTYPE;
00580
00581
00586 #define OMX_PORTTUNNELFLAG_READONLY 0x00000001
00587
00588
00594 typedef struct OMX_TUNNELSETUPTYPE
00595 {
00596 OMX_U32 nTunnelFlags;
00597 OMX_BUFFERSUPPLIERTYPE eSupplier;
00598 } OMX_TUNNELSETUPTYPE;
00599
00600
00601
00602
00603
00604
00605
00643 #define OMX_GetComponentVersion( \
00644 hComponent, \
00645 pComponentName, \
00646 pComponentVersion, \
00647 pSpecVersion, \
00648 pComponentUUID) \
00649 ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \
00650 hComponent, \
00651 pComponentName, \
00652 pComponentVersion, \
00653 pSpecVersion, \
00654 pComponentUUID)
00655
00656
00704 #define OMX_SendCommand( \
00705 hComponent, \
00706 Cmd, \
00707 nParam, \
00708 pCmdData) \
00709 ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \
00710 hComponent, \
00711 Cmd, \
00712 nParam, \
00713 pCmdData)
00714
00715
00745 #define OMX_GetParameter( \
00746 hComponent, \
00747 nParamIndex, \
00748 pComponentParameterStructure) \
00749 ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \
00750 hComponent, \
00751 nParamIndex, \
00752 pComponentParameterStructure)
00753
00754
00784 #define OMX_SetParameter( \
00785 hComponent, \
00786 nParamIndex, \
00787 pComponentParameterStructure) \
00788 ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \
00789 hComponent, \
00790 nParamIndex, \
00791 pComponentParameterStructure)
00792
00793
00820 #define OMX_GetConfig( \
00821 hComponent, \
00822 nConfigIndex, \
00823 pComponentConfigStructure) \
00824 ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \
00825 hComponent, \
00826 nConfigIndex, \
00827 pComponentConfigStructure)
00828
00829
00856 #define OMX_SetConfig( \
00857 hComponent, \
00858 nConfigIndex, \
00859 pComponentConfigStructure) \
00860 ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \
00861 hComponent, \
00862 nConfigIndex, \
00863 pComponentConfigStructure)
00864
00865
00890 #define OMX_GetExtensionIndex( \
00891 hComponent, \
00892 cParameterName, \
00893 pIndexType) \
00894 ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \
00895 hComponent, \
00896 cParameterName, \
00897 pIndexType)
00898
00899
00917 #define OMX_GetState( \
00918 hComponent, \
00919 pState) \
00920 ((OMX_COMPONENTTYPE*)hComponent)->GetState( \
00921 hComponent, \
00922 pState)
00923
00924
00944 #define OMX_UseBuffer( \
00945 hComponent, \
00946 ppBufferHdr, \
00947 nPortIndex, \
00948 pAppPrivate, \
00949 nSizeBytes, \
00950 pBuffer) \
00951 ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \
00952 hComponent, \
00953 ppBufferHdr, \
00954 nPortIndex, \
00955 pAppPrivate, \
00956 nSizeBytes, \
00957 pBuffer)
00958
00959
00987 #define OMX_AllocateBuffer( \
00988 hComponent, \
00989 ppBuffer, \
00990 nPortIndex, \
00991 pAppPrivate, \
00992 nSizeBytes) \
00993 ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \
00994 hComponent, \
00995 ppBuffer, \
00996 nPortIndex, \
00997 pAppPrivate, \
00998 nSizeBytes)
00999
01000
01023 #define OMX_FreeBuffer( \
01024 hComponent, \
01025 nPortIndex, \
01026 pBuffer) \
01027 ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \
01028 hComponent, \
01029 nPortIndex, \
01030 pBuffer)
01031
01032
01055 #define OMX_EmptyThisBuffer( \
01056 hComponent, \
01057 pBuffer) \
01058 ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \
01059 hComponent, \
01060 pBuffer)
01061
01062
01085 #define OMX_FillThisBuffer( \
01086 hComponent, \
01087 pBuffer) \
01088 ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \
01089 hComponent, \
01090 pBuffer)
01091
01092
01093
01124 #define OMX_UseEGLImage( \
01125 hComponent, \
01126 ppBufferHdr, \
01127 nPortIndex, \
01128 pAppPrivate, \
01129 eglImage) \
01130 ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \
01131 hComponent, \
01132 ppBufferHdr, \
01133 nPortIndex, \
01134 pAppPrivate, \
01135 eglImage)
01136
01148 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
01149
01150
01163 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
01164
01165
01203 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
01204 OMX_OUT OMX_STRING cComponentName,
01205 OMX_IN OMX_U32 nNameLength,
01206 OMX_IN OMX_U32 nIndex);
01207
01208
01236 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
01237 OMX_OUT OMX_HANDLETYPE* pHandle,
01238 OMX_IN OMX_STRING cComponentName,
01239 OMX_IN OMX_PTR pAppData,
01240 OMX_IN OMX_CALLBACKTYPE* pCallBacks);
01241
01242
01258 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
01259 OMX_IN OMX_HANDLETYPE hComponent);
01260
01261
01262
01311 OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
01312 OMX_IN OMX_HANDLETYPE hOutput,
01313 OMX_IN OMX_U32 nPortOutput,
01314 OMX_IN OMX_HANDLETYPE hInput,
01315 OMX_IN OMX_U32 nPortInput);
01316
01318 OMX_API OMX_ERRORTYPE OMX_GetContentPipe(
01319 OMX_OUT OMX_HANDLETYPE *hPipe,
01320 OMX_IN OMX_STRING szURI);
01321
01349 OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
01350 OMX_IN OMX_STRING role,
01351 OMX_INOUT OMX_U32 *pNumComps,
01352 OMX_INOUT OMX_U8 **compNames);
01353
01379 OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
01380 OMX_IN OMX_STRING compName,
01381 OMX_INOUT OMX_U32 *pNumRoles,
01382 OMX_OUT OMX_U8 **roles);
01383
01384 #ifdef __cplusplus
01385 }
01386 #endif
01387
01388 #endif
01389
01390