Changeset 403 in flair-src
- Timestamp:
- Mar 23, 2021, 9:40:41 AM (4 years ago)
- Location:
- trunk/lib
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/Image.cpp
r401 r403 80 80 } 81 81 82 bool Image::IsUsingDefaultAllocAndFree(void) { 83 return (allocFunction==DefaultAllocFunction); 84 } 85 82 86 char* Image::DefaultAllocFunction(ssize_t size){ 83 87 return (char*)malloc(size); -
trunk/lib/FlairCore/src/Image.h
r401 r403 111 111 static void RegisterAllocFunction(char*(*func)(ssize_t size)); 112 112 static void RegisterFreeFunction(void(*func)(char* buffer)); 113 static bool IsUsingDefaultAllocAndFree(void); 113 114 static char* AllocFunction(ssize_t size); 114 115 static void FreeFunction(char* buffer); -
trunk/lib/FlairMeta/src/HdsX8.cpp
r268 r403 53 53 Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix, 70)); 54 54 SetBatteryMonitor(((BlCtrlV2 *)GetBldc())->GetBatteryMonitor()); 55 SetVerticalCamera(new Ps3Eye("camv", 0, 50)); 55 56 if(Image::IsUsingDefaultAllocAndFree()) { 57 SetVerticalCamera(new Ps3Eye("camv", 0, false,50));//no cmem and no dsp 58 } else { 59 SetVerticalCamera(new Ps3Eye("camv", 0, true,50));//cmem and dsp 60 } 56 61 57 62 string useGps=FindArgument(options,"use_gps=",false); -
trunk/lib/FlairMeta/src/XAir.cpp
r268 r403 56 56 SetBatteryMonitor(new BatteryMonitor(bat_tab->NewRow(), "battery")); 57 57 GetBatteryMonitor()->SetBatteryValue(12); 58 SetVerticalCamera(new Ps3Eye("camv", 0, 50)); 58 59 if(Image::IsUsingDefaultAllocAndFree()) { 60 SetVerticalCamera(new Ps3Eye("camv", 0, false,50));//no cmem and no dsp 61 } else { 62 SetVerticalCamera(new Ps3Eye("camv", 0, true,50));//cmem and dsp 63 } 59 64 } 60 65 -
trunk/lib/FlairSensorActuator/src/Ps3Eye.cpp
r338 r403 25 25 namespace sensor { 26 26 27 Ps3Eye::Ps3Eye(string name, int camera_index, 27 Ps3Eye::Ps3Eye(string name, int camera_index,bool useMemoryUsrPtr, 28 28 uint8_t priority) 29 29 : V4LCamera( name, camera_index, 320, 240, 30 Image::Type::Format::YUYV, priority) {30 Image::Type::Format::YUYV, useMemoryUsrPtr,priority) { 31 31 SetIsReady(true); 32 32 } -
trunk/lib/FlairSensorActuator/src/Ps3Eye.h
r137 r403 33 33 * \param name name 34 34 * \param camera_index index of the camera, ie /dev/videox 35 * \param useMemoryUsrPtr true to use memory user pointer (ex with cmem on omap3730), false to use mmap 35 36 * \param priority priority of the Thread 36 37 */ 37 38 Ps3Eye(std::string name, 38 int camera_index, uint8_t priority);39 int camera_index, bool useMemoryUsrPtr,uint8_t priority); 39 40 40 41 /*! -
trunk/lib/FlairSensorActuator/src/V4LCamera.cpp
r353 r403 28 28 29 29 V4LCamera::V4LCamera(string name,uint8_t camera_index, uint16_t width, uint16_t height, 30 Image::Type::Format format, uint8_t priority)30 Image::Type::Format format, bool useMemoryUsrPtr,uint8_t priority) 31 31 : Thread(getFrameworkManager(), name, priority), 32 32 Camera(name, width, height, format) { 33 33 34 pimpl_=new V4LCamera_impl(this,name,camera_index,width,height,format );34 pimpl_=new V4LCamera_impl(this,name,camera_index,width,height,format,useMemoryUsrPtr); 35 35 } 36 36 -
trunk/lib/FlairSensorActuator/src/V4LCamera.h
r352 r403 45 45 * \param height height 46 46 * \param format image format 47 * \param useMemoryUsrPtr true to use memory user pointer (ex with cmem on omap3730), false to use mmap 47 48 * \param priority priority of the Thread 48 49 */ 49 50 V4LCamera(std::string name, 50 51 uint8_t camera_index, uint16_t width, uint16_t height, 51 core::Image::Type::Format format, uint8_t priority);52 core::Image::Type::Format format, bool useMemoryUsrPtr,uint8_t priority); 52 53 53 54 /*! -
trunk/lib/FlairSensorActuator/src/V4LCamera_impl.cpp
r401 r403 37 37 38 38 V4LCamera_impl::V4LCamera_impl(V4LCamera *self,string name,uint8_t camera_index, uint16_t width, uint16_t height, 39 Image::Type::Format format ) {39 Image::Type::Format format,bool useMemoryUsrPtr) { 40 40 this->self=self; 41 41 … … 60 60 } 61 61 62 //todo: better handling of detection, only neeeded for omap/dm 63 //also in run, copy from v4l to cmem is not necessary if not using cmem... 64 #ifdef ARMV7A 65 useMemoryUsrPtr=true; 66 #else 67 useMemoryUsrPtr=false; 68 #endif 62 //todo: in run, copy from v4l to cmem is not necessary if not using cmem. (!useMemoryUsrPtr) 63 this->useMemoryUsrPtr=useMemoryUsrPtr; 64 69 65 if(useMemoryUsrPtr) { 70 66 AllocUserBuffers(); -
trunk/lib/FlairSensorActuator/src/unexported/V4LCamera_impl.h
r352 r403 48 48 * \param height height 49 49 * \param format image format 50 * \param useMemoryUsrPtr true to use memory user pointer (ex with cmem on omap3730), false to use mmap 50 51 */ 51 52 V4LCamera_impl(flair::sensor::V4LCamera *self,std::string name, 52 53 uint8_t camera_index, uint16_t width, uint16_t height, 53 flair::core::Image::Type::Format format );54 flair::core::Image::Type::Format format,bool useMemoryUsrPtr); 54 55 55 56 /*!
Note:
See TracChangeset
for help on using the changeset viewer.