]> git.sesse.net Git - bmusb/commitdiff
Release 0.7.8. master 0.7.8
authorSteinar H. Gunderson <steinar+nageru@gunderson.no>
Tue, 30 Apr 2024 19:48:51 +0000 (21:48 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 30 Apr 2024 19:48:51 +0000 (21:48 +0200)
Makefile
bmusb.cpp
v4l2proxy.cpp

index f7a54c84da5beac9d601e17daf3443aa32d76437..f21c9ffe4dedd1bfa2bc155828e57271c9bcbf47 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ UDEVDIR ?= /lib/udev
 LIB := libbmusb.a
 SODEV := libbmusb.so
 SONAME := libbmusb.so.6
-SOLIB := libbmusb.so.6.0.2
+SOLIB := libbmusb.so.6.0.4
 
 all: $(LIB) $(SOLIB) main bmusb-v4l2proxy
 
index 0169d062dad8d1823ed441e29cc3938eee2c2e09..19a9da1aa2c52ca1ed22c980b3c244db405970e6 100644 (file)
--- a/bmusb.cpp
+++ b/bmusb.cpp
@@ -1,4 +1,4 @@
-// Intensity Shuttle USB3 capture driver, v0.7.6
+// Intensity Shuttle USB3 capture driver, v0.7.8
 // Can download 8-bit and 10-bit UYVY/v210-ish frames from HDMI, quite stable
 // (can do captures for hours at a time with no drops), except during startup
 // 576p60/720p60/1080i60 works, 1080p60 does not work (firmware limitation)
index 4e0b36b3d1b40da41fbe07d10afc3abb67613ce1..7ead4aa1b60f352ca5070724aed68a9a0225f4e5 100644 (file)
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <errno.h>
 #include <sys/ioctl.h>
 #include <linux/videodev2.h>
 #include <bmusb/bmusb.h>
@@ -84,7 +85,20 @@ void frame_callback(uint16_t timecode,
                }
 #endif
 
-               write(video_fd, origptr, video_frame.len);
+               size_t len = video_frame.len;
+               while (len > 0) {
+                       ssize_t ret = write(video_fd, origptr, len);
+                       if (ret == -1) {
+                               if (errno == EINTR) {
+                                       continue;
+                               } else {
+                                       perror("write");
+                                       break;  // Hope for better luck next frame.
+                               }
+                       }
+                       origptr += ret;
+                       len -= ret;
+               }
        }
 
        usb->get_video_frame_allocator()->release_frame(video_frame);