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,
309 omx_video_scheduler_component_Private->eState = pMediaTime->
eState;
310 omx_video_scheduler_component_Private->xScale = pMediaTime->
xScale;
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) {
358 omx_video_scheduler_component_Private->frameDropFlag =
OMX_FALSE;
359 omx_video_scheduler_component_Private->dropFrameCount = 0;
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) {