]> git.sesse.net Git - bmusb/blobdiff - bmusb.cpp
Make the received timestamps in FakeCapture much more stable.
[bmusb] / bmusb.cpp
index c34a646b79f45d028897f501eabb2c4b5fa57c31..0c3fb551570188ba74e674d9e181f5ca3514b66b 100644 (file)
--- a/bmusb.cpp
+++ b/bmusb.cpp
@@ -1,4 +1,4 @@
-// Intensity Shuttle USB3 capture driver, v0.5.3
+// Intensity Shuttle USB3 capture driver, v0.5.4
 // Can download 8-bit and 10-bit UYVY/v210 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)
@@ -13,6 +13,7 @@
 #include <libusb.h>
 #include <unistd.h>
 #include <netinet/in.h>
+#include <pthread.h>
 #include <sched.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -289,6 +290,10 @@ void dump_audio_block(uint8_t *audio_start, size_t audio_len)
 
 void BMUSBCapture::dequeue_thread_func()
 {
+       char thread_name[16];
+       snprintf(thread_name, sizeof(thread_name), "bmusb_dequeue_%d", card_index);
+       pthread_setname_np(pthread_self(), thread_name);
+
        if (has_dequeue_callbacks) {
                dequeue_init_callback();
        }
@@ -886,6 +891,7 @@ void BMUSBCapture::usb_thread_func()
        if (sched_setscheduler(0, SCHED_RR, &param) == -1) {
                printf("couldn't set realtime priority for USB thread: %s\n", strerror(errno));
        }
+       pthread_setname_np(pthread_self(), "bmusb_usb_drv");
        while (!should_quit) {
                timeval sec { 1, 0 };
                int rc = libusb_handle_events_timeout(nullptr, &sec);