Changeset 401 in flair-src for trunk/lib


Ignore:
Timestamp:
Mar 18, 2021, 11:07:59 AM (6 months ago)
Author:
Sanahuja Guillaume
Message:

resolve bug when not using hdsvisionfilter but using cameras on dm3730

Location:
trunk/lib
Files:
3 edited

Legend:

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

    r338 r401  
    6464void Image::RawRead(char *dst) const { Warn("non implementé\n"); }
    6565
     66char* Image::AllocFunction(ssize_t size) {
     67  return allocFunction(size);
     68}
     69
     70void Image::FreeFunction(char* buffer) {
     71 freeFunction(buffer);
     72}
     73
    6674void Image::RegisterAllocFunction(char*(*func)(ssize_t size)) {
    6775  if(allocFunction==DefaultAllocFunction) allocFunction=func;
  • trunk/lib/FlairCore/src/Image.h

    r353 r401  
    111111  static void RegisterAllocFunction(char*(*func)(ssize_t size));
    112112  static void RegisterFreeFunction(void(*func)(char* buffer));
     113  static char* AllocFunction(ssize_t size);
     114  static void FreeFunction(char* buffer);
    113115
    114116private:
  • trunk/lib/FlairSensorActuator/src/V4LCamera_impl.cpp

    r400 r401  
    2929#include <cstring>
    3030#include <sys/mman.h>
    31 #include <VisionFilter.h>
    3231
    3332using std::string;
     
    104103  if(useMemoryUsrPtr) {
    105104    for (int i = 0; i < nbBuffers; i++) {
    106       FreeFunction((char*)buffers[i]);
     105      Image::FreeFunction((char*)buffers[i]);
    107106    }
    108107  } else {
    109       FreeFunction(imageData);
     108      Image::FreeFunction(imageData);
    110109  }
    111110  close(device);
     
    212211
    213212  //allocate output data
    214   imageData = AllocFunction(self->output->GetDataType().GetSize());
     213  imageData = Image::AllocFunction(self->output->GetDataType().GetSize());
    215214  //Printf("cmem allocated %i at %x\n",output->GetDataType().GetSize(),imageData);
    216215
     
    237236
    238237  for (int i=0; i<nbBuffers; i++) {
    239     buffers[i] =AllocFunction(self->output->GetDataType().GetSize());
     238    buffers[i] =Image::AllocFunction(self->output->GetDataType().GetSize());
    240239  }
    241240
Note: See TracChangeset for help on using the changeset viewer.