void openmax_processor::setParam(t_sint32 portIndex, t_sint32 fifoSize, t_sint32 direction, t_sint32 buffSupplierType, t_sint32 correspondingPortIndex, t_sint32 width, t_sint32 height, t_sint32 colorFormat, t_sint32 stride) //************************************************************************************************************* { //DEfault initialisation of the ports IN0("\n"); MSG4("portIndex %ld, fifoSize %ld, direction %ld, buffSupplierType%ld\n", portIndex, fifoSize, direction, buffSupplierType); MSG4("correspondingPortIndex %ld, width %ld, height %ld, colorFormat %ld\n", correspondingPortIndex, width, height, colorFormat); MSG1("stride %ld\n", stride); if(portIndex >= (int)GetNbPorts()) // Sanity check { MSG0("ERROR in setParam OMX_ErrorBadParameter\n"); OUTR(" Error", OMX_ErrorBadParameter); return; } portInformation*pInfo= GetPortInfo(portIndex); if (pInfo) { pInfo->fifoSize = fifoSize; pInfo->width = width; pInfo->height = height; pInfo->colorFormat = (OMX_COLOR_FORMATTYPE)colorFormat; pInfo->omxPortIndex = portIndex; pInfo->stride = stride; pInfo->direction = (OMX_DIRTYPE) direction; pInfo->bufferSupplier= buffSupplierType; pInfo->omxPortIndex = correspondingPortIndex; } OUT0("\n"); }
static TTRPtr TT_GetRow_(void *tth) { int nread=0,badline=0,comment,i; char str[MAXSTRLNG], *s, nm[10]; static TTRow r; unsigned long tag; /* for backward compartibility */ if (UseMYSQL) { MYSQL_NOT_IMPLEMENTED; return NULL; } else { do { s=fgets(str,MAXSTRLNG,(FILE*)tth); nline++; if (s == NULL) { if (ferror((FILE*)tth)) /* check for errors */ { MSG1("Error reading TT file at line # %i\n",nline); perror("TT_GetRow_: Error in fgets()"); } if (feof ((FILE*)tth)) /* check for End-Of-File */ { ; /* MSG1("Found end of TT file at line # %i\n",nline); */ } return NULL; /* Stop reading */ } str[strlen(str)-1] = 0; comment = (*str==0 || *str=='#' || *str=='!' || *str==';') ; badline = 0; /* printf("String %i: <%s>",nline,str); */ if (!comment) { nread = sscanf (str,"%4c %i %i %i %i %i %i %i %i %i %i", &r.nm,&r.nr,&r.sd1,&r.sd2,&r.pl,&tag, &r.st,&r.roc,&r.sl,&r.typ,&r.chn); /*printf("=+=> %x(%d) %x(%d)\n",r.sd1,r.sd1,r.sd2,r.sd2);*/ /* printf(" : <%s>\n",&r.nm); */ badline = (nread != NUMTTFIELDS + 1); /* one extra field in line (tag) */ if (badline) { MSG4("Error pasing line # %i of TT file ; nItems=%i Nfields=%i ; \n" "Line was:\"%s\"\n",nline,nread,NUMTTFIELDS-1,str); /* return NULL; */ } } else { ; /* MSG1("Found comment at line # %i\n",nline); */ } } while(comment || badline); return(&r); } }
SCF_STATE CAM_SM::PowerUp_STC_CheckCoin(s_scf_event const *e) { switch (e->sig) { case SCF_STATE_ENTRY_SIG: { ENTRY; MSG0("PowerUp_STC_CheckCoin-SCF_STATE_ENTRY_SIG\n"); OstTraceFiltStatic0(TRACE_DEBUG, "PowerUp_STC_CheckCoin-SCF_STATE_ENTRY_SIG", (&mENSComponent)); // Get coin value pIspctlCom->queuePE(Sensor_Tuning_Status_e_Coin_SubBlock_Status_Byte0,0); pIspctlCom->readQueue(); return 0; } case EVT_ISPCTL_LIST_INFO_SIG: { MSG0("PowerUp_STC_CheckCoin-EVT_ISPCTL_LIST_INFO_SIG\n"); OstTraceFiltStatic0(TRACE_DEBUG, "PowerUp_STC_CheckCoin-EVT_ISPCTL_LIST_INFO_SIG", (&mENSComponent)); if (e->type.ispctlInfo.info_id != ISP_READLIST_DONE) break; //#if defined (OSI_DEBUG) for(t_uint16 i=0; i < e->type.ispctlInfo.number_of_pe; i++) { MSG4(" PE[%d] 0x%X (%s) = 0x%lX\n", i, e->type.ispctlInfo.Listvalue[i].pe_addr, pSensor->GetPeName(e->type.ispctlInfo.Listvalue[i].pe_addr), e->type.ispctlInfo.Listvalue[i].pe_data ); //OstTraceFiltStatic4(TRACE_DEBUG, " PE[%d] 0x%X (%s) = 0x%lX", (&mENSComponent), i, e->type.ispctlInfo.Listvalue[i].pe_addr, CXp70::GetPeName(e->type.ispctlInfo.Listvalue[i].pe_addr), e->type.ispctlInfo.Listvalue[i].pe_data ); } //#endif if( (Coin_te)e->type.ispctlInfo.Listvalue[0].pe_data == iStatusCoin) { // Coin state has not changed yet if(iStatusCoinRetriesCount>=10) { MSG0("***** Coin state unchanged, too many attempts *****\n"); OstTraceFiltStatic0(TRACE_DEBUG, "***** Coin state unchanged, too many attempts *****", (&mENSComponent)); DBC_ASSERT(0); return 0; } MSG1(" Coin state unchanged (state=%d) => try again\n", (int)iStatusCoin); OstTraceFiltStatic1(TRACE_DEBUG, "Coin state unchanged (state=%d) => try again", (&mENSComponent), (int)iStatusCoin); iStatusCoinRetriesCount++; pIspctlCom->queuePE(Sensor_Tuning_Status_e_Coin_SubBlock_Status_Byte0,0); pIspctlCom->readQueue(); } else { // Coin state changed => we can read the block ID value iStatusCoin = (Coin_te) e->type.ispctlInfo.Listvalue[0].pe_data; MSG1(" Coin state unchanged (state=%d) => read Block ID value\n", (int)iStatusCoin); OstTraceFiltStatic1(TRACE_DEBUG, "Coin state unchanged (state=%d) => read Block ID value", (&mENSComponent), (int)iStatusCoin); iStatusCoinRetriesCount = 0; SCF_TRANSIT_TO(&CAM_SM::PowerUp_STC_ReadId); } return 0; } case SCF_STATE_EXIT_SIG: { EXIT; return 0; } default: break; } return SCF_STATE_PTR(&COM_SM::SHARED_ControlingISPState_Boot); }
//Not arm target --> x86-linux //Basic implementation without regarding type of buffers WRAPPER_OPENMAX_API OMX_ERRORTYPE OpenMax_Proxy::useBuffer(OMX_U32 nPortIndex, OMX_U32 nBufferIndex, OMX_BUFFERHEADERTYPE* pBufferHdr, void **portPrivateInfo) //************************************************************************************************************* { IN0("\n"); OMX_ERRORTYPE err = OMX_ErrorNone; MSG4("OpenMax_Proxy[%s]::useBuffer[%lu] buffer=%lu Header=%p\n", GetComponentName(), nPortIndex, nBufferIndex, pBufferHdr); err = useBufferHeap(nPortIndex, nBufferIndex, pBufferHdr, portPrivateInfo); OUTR(" ", (err)); return err; }
void openmax_processor::fsmInit(fsmInit_t initFsm) //************************************************************************************************************* { //Make the initialisation of ports IN0("\n"); if (initFsm.traceInfoAddr) { setTraceInfo(initFsm.traceInfoAddr, initFsm.id1); } portInformation *pPortInfo; Port *pPort; NMF::InterfaceReference *pInterfaceRef; const size_t NbPorts=GetNbPorts(); for (size_t portIndex=0; portIndex < NbPorts ; ++portIndex) { pPort=GetPort(portIndex); pPortInfo=GetPortInfo(portIndex); pPortInfo->AllocateBufferHeader(); if (pPortInfo->direction== OMX_DirInput) { // for input pInterfaceRef=&mProcessorTemplate.emptybufferdone[portIndex]; // NMF 'return' interface } else { //for output pInterfaceRef=&mProcessorTemplate.fillbufferdone[portIndex]; // NMF 'return' interface } pPort->init(pPortInfo->direction==OMX_DirInput?InputPort: OutputPort, // Direction false /*(bool)pPortInfo->bufferSupplier*/, // Buffer supplier true, // isHWPort ca fait quoi? NULL, // sharingPort pPortInfo->BufferHeaderList, pPortInfo->fifoSize, // bufferCount (FIFO size ) pInterfaceRef, // NMF 'return' interface portIndex, // port index (initFsm.portsDisabled & (1 << portIndex) )?true:false, (initFsm.portsTunneled & (1 << portIndex) )?true:false, this // owner ); MSG4("%s->InitPort(%d) Direction=%d Fifo=%d \n", GetComponentName(), portIndex, pPortInfo->direction, pPortInfo->fifoSize); for (int i=0; i< pPortInfo->fifoSize; ++i) { MSG2("BufferHeader[i]=%p \n", i, pPortInfo->BufferHeaderList[i]); } MSG0("\n"); } init(NbPorts, m_pPort, &proxy /* Event Handler */, &me /* Postevent */, false); //Now call user init UserOpen(); OUT0("\n"); }
WRAPPER_OPENMAX_API OMX_ERRORTYPE OpenMax_Proxy::useBufferHeader(OMX_DIRTYPE dir, OMX_BUFFERHEADERTYPE* pBufferHdr) //************************************************************************************************************* { IN0("\n"); OMX_ERRORTYPE err = OMX_ErrorNone; int portNb; if (dir == OMX_DirInput) portNb=pBufferHdr->nInputPortIndex; else portNb=pBufferHdr->nOutputPortIndex; MSG4("OpenMax_Proxy[%s]::useBufferHeader port %d dir=%u Header=%p\n", GetComponentName(), portNb, dir, pBufferHdr); err = useBufferHeaderHeap(dir, pBufferHdr); OUTR(" ", (err)); return err; }
static int TT_ProcessRow_(TTRPtr r) { int type,i,bosid,idnr; char *chara, name[5] = {' ',' ',' ',' ','\0'}; /* printf("Row %4d: %4.4s#%d id %2.2d:%3.3d:%d Addr %2.2d:%2.2d\n" ,nline,&(r->nm),r->nr,r->sd1,r->sd2,r->pl,r->sl,r->chn); */ /* We want process only data corresponding to that ROC */ if (r->roc != ttpwork->roc) { MSG3("Changed ROC # %i to %i at line # %i\n",ttpwork->roc,r->roc,nline); return 0; } if (r->sl > 26 || r->sl < 0) { MSG2("Wrong slot number %i in line %i\n",r->sl,nline); return 0; } if (r->chn > 256 || r->chn < 0) { MSG2("Wrong channel number %i in line %i\n",r->chn,nline); return 0; } if (r->typ == 1872) type = 0; /* even - tdc */ else if(r->typ == 1881) type = 1; /* odd - adc */ else if(r->typ == 1877) type = 2; /* even - tdc */ else if(r->typ == 1190) type = 4; /* even - tdc */ else /* unknown */ { MSG2("Unknown board type # %i at line # %i\n",r->typ,nline); return 0; /* skip this junk */ } if (ttpwork->type[slot] == -1 ) ttpwork->type[slot] = type; else if (ttpwork->type[slot] != type) { MSG4("Slot #%i : type # %i changed to %i at line # %i\n", slot,ttpwork->type[slot],type,nline); return(0); /* skip this junk */ } /* calculate 'bosid' */ bosid = r->sd1*256 + r->sd2; /* calculate 'idnr' from 'name' and 'nr' */ chara = (char *)&r->nm; for(i=0; i<4; i++) name[i] = chara[i]; idnr = (bosMgetid_(name) << 16) + r->nr; /*printf("name=>%4.4s< nr=%d -> idnr=0x%08x\n",&r->nm,r->nr,idnr);*/ /* fill the table */ if(type == 0) /* channel# --> 0..7 bits (Lecroy 1872A) */ { ttpwork->idnr[slot][channel] = idnr; ttpwork->name[slot][channel] = r->nm; ttpwork->nr[slot][channel] = r->nr; ttpwork->place[slot][channel] = r->pl; ttpwork->id[slot][channel] = bosid; /* repeat for setting bit 23 */ ttpwork->idnr[slot][128+channel] = idnr; ttpwork->name[slot][128+channel] = r->nm; /* bank name */ ttpwork->nr[slot][128+channel] = r->nr; /* bank# */ ttpwork->place[slot][128+channel] = r->pl; /* place# */ ttpwork->id[slot][128+channel] = bosid; /* id */ } if(type == 1) /* channel# --> 1..7 bits (Lecroy 1881M) */ { int chan = r->chn << 1; ttpwork->idnr[slot][chan] = idnr; ttpwork->name[slot][chan] = r->nm; /* bank name */ ttpwork->nr[slot][chan] = r->nr; /* bank# */ ttpwork->place[slot][chan] = r->pl; /* place# */ ttpwork->id[slot][chan] = bosid; /* id */ /* repeat for setting bit 0 */ ttpwork->idnr[slot][chan+1] = idnr; ttpwork->name[slot][chan+1] = r->nm; /* bank name */ ttpwork->nr[slot][chan+1] = r->nr; /* bank# */ ttpwork->place[slot][chan+1] = r->pl; /* place# */ ttpwork->id[slot][chan+1] = bosid; /* id */ /* printf("slot=%d chan=%d -> name %4.4s\n",slot,chan,&(ttpwork->name[slot][chan])); */ } if(type == 2) /* channel# --> 1..8 bits (Lecroy 1877 with multiplexing) */ { ttpwork->idnr[slot][channel] = idnr; ttpwork->name[slot][channel] = r->nm; ttpwork->nr[slot][channel] = r->nr; ttpwork->id2[slot][r->pl][channel] = bosid; } if(type == 4) /* channel# --> 1..8 bits (CAEN 1190 pipeline) */ { ttpwork->idnr[slot][channel] = idnr; ttpwork->name[slot][channel] = r->nm; ttpwork->nr[slot][channel] = r->nr; ttpwork->id2[slot][r->pl][channel] = bosid; } return(1); }