Changeset 328 in flair-src for branches/sanscv/lib/FlairSensorActuator/src
- Timestamp:
- Sep 4, 2019, 3:11:26 PM (5 years ago)
- Location:
- branches/sanscv/lib/FlairSensorActuator/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sanscv/lib/FlairSensorActuator/src/Camera.cpp
r324 r328 24 24 #include <DataPlot1D.h> 25 25 #include <Picture.h> 26 #include <VisionFilter.h>26 //#include <VisionFilter.h> 27 27 #include <fstream> 28 28 -
branches/sanscv/lib/FlairSensorActuator/src/V4LCamera.cpp
r324 r328 29 29 #include <cstring> 30 30 #include <sys/mman.h> 31 #include <VisionFilter.h> 31 32 32 33 #define DEFAULT_V4L_BUFFERS 4 … … 104 105 QueueBuffer(bufferIndex); 105 106 } 107 108 //alloc img buf 109 Printf("TODO: alloc bufs in cmem and uses it for v4l\n"); 110 output->buffer=AllocFunction(width*height*2); 106 111 107 112 // enable the streaming … … 133 138 134 139 V4LCamera::~V4LCamera() { 140 FreeFunction(output->buffer); 135 141 SafeStop(); 136 142 Join(); … … 139 145 void V4LCamera::Run(void) { 140 146 Time cam_time, new_time, fpsNow, fpsPrev; 141 char* buffer; // raw image142 147 int fpsCounter = 0; 143 148 … … 215 220 hasProblems=true; 216 221 } 217 Printf("todo allocate 1 frame and copy here\n");222 //Printf("todo allocate 1 frame and copy here\n"); 218 223 output->GetMutex(); 219 output->buffer = buffer;224 memcpy(output->buffer,buffers[bufferIndex].start,buffers[bufferIndex].length); 220 225 output->ReleaseMutex(); 221 226 … … 280 285 //Printf("%lld ioctl\n",GetTimeMS()); 281 286 if (xioctl (device, VIDIOC_DQBUF, &buf)==-1) { 282 //Printf("iter %i err %i\n",i,errno);287 //Printf("iter %i err %i\n",i,errno); 283 288 if (errno==EAGAIN) { 284 289 //Printf("exit buf %i\n",buf.index); … … 362 367 MAP_SHARED /* recommended */, 363 368 device, buf.m.offset); 364 Printf("buffer %i start %x length %i\n",n_buffers,buffers[n_buffers].start,buffers[n_buffers].length);369 //Printf("buffer %i start %x length %i\n",n_buffers,buffers[n_buffers].start,buffers[n_buffers].length); 365 370 if (MAP_FAILED == buffers[n_buffers].start) { 366 371 Thread::Err("mmap\n"); … … 369 374 } 370 375 nbBuffers=requestbuffers.count; 371 Printf("allocated %i buffers\n",nbBuffers);376 //Printf("allocated %i buffers\n",nbBuffers); 372 377 return 1; 373 378 };
Note:
See TracChangeset
for help on using the changeset viewer.