[Phission-cvs] phission/capture/v4l/src V4LCapture.cpp,1.36,1.37
Brought to you by:
pthoren
From: Philip T. <pt...@us...> - 2005-09-18 22:38:36
|
Update of /cvsroot/phission/phission/capture/v4l/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19641/v4l/src Modified Files: V4LCapture.cpp Log Message: The big CHECK_RC/etc. to phCHECK_RC/etc. conversions Index: V4LCapture.cpp =================================================================== RCS file: /cvsroot/phission/phission/capture/v4l/src/V4LCapture.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** V4LCapture.cpp 17 Sep 2005 23:44:01 -0000 1.36 --- V4LCapture.cpp 18 Sep 2005 22:38:28 -0000 1.37 *************** *** 127,131 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); this->setName("V4LCapture"); --- 127,131 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); this->setName("V4LCapture"); *************** *** 136,140 **** this->m_info = (struct phV4LCaptureInfo_t *)phCalloc(1, sizeof(struct phV4LCaptureInfo_t)); ! PRINT_PTR(this->m_info,"phCalloc", "phCalloc failed to alloc phV4LCaptureInfo"); --- 136,140 ---- this->m_info = (struct phV4LCaptureInfo_t *)phCalloc(1, sizeof(struct phV4LCaptureInfo_t)); ! phPRINT_PTR(this->m_info,"phCalloc", "phCalloc failed to alloc phV4LCaptureInfo"); *************** *** 191,195 **** /*error:*/ rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return; --- 191,195 ---- /*error:*/ rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return; *************** *** 209,213 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); if (this->isRunning()) --- 209,213 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); if (this->isRunning()) *************** *** 215,219 **** /* this unmaps the hw_buffer and closes the device */ rc = this->stop(); ! PRINT_RC(rc,NULL,"this->stop()"); } --- 215,219 ---- /* this unmaps the hw_buffer and closes the device */ rc = this->stop(); ! phPRINT_RC(rc,NULL,"this->stop()"); } *************** *** 221,225 **** { rc = this->close(); ! PRINT_RC(rc,NULL,"this->close()"); } --- 221,225 ---- { rc = this->close(); ! phPRINT_RC(rc,NULL,"this->close()"); } *************** *** 227,231 **** rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); } --- 227,231 ---- rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); } *************** *** 264,268 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); /* device is already open, close it */ --- 264,268 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); /* device is already open, close it */ *************** *** 270,274 **** { rc = this->close(); ! PRINT_RC(rc,NULL,"this->close()"); } --- 270,274 ---- { rc = this->close(); ! phPRINT_RC(rc,NULL,"this->close()"); } *************** *** 276,280 **** { rc = this->setPath( path ); ! PRINT_RC(rc,NULL,"this->setPath( path:%s )",path); } --- 276,280 ---- { rc = this->setPath( path ); ! phPRINT_RC(rc,NULL,"this->setPath( path:%s )",path); } *************** *** 283,287 **** /* open the video device */ rc = (this->m_device_fd = ::open((char*)this->getPath(), O_RDWR)); ! CHECK_RC(rc,"::open", "Error: opening video device (%s)", (char*)this->getPath() --- 283,287 ---- /* open the video device */ rc = (this->m_device_fd = ::open((char*)this->getPath(), O_RDWR)); ! phCHECK_RC(rc,"::open", "Error: opening video device (%s)", (char*)this->getPath() *************** *** 291,295 **** rc = ioctl(this->m_device_fd, VIDIOCGCAP, &this->m_info->m_devCapability); ! CHECK_RC(rc, "ioctl(VIDIOCGCAP)", "ioctl(%d,VIDIOCGCAP,%p) failed", this->m_device_fd, --- 291,295 ---- rc = ioctl(this->m_device_fd, VIDIOCGCAP, &this->m_info->m_devCapability); ! phCHECK_RC(rc, "ioctl(VIDIOCGCAP)", "ioctl(%d,VIDIOCGCAP,%p) failed", this->m_device_fd, *************** *** 304,313 **** rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; error: rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; --- 304,313 ---- rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; error: rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; *************** *** 337,345 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); if (this->m_hw_mmapped == 1) { ! ERR_PRINT("What the hell? hw_mapped == 1\n"); } --- 337,345 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); if (this->m_hw_mmapped == 1) { ! phERR_PRINT("What the hell? hw_mapped == 1\n"); } *************** *** 348,352 **** /* close the video device */ rc = ::close(this->m_device_fd); ! CHECK_RC(rc, "::close", "Error: closing video device (%s)", this->getPath() --- 348,352 ---- /* close the video device */ rc = ::close(this->m_device_fd); ! phCHECK_RC(rc, "::close", "Error: closing video device (%s)", this->getPath() *************** *** 368,372 **** rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; --- 368,372 ---- rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; *************** *** 374,378 **** error: rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; --- 374,378 ---- error: rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; *************** *** 397,401 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); /* The hw_bufferCount won't be applied until the next time the --- 397,401 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); /* The hw_bufferCount won't be applied until the next time the *************** *** 407,411 **** rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; --- 407,411 ---- rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; *************** *** 413,417 **** error: rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; --- 413,417 ---- error: rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; *************** *** 495,504 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); /* This is a must. Check all input parameters; raise an error is needed */ if (this->isCapturing()) { ! CHECK_RC(-1,NULL,"Capture still in progress. Stop capturing first."); } --- 495,504 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); /* This is a must. Check all input parameters; raise an error is needed */ if (this->isCapturing()) { ! phCHECK_RC(-1,NULL,"Capture still in progress. Stop capturing first."); } *************** *** 525,529 **** { rc = munmap((void *)this->m_hw_buffer, this->m_hw_bufferSize); ! PRINT_RC(rc,"munmap failed", "munmap(%p,%u);", this->m_hw_buffer, --- 525,529 ---- { rc = munmap((void *)this->m_hw_buffer, this->m_hw_bufferSize); ! phPRINT_RC(rc,"munmap failed", "munmap(%p,%u);", this->m_hw_buffer, *************** *** 538,547 **** success: rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; error: rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; --- 538,547 ---- success: rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; error: rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; *************** *** 560,573 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); if (this->m_device_fd <= 0) { ! ERR_PRINT("this->m_device_fd <= 0\n"); } if (this->m_image_size <= 0) { ! ERR_PRINT("this->m_image_size <= 0\n"); } --- 560,573 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); if (this->m_device_fd <= 0) { ! phERR_PRINT("this->m_device_fd <= 0\n"); } if (this->m_image_size <= 0) { ! phERR_PRINT("this->m_image_size <= 0\n"); } *************** *** 576,580 **** { rc = unmapHWBuffer(); ! PRINT_RC(rc,NULL,"unmapHWBuffer"); } --- 576,580 ---- { rc = unmapHWBuffer(); ! phPRINT_RC(rc,NULL,"unmapHWBuffer"); } *************** *** 588,592 **** VIDIOCGMBUF, &this->m_info->m_captureBuffers); ! CHECK_RC(rc,"ioctl(VIDIOCGMBUF)", "ioctl(%d,VIDIOCGMBUF,%p) failed.", this->m_device_fd, --- 588,592 ---- VIDIOCGMBUF, &this->m_info->m_captureBuffers); ! phCHECK_RC(rc,"ioctl(VIDIOCGMBUF)", "ioctl(%d,VIDIOCGMBUF,%p) failed.", this->m_device_fd, *************** *** 615,619 **** if (map_rc == -1) { ! ERROR_PRINT("mmap", "*** ERROR (rc:%p)*** Error: mmap\n", this->m_hw_buffer); --- 615,619 ---- if (map_rc == -1) { ! phERROR_PRINT("mmap", "*** ERROR (rc:%p)*** Error: mmap\n", this->m_hw_buffer); *************** *** 629,638 **** rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; error: rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; --- 629,638 ---- rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; error: rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; *************** *** 645,657 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); rc = this->unmapHWBuffer(); rc = this->mapHWBuffer(); ! PRINT_RC(rc,NULL,"mapHWBuffer() failed"); rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; --- 645,657 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); rc = this->unmapHWBuffer(); rc = this->mapHWBuffer(); ! phPRINT_RC(rc,NULL,"mapHWBuffer() failed"); rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; *************** *** 659,663 **** error: rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; --- 659,663 ---- error: rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phFAIL; *************** *** 888,892 **** if (!this->isRunning()) { ! CHECK_RC(rc,"ioctl(VIDIOCSPICT)", "ioctl(%d,VIDIOCSPICT,%p) failed", this->m_device_fd, --- 888,892 ---- if (!this->isRunning()) { ! phCHECK_RC(rc,"ioctl(VIDIOCSPICT)", "ioctl(%d,VIDIOCSPICT,%p) failed", this->m_device_fd, *************** *** 906,910 **** VIDIOCGCHAN, &this->m_info->m_channelSpec); ! CHECK_RC(rc, "ioctl(VIDIOCGCHAN)", "ioctl(%d,VIDIOCGCHAN,%p)-channel:%d", this->m_device_fd, --- 906,910 ---- VIDIOCGCHAN, &this->m_info->m_channelSpec); ! phCHECK_RC(rc, "ioctl(VIDIOCGCHAN)", "ioctl(%d,VIDIOCGCHAN,%p)-channel:%d", this->m_device_fd, *************** *** 920,924 **** VIDIOCSCHAN, &this->m_info->m_channelSpec); ! CHECK_RC(rc, "ioctl(VIDIOCSCHAN)", "ioctl(%d,VIDIOCSCHAN,%p)-channel:%d", this->m_device_fd, --- 920,924 ---- VIDIOCSCHAN, &this->m_info->m_channelSpec); ! phCHECK_RC(rc, "ioctl(VIDIOCSCHAN)", "ioctl(%d,VIDIOCSCHAN,%p)-channel:%d", this->m_device_fd, *************** *** 931,935 **** rc = this->phImageCapture::onApplySettings(); ! CHECK_RC(rc,NULL,"this->phImageCapture::onApplySettings() failed."); return retrc; --- 931,935 ---- rc = this->phImageCapture::onApplySettings(); ! phCHECK_RC(rc,NULL,"this->phImageCapture::onApplySettings() failed."); return retrc; *************** *** 949,962 **** rc = this->lock(); ! PRINT_RC(rc,NULL,"this->lock()"); rc = this->unmapHWBuffer(); ! PRINT_RC(rc,NULL,"this->unmapHWBUffer()"); rc = this->phImageCapture::cleanup(); ! PRINT_RC(rc,NULL,"this->phImageCapture::cleanup()"); rc = this->unlock(); ! PRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; --- 949,962 ---- rc = this->lock(); ! phPRINT_RC(rc,NULL,"this->lock()"); rc = this->unmapHWBuffer(); ! phPRINT_RC(rc,NULL,"this->unmapHWBUffer()"); rc = this->phImageCapture::cleanup(); ! phPRINT_RC(rc,NULL,"this->phImageCapture::cleanup()"); rc = this->unlock(); ! phPRINT_RC(rc,NULL,"this->unlock()"); return phSUCCESS; *************** *** 974,978 **** rc = ioctl(fd, VIDIOCMCAPTURE, &spec ); \ if (errno == EINTR) rc = 0; \ ! PRINT_RC(rc, "ioctl(VIDIOCMCAPTURE)",\ "ioctl(%d,VIDIOCMCAPTURE,%p) failed",\ fd, &spec ); \ --- 974,978 ---- rc = ioctl(fd, VIDIOCMCAPTURE, &spec ); \ if (errno == EINTR) rc = 0; \ ! phPRINT_RC(rc, "ioctl(VIDIOCMCAPTURE)",\ "ioctl(%d,VIDIOCMCAPTURE,%p) failed",\ fd, &spec ); \ *************** *** 983,987 **** rc = ioctl(fd, VIDIOCSYNC, &frm); \ if (errno == EINTR) rc = 0; \ ! PRINT_RC(rc, "ioctl(VIDIOCSYNC)", \ "ioctl(%d,VIDIOCSYNC,%p) failed", \ fd, &frm ); \ --- 983,987 ---- rc = ioctl(fd, VIDIOCSYNC, &frm); \ if (errno == EINTR) rc = 0; \ ! phPRINT_RC(rc, "ioctl(VIDIOCSYNC)", \ "ioctl(%d,VIDIOCSYNC,%p) failed", \ fd, &frm ); \ *************** *** 996,1000 **** rc = this->mapHWBuffer(); ! PRINT_RC(rc,NULL,"this->mapHWBuffer()"); phImage *output_buffer = this->getImage(); --- 996,1000 ---- rc = this->mapHWBuffer(); ! phPRINT_RC(rc,NULL,"this->mapHWBuffer()"); phImage *output_buffer = this->getImage(); *************** *** 1055,1059 **** { temp = (uint8_t*)phMalloc(cur_image_size); ! CHECK_NULLPTR(temp,"phMalloc","phMalloc failed"); memset(temp,0,cur_image_size); --- 1055,1059 ---- { temp = (uint8_t*)phMalloc(cur_image_size); ! phCHECK_NULLPTR(temp,"phMalloc","phMalloc failed"); memset(temp,0,cur_image_size); *************** *** 1062,1066 **** { temp = (uint8_t *)phRealloc(temp,cur_image_size); ! CHECK_NULLPTR(temp,"phRealloc","phRealloc failed"); } --- 1062,1066 ---- { temp = (uint8_t *)phRealloc(temp,cur_image_size); ! phCHECK_NULLPTR(temp,"phRealloc","phRealloc failed"); } *************** *** 1084,1088 **** loop_size, loop_ptr); ! PRINT_RC(rc,NULL,"setImage"); loop_size = output_buffer->getSize(); --- 1084,1088 ---- loop_size, loop_ptr); ! phPRINT_RC(rc,NULL,"setImage"); loop_size = output_buffer->getSize(); *************** *** 1101,1105 **** /* Everything has been copied and everything is ready to start */ rc = this->signal_running(); ! PRINT_RC(rc,NULL,"this->signal_running"); DEBUG_PRINT("Thread Started\n"); --- 1101,1105 ---- /* Everything has been copied and everything is ready to start */ rc = this->signal_running(); ! phPRINT_RC(rc,NULL,"this->signal_running"); DEBUG_PRINT("Thread Started\n"); *************** *** 1154,1161 **** &loop_size ); ! PRINT_RC(rc,NULL,"output_buffer->swapData"); /* ! PRINT("loop w:%u h:%u f:0x%08x s:%u p:%p\n", loop_width,loop_height,loop_format,loop_size,loop_ptr); */ --- 1154,1161 ---- &loop_size ); ! phPRINT_RC(rc,NULL,"output_buffer->swapData"); /* ! phPRINT("loop w:%u h:%u f:0x%08x s:%u p:%p\n", loop_width,loop_height,loop_format,loop_size,loop_ptr); */ *************** *** 1175,1179 **** { temp = (uint8_t *)phRealloc(temp,cur_image_size); ! CHECK_NULLPTR(temp,"phRealloc","phRealloc failed"); } --- 1175,1179 ---- { temp = (uint8_t *)phRealloc(temp,cur_image_size); ! phCHECK_NULLPTR(temp,"phRealloc","phRealloc failed"); } *************** *** 1209,1218 **** error: ! PROGRESS("Thread returning with error\n"); phFree(temp); rc = this->signal_error(); ! PRINT_RC(rc,NULL,"this->signal_error"); return phFAIL; --- 1209,1218 ---- error: ! phPROGRESS("Thread returning with error\n"); phFree(temp); rc = this->signal_error(); ! phPRINT_RC(rc,NULL,"this->signal_error"); return phFAIL; |