Compare commits

..

3 Commits

@ -60,7 +60,7 @@ void axis_history_add(int axis, double diff, double out) {
}
#define CALIB_MAXSPEED 1.0
#define CALIB_DURATION_DELTA 10.0
#define CALIB_DURATION_DELTA 5.0
#define CALIB_DURATION_AXIS (CALIB_DURATION_DELTA / CALIB_MAXSPEED)
void posctl_gui_update();

@ -121,7 +121,7 @@ int VideoDev_Dumpfile::Open() {
}
filesize = s.st_size;
if ((fd = open(fname.c_str(), O_RDONLY)) == -1) {
if ((fd = open(fname.c_str(), O_RDONLY | O_BINARY)) == -1) {
printf ("%s:%d could not open file '%s' error:%s\n", __FILE__, __LINE__, fname.c_str(), strerror(errno));
return VDEV_STATUS_ERROR;
}
@ -267,9 +267,8 @@ int VideoDev_Dumpfile::ReadFrame() {
//
// read frame
if (read (fd, inbuf, 4*2) != 4*2) {
printf ("%s:%d could not read frame header\n", __FILE__, __LINE__);
printf ("%s:%d could not read frame header: %s\n", __FILE__, __LINE__, strerror(errno));
Close();
}
filepos += (4*2);
inframe_size = ntohl(inbuf[0]);
@ -291,9 +290,8 @@ int VideoDev_Dumpfile::ReadFrame() {
printf ("%s:%d cloud not allocate enought memory\n", __FILE__, __LINE__);
return VDEV_CBSTATUS_ERROR;
}
if (read (fd, inframe, inframe_size) != inframe_size) {
printf ("%s:%d could not read frame\n", __FILE__, __LINE__);
printf ("%s:%d could not read frame: %s\n", __FILE__, __LINE__, strerror(errno));
Close();
}
filepos += inframe_size;

@ -226,8 +226,8 @@ int VideoDev_VFW::Open() {
capSetUserData(cap, this);
// set video source, capture format and size
capDlgVideoSource(cap);
capDlgVideoFormat(cap);
//capDlgVideoSource(cap);
//capDlgVideoFormat(cap);
CAPTUREPARMS cp;
if(!capCaptureGetSetup(cap, &cp, sizeof(cp))) {
@ -426,7 +426,9 @@ void VideoDev_VFW::HandleMessages() {
*/
int VideoDev_VFW::Grab(VideoFrameRaw *vf) {
// Do not know exactly why, but needed to translate/dispatch window message
HandleMessages();
if (inframe == NULL) return VDEV_STATUS_ERROR;
if (GetFrameBufferSize() > 0) {

Loading…
Cancel
Save