Changeset 444 in flair-src for trunk/lib/FlairCore


Ignore:
Timestamp:
Sep 10, 2021, 2:37:55 PM (3 months ago)
Author:
Sanahuja Guillaume
Message:

update buffering (gcs part)
seems to work!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/ui_com.cpp

    r443 r444  
    389389  dataToSend->CopyDatas(ptr->buf+ptr->actual_size);
    390390  ptr->actual_size+=dataToSend->SendSize();
    391   Printf("nb buffered %i/%i\n",ptr->actual_size,ptr->final_size);
    392   Printf("pushed size %i period %i nb buffering %i\n",dataToSend->SendSize(),dataToSend->SendPeriod(),dataToSend->NbBuffering());
     391  //Printf("nb buffered %i/%i\n",ptr->actual_size,ptr->final_size);
     392  //Printf("pushed size %i period %i nb buffering %i\n",dataToSend->SendSize(),dataToSend->SendPeriod(),dataToSend->NbBuffering());
    393393  if(ptr->actual_size>=ptr->final_size) {//par securité on test aussi le cas ou supérieur
    394       Printf("ready to send\n");
     394      //Printf("ready to send\n");
    395395      SendNRT(ptr->buf, ptr->actual_size,ptr->period);
    396396      //clean
     
    615615        if(bufSize!=0) bufSize+=sizeof(char)+sizeof(uint16_t)+sizeof(uint16_t);//header+period+nb_buffering
    616616        if(bufSize!=(*pushedDatasIterator).final_size && bufSize!=0) {
    617             Printf("change buf size %i->%i\n",(*pushedDatasIterator).final_size,bufSize);
     617            //Printf("change buf size %i->%i\n",(*pushedDatasIterator).final_size,bufSize);
    618618            (*pushedDatasIterator).actual_size=0;
    619619            (*pushedDatasIterator).final_size=bufSize;
     
    622622        }
    623623        if(bufSize==0) {
    624             Printf("delete buf\n");
     624            //Printf("delete buf\n");
    625625            free((*pushedDatasIterator).buf);
    626626            pushedDatasIterator = pushedDatas.erase(pushedDatasIterator);
     
    635635      for (size_t i = 0; i < pushedDatas.size(); i++) {
    636636          if (pushedDatas.at(i).period==obj->SendPeriod() && pushedDatas.at(i).nb_buffering==obj->NbBuffering()) {
    637               Printf("match item %i, period %i nb buff %i\n",i,obj->SendPeriod(),obj->NbBuffering());
     637              //Printf("match item %i, period %i nb buff %i\n",i,obj->SendPeriod(),obj->NbBuffering());
    638638              match=true;
    639639            }
     
    641641      //create new one
    642642      if(!match) {
    643         printf("no match\n");
     643        //printf("no match\n");
    644644        PushedData_t tmp;
    645645        tmp.period=obj->SendPeriod();
     
    648648        tmp.final_size=0;
    649649        for (size_t i = 0; i < datasToSend.size(); i++) {
    650             Printf("data %i/%i %i %i\n",i,datasToSend.size(),datasToSend.at(i)->SendPeriod() ,datasToSend.at(i)->NbBuffering());
     650            //Printf("data %i/%i %i %i\n",i,datasToSend.size(),datasToSend.at(i)->SendPeriod() ,datasToSend.at(i)->NbBuffering());
    651651            if (datasToSend.at(i)->IsEnabled() && datasToSend.at(i)->SendPeriod() == obj->SendPeriod() && datasToSend.at(i)->NbBuffering()==obj->NbBuffering()) {
    652652              tmp.final_size+=datasToSend.at(i)->SendSize();
    653               Printf("add %i\n",datasToSend.at(i)->SendSize());
     653              //Printf("add %i\n",datasToSend.at(i)->SendSize());
    654654            }
    655655        }
    656656        tmp.final_size*=obj->NbBuffering();
    657657        tmp.final_size+=sizeof(char)+sizeof(uint16_t)+sizeof(uint16_t);//header+period+nb_buffering
    658         printf("final size %i\n",tmp.final_size);
     658        //printf("final size %i\n",tmp.final_size);
    659659        tmp.buf=(char*)malloc(tmp.final_size);
    660660        if(tmp.buf!=NULL) {
     
    665665      }
    666666  }
    667   Printf("nb buf %i\n",pushedDatas.size());
     667  //Printf("nb buf %i\n",pushedDatas.size());
    668668  return;
    669669}
     
    688688
    689689void ui_com::UpdateDataToSendBufferSize(const SendData *obj) {
     690    if(!obj->IsEnabled()) return;
     691   
    690692    send_mutex->GetMutex();
    691693   
Note: See TracChangeset for help on using the changeset viewer.