OpenMAXBellagio  0.9.3
omx_base_component.h
Go to the documentation of this file.
1 
26 #ifndef _OMX_BASE_COMPONENT_H_
27 #define _OMX_BASE_COMPONENT_H_
28 
29 #include <stdlib.h>
30 #include <pthread.h>
31 #include <stdio.h>
32 #include <string.h>
33 #include <unistd.h>
34 #include <errno.h>
35 #include <asm/unistd.h>
36 
37 #ifdef ANDROID_COMPILATION
38 #include <oscl_base_macros.h>
39 #else
40 #define OSCL_IMPORT_REF
41 #define OSCL_EXPORT_REF
42 #endif
43 #include "omxcore.h"
44 #include "OMXComponentRMExt.h"
45 #include "tsemaphore.h"
46 #include "queue.h"
47 #include "omx_classmagic.h"
48 #include "omx_base_port.h"
49 #include "extension_struct.h"
51 
52 
54 #define DEFAULT_IN_BUFFER_SIZE 4 * 1024
55 
56 #define DEFAULT_OUT_BUFFER_SIZE 32 * 1024 /*16 * 1024 */ // TODO - check this size is ok
57 
58 #define DEFAULT_MIME_STRING_LENGTH 128
59 
60 #define NUM_DOMAINS 4
61 
62 #define OMX_BUFFERFLAG_KEY_FRAME 0x11000000
63 
64 typedef struct OMX_VENDOR_EXTRADATATYPE {
66  OMX_U32 nDataSize; // Size of the supporting data to follow
67  OMX_U8 *pData; // Supporting data hint
69 
72  OMX_TUNNELSETUPTYPE nTunnelSetup; // Tunnel setup flags
74 
76 typedef enum OMX_INDEXVENDORTYPE {
80  OMX_IndexVendorCompPropTunnelFlags, /* Will use OMX_TUNNELSETUPTYPE structure*/
84 
86 typedef enum OMX_TRANS_STATETYPE {
96  OMX_TransStateMax = 0X7FFFFFFF
98 
102 typedef enum INTERNAL_MESSAGE_TYPE {
107 
118 
123 #define omx_base_component_PrivateType_FIELDS \
124  OMX_COMPONENTTYPE *openmaxStandComp; \
125  omx_base_PortType **ports; \
126  OMX_PORT_PARAM_TYPE sPortTypesParam[NUM_DOMAINS]; \
127  char uniqueID; \
128  char* name; \
129  OMX_STATETYPE state; \
130  OMX_TRANS_STATETYPE transientState; \
135  OMX_CALLBACKTYPE* callbacks; \
137  OMX_PTR callbackData; \
139  queue_t* messageQueue;\
140  tsem_t* messageSem;\
141  OMX_U32 nGroupPriority; \
142  OMX_U32 nGroupID; \
143  OMX_PARAM_BELLAGIOTHREADS_ID* bellagioThreads;\
144  OMX_BOOL bIsEOSReached; \
145  OMX_MARKTYPE pMark; \
146  pthread_mutex_t flush_mutex; \
147  tsem_t* flush_all_condition; \
148  tsem_t* flush_condition; \
149  tsem_t* bMgmtSem;\
150  tsem_t* bStateSem;\
151  pthread_t messageHandlerThread; \
152  int bufferMgmtThreadID; \
153  pthread_t bufferMgmtThread; \
154  void *loader; \
155  void* (*BufferMgmtFunction)(void* param); \
156  OMX_ERRORTYPE (*messageHandler)(OMX_COMPONENTTYPE*,internalRequestMessageType*); \
157  OMX_ERRORTYPE (*DoStateSet)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32); \
158  OMX_ERRORTYPE (*destructor)(OMX_COMPONENTTYPE *openmaxStandComp); \
159  OMX_ERRORTYPE (*getQualityLevel)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32* pQualityLevel); \
160  OMX_ERRORTYPE (*setQualityLevel)(OMX_COMPONENTTYPE *openmaxStandComp, OMX_U32 nQualityLevel); \
161  OMX_U32 nqualitylevels; \
162  multiResourceDescriptor** multiResourceLevel; \
163  int currentQualityLevel;
164 ENDCLASS(omx_base_component_PrivateType)
165 
167 
185 
194 
197 
209  OMX_COMPONENTTYPE *openmaxStandComp,
210  OMX_U32 destinationState);
211 
224 
232 void setHeader(OMX_PTR header, OMX_U32 size);
233 
239  OMX_HANDLETYPE hComponent,
240  OMX_STRING pComponentName,
241  OMX_VERSIONTYPE* pComponentVersion,
242  OMX_VERSIONTYPE* pSpecVersion,
243  OMX_UUIDTYPE* pComponentUUID);
244 
258  OMX_HANDLETYPE hComponent,
259  OMX_U8 *cRole,
260  OMX_U32 nIndex);
261 
268  OMX_HANDLETYPE hComponent,
269  OMX_CALLBACKTYPE* pCallbacks,
270  OMX_PTR pAppData);
271 
279  OMX_HANDLETYPE hComponent,
280  OMX_INDEXTYPE nParamIndex,
281  OMX_PTR ComponentParameterStructure);
282 
292  OMX_HANDLETYPE hComponent,
293  OMX_INDEXTYPE nParamIndex,
294  OMX_PTR ComponentParameterStructure);
295 
304  OMX_HANDLETYPE hComponent,
305  OMX_INDEXTYPE nIndex,
306  OMX_PTR pComponentConfigStructure);
307 
316  OMX_HANDLETYPE hComponent,
317  OMX_INDEXTYPE nIndex,
318  OMX_PTR pComponentConfigStructure);
319 
326  OMX_HANDLETYPE hComponent,
327  OMX_STRING cParameterName,
328  OMX_INDEXTYPE* pIndexType);
329 
335  OMX_HANDLETYPE hComponent,
336  OMX_STATETYPE* pState);
337 
344  OMX_HANDLETYPE hComponent,
345  OMX_COMMANDTYPE Cmd,
346  OMX_U32 nParam,
347  OMX_PTR pCmdData);
348 
358  OMX_HANDLETYPE hComponent);
359 
366 void* compMessageHandlerFunction(void*);
367 
380 
385  OMX_HANDLETYPE hComponent,
386  OMX_U32 nPortIndex,
387  OMX_PTR pStructure,
388  size_t size);
389 
391  OMX_HANDLETYPE hComponent,
392  OMX_BUFFERHEADERTYPE** ppBuffer,
393  OMX_U32 nPortIndex,
394  OMX_PTR pAppPrivate,
395  OMX_U32 nSizeBytes);
396 
398  OMX_HANDLETYPE hComponent,
399  OMX_BUFFERHEADERTYPE** ppBufferHdr,
400  OMX_U32 nPortIndex,
401  OMX_PTR pAppPrivate,
402  OMX_U32 nSizeBytes,
403  OMX_U8* pBuffer);
404 
406  OMX_HANDLETYPE hComponent,
407  OMX_BUFFERHEADERTYPE** ppBufferHdr,
408  OMX_U32 nPortIndex,
409  OMX_PTR pAppPrivate,
410  void* eglImage);
411 
413  OMX_HANDLETYPE hComponent,
414  OMX_U32 nPortIndex,
415  OMX_BUFFERHEADERTYPE* pBuffer);
416 
418  OMX_HANDLETYPE hComponent,
419  OMX_BUFFERHEADERTYPE* pBuffer);
420 
422  OMX_HANDLETYPE hComponent,
423  OMX_BUFFERHEADERTYPE* pBuffer);
424 
426  OMX_HANDLETYPE hComp,
427  OMX_U32 nPort,
428  OMX_HANDLETYPE hTunneledComp,
429  OMX_U32 nTunneledPort,
430  OMX_TUNNELSETUPTYPE* pTunnelSetup);
431 
432 #endif

Generated for OpenMAX Bellagio rel. 0.9.3 by  doxygen 1.5.1
SourceForge.net Logo