29 #define DEFAULT_WIDTH 352 30 #define DEFAULT_HEIGHT 288 31 #define CLOCKPORT_INDEX 2 34 #define DEFAULT_VIDEO_INPUT_BUF_SIZE DEFAULT_WIDTH*DEFAULT_HEIGHT*3/2 42 omx_video_scheduler_component_PrivateType* omx_video_scheduler_component_Private;
50 openmaxStandComp->
pComponentPrivate = calloc(1,
sizeof(omx_video_scheduler_component_PrivateType));
59 omx_video_scheduler_component_Private->ports = NULL;
66 omx_video_scheduler_component_Private->sPortTypesParam[
OMX_PortDomainVideo].nStartPortNumber = 0;
75 && !omx_video_scheduler_component_Private->ports) {
76 omx_video_scheduler_component_Private->ports = calloc((omx_video_scheduler_component_Private->sPortTypesParam[
OMX_PortDomainVideo].nPorts
79 if (!omx_video_scheduler_component_Private->ports) {
82 for (i=0; i < omx_video_scheduler_component_Private->sPortTypesParam[
OMX_PortDomainVideo].nPorts; i++) {
84 if (!omx_video_scheduler_component_Private->ports[i]) {
126 omx_video_scheduler_component_Private->currentQualityLevel = 1;
130 omx_video_scheduler_component_Private->multiResourceLevel[i]->CPUResourceRequested = videoSchedQualityLevels[i * 2];
131 omx_video_scheduler_component_Private->multiResourceLevel[i]->MemoryResourceRequested = videoSchedQualityLevels[i * 2 + 1];
140 omx_video_scheduler_component_PrivateType* omx_video_scheduler_component_Private = openmaxStandComp->
pComponentPrivate;
146 if (omx_video_scheduler_component_Private->ports) {
147 for(i=0; i < (omx_video_scheduler_component_Private->sPortTypesParam[
OMX_PortDomainVideo].nPorts +
148 omx_video_scheduler_component_Private->sPortTypesParam[
OMX_PortDomainOther].nPorts); i++) {
149 if(omx_video_scheduler_component_Private->ports[i])
150 omx_video_scheduler_component_Private->ports[i]->PortDestructor(omx_video_scheduler_component_Private->ports[i]);
152 free(omx_video_scheduler_component_Private->ports);
153 omx_video_scheduler_component_Private->ports=NULL;
185 DEBUG(
DEB_LEV_ERR,
"In %s: wrong port for this operation portIndex=%d port->portIndex=%d\n",
198 DEBUG(
DEB_LEV_ERR,
"In %s: we are not in executing/paused/idle state, but in %d\n", __func__, omx_base_component_Private->
state);
204 DEBUG(
DEB_LEV_ERR,
"In %s: Port %d is disabled comp = %s \n", __func__, (
int)portIndex,omx_base_component_Private->
name);
212 if(pBuffer!=NULL && pBuffer->
pBuffer!=NULL) {
227 DEBUG(
DEB_LEV_ERR,
"In %s: received wrong buffer header on input port\n", __func__);
273 omx_video_scheduler_component_PrivateType* omx_video_scheduler_component_Private,
301 DEBUG(
DEB_LEV_ERR,
"Error %08x In OMX_SetConfig in func=%s \n",err,__func__);
309 omx_video_scheduler_component_Private->eState = pMediaTime->
eState;
310 omx_video_scheduler_component_Private->xScale = pMediaTime->
xScale;
334 DEBUG(
DEB_LEV_ERR,
"Error %08x In OMX_SetConfig in func=%s \n",err,__func__);
336 omx_video_scheduler_component_Private->frameDropFlag =
OMX_TRUE;
337 omx_video_scheduler_component_Private->dropFrameCount = 0;
338 omx_video_scheduler_component_Private->xScale = pMediaTime->
xScale;
346 if(omx_video_scheduler_component_Private->frameDropFlag && omx_video_scheduler_component_Private->dropFrameCount<7) {
347 omx_video_scheduler_component_Private->dropFrameCount ++;
348 if(omx_video_scheduler_component_Private->dropFrameCount==7) {
355 DEBUG(
DEB_LEV_ERR,
"Error %08x In OMX_SetConfig in func=%s \n",err,__func__);
358 omx_video_scheduler_component_Private->frameDropFlag =
OMX_FALSE;
359 omx_video_scheduler_component_Private->dropFrameCount = 0;
376 DEBUG(
DEB_LEV_ERR,
"Error %08x In OMX_SetConfig in func=%s \n",err,__func__);
391 DEBUG(
DEB_LEV_ERR,
"Error %08x In OMX_SetConfig in func=%s \n",err,__func__);
393 omx_video_scheduler_component_Private->frameDropFlag =
OMX_TRUE;
394 omx_video_scheduler_component_Private->dropFrameCount = 0;
395 omx_video_scheduler_component_Private->xScale = pMediaTime->
xScale;
419 omx_video_scheduler_component_PrivateType* omx_video_scheduler_component_Private;
426 omx_video_scheduler_component_Private = ( omx_video_scheduler_component_PrivateType*) omx_base_component_Private;
431 pthread_mutex_lock(&omx_base_component_Private->
flush_mutex);
444 pthread_mutex_unlock(&omx_base_component_Private->
flush_mutex);
497 pthread_mutex_lock(&omx_base_component_Private->
flush_mutex);
499 pthread_mutex_unlock(&omx_base_component_Private->
flush_mutex);
506 DEBUG(
DEB_LEV_PARAMS,
"In %s TFlag=%x Qelem=%d BSem=%d bMgmtsem=%d component=%s\n", __func__,
511 omx_base_component_Private->
name);
522 omx_video_scheduler_component_PrivateType* omx_video_scheduler_component_Private = openmaxStandComp->
pComponentPrivate;
548 OMX_PTR ComponentParameterStructure) {
559 omx_video_scheduler_component_PrivateType* omx_video_scheduler_component_Private = openmaxStandComp->
pComponentPrivate;
563 if (ComponentParameterStructure == NULL) {
568 switch(nParamIndex) {
578 if(portIndex > (omx_video_scheduler_component_Private->sPortTypesParam[
OMX_PortDomainVideo].nPorts +
652 DEBUG(
DEB_LEV_ERR,
"In %s Incorrect State=%x lineno=%d\n",__func__,omx_video_scheduler_component_Private->state,__LINE__);
674 OMX_PTR ComponentParameterStructure) {
680 omx_video_scheduler_component_PrivateType* omx_video_scheduler_component_Private = openmaxStandComp->
pComponentPrivate;
685 if (ComponentParameterStructure == NULL) {
690 switch(nParamIndex) {
OMX_ERRORTYPE omx_video_scheduler_component_SetParameter(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE(* BufferProcessedCallback)(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_base_component_SetParameter(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
Part of the standard OpenMAX function.
OMX_HANDLETYPE hTunneledComponent
OMX_VIDEO_PARAM_PORTFORMATTYPE sVideoParam
OMX_OTHER_FORMATTYPE eFormat
OMX_ERRORTYPE base_video_port_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, omx_base_PortType **openmaxStandPort, OMX_U32 nPortIndex, OMX_BOOL isInput)
The base contructor for the generic OpenMAX ST Video port.
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
OMX_ERRORTYPE omx_base_component_ParameterSanityCheck(OMX_HANDLETYPE hComponent, OMX_U32 nPortIndex, OMX_PTR pStructure, size_t size)
OMX_ERRORTYPE(* GetParameter)(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pComponentParameterStructure)
OMX_U32 nNumAssignedBuffers
OMX_TICKS nMediaTimestamp
OMX_TRANS_STATETYPE transientState
OMX_ERRORTYPE checkHeader(OMX_PTR header, OMX_U32 size)
Checks the header of a structure for consistency with size and spec version.
#define DEB_LEV_SIMPLE_SEQ
#define PORT_IS_TUNNELED_N_BUFFER_SUPPLIER(pPort)
void tsem_signal(tsem_t *tsem)
OMX_ERRORTYPE omx_video_scheduler_component_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
#define PORT_IS_BEING_DISABLED(pPort)
OMX_OTHER_FORMATTYPE eFormat
#define DEBUG(n, fmt, args...)
#define PORT_IS_TUNNELED(pPort)
#define VIDEOSCHED_QUALITY_LEVELS
OMX_ERRORTYPE base_clock_port_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, omx_base_PortType **openmaxStandPort, OMX_U32 nPortIndex, OMX_BOOL isInput)
the base constructor for the generic OpenMAX ST Clock port
OMX_HANDLETYPE hTunneledComponent
#define VIDEO_SCHEDULER_COMP_NAME
OMX_TIME_CLOCKSTATE eState
OMX_ERRORTYPE omx_video_scheduler_component_GetParameter(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
#define OMX_BASE_FILTER_OUTPUTPORT_INDEX
union OMX_PARAM_PORTDEFINITIONTYPE::@0 format
OMX_ERRORTYPE omx_video_scheduler_component_port_FlushProcessingBuffers(omx_base_PortType *openmaxStandPort)
Releases buffers under processing. This function must be implemented in the derived classes...
OMX_ERRORTYPE(* FlushProcessingBuffers)(omx_base_PortType *openmaxStandPort)
OMX_ERRORTYPE(* SetParameter)(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentParameterStructure)
tsem_t * flush_all_condition
OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE sMediaTimeRequest
OMX_OTHER_PARAM_PORTFORMATTYPE sOtherParam
OMX_VIDEO_PORTDEFINITIONTYPE video
OMX_ERRORTYPE omx_base_filter_Destructor(OMX_COMPONENTTYPE *openmaxStandComp)
the base filter destructor for ST OpenMAX components
OMX_ERRORTYPE omx_video_scheduler_component_port_SendBufferFunction(omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE *pBuffer)
the entry point for sending buffers to the video scheduler ports
void omx_video_scheduler_component_BufferMgmtCallback(OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *pInputBuffer, OMX_BUFFERHEADERTYPE *pOutputBuffer)
#define PORT_IS_BUFFER_SUPPLIER(pPort)
void tsem_up(tsem_t *tsem)
OMX_COLOR_FORMATTYPE eColorFormat
void setHeader(OMX_PTR header, OMX_U32 size)
Simply fills the first two fields in any OMX structure with the size and the version.
OMX_OTHER_PORTDEFINITIONTYPE other
#define MAX_VIDEOSCHED_COMPONENTS
void tsem_down(tsem_t *tsem)
OMX_ERRORTYPE omx_video_scheduler_component_Destructor(OMX_COMPONENTTYPE *openmaxStandComp)
OMX_BOOL omx_video_scheduler_component_ClockPortHandleFunction(omx_video_scheduler_component_PrivateType *omx_video_scheduler_component_Private, OMX_BUFFERHEADERTYPE *pInputBuffer)
OMX_COLOR_FORMATTYPE eColorFormat
#define OMX_SetConfig( hComponent, nConfigIndex, pComponentConfigStructure)
OMX_ERRORTYPE RM_RegisterComponent(char *name, int max_components)
OMX_ERRORTYPE(* ReturnBufferFunction)(omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE *pBuffer)
#define OMX_BUFFERFLAG_EOS
int queue(queue_t *queue, void *data)
OMX_VIDEO_CODINGTYPE eCompressionFormat
#define VIDEO_SCHEDULER_COMP_ROLE
omx_base_PortType ** ports
#define DEFAULT_VIDEO_INPUT_BUF_SIZE
void tsem_reset(tsem_t *tsem)
OMX_BOOL bFlagErrorConcealment
#define OMX_BUFFERFLAG_STARTTIME
#define PORT_IS_ENABLED(pPort)
OMX_PORTDOMAINTYPE eDomain
OMX_BUFFERHEADERTYPE ** pInternalBufferStorage
OMX_ERRORTYPE omx_base_filter_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
The base filter contructor for the OpenMAX ST components.
OMX_U32 nBufferCountActual
pthread_mutex_t flush_mutex
OMX_PTR pComponentPrivate
#define DEB_LEV_FUNCTION_NAME
OMX_COMPONENTTYPE * standCompContainer
OMX_ERRORTYPE omx_base_component_GetParameter(OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
Part of the standard OpenMAX function.
OMX_TIME_UPDATETYPE eUpdateType
#define PORT_IS_BEING_FLUSHED(pPort)
#define OMX_BASE_FILTER_INPUTPORT_INDEX
void * dequeue(queue_t *queue)
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
OMX_PARAM_PORTDEFINITIONTYPE sPortParam