]> git.sesse.net Git - nageru/blobdiff - main.cpp
Actually start showing JPEGs on the screen.
[nageru] / main.cpp
index 17431aa46f127bb06fb33cd0dc9ec705bdcfc430..0a976c3d438994e6c95dce9faabc4556cf766715 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -17,6 +17,8 @@ extern "C" {
 
 #include "mainwindow.h"
 #include "ffmpeg_raii.h"
+#include "post_to_main_thread.h"
+#include "ui_mainwindow.h"
 
 #define MAX_STREAMS 16
 
@@ -78,6 +80,14 @@ int thread_func()
                fwrite(pkt.data, pkt.size, 1, fp);
                fclose(fp);
 
+               post_to_main_thread([pkt] {
+                       if (pkt.stream_index == 0) {
+                               global_mainwindow->ui->input1_display->setFrame(pkt.stream_index, pkt.pts);
+                       } else if (pkt.stream_index == 1) {
+                               global_mainwindow->ui->input2_display->setFrame(pkt.stream_index, pkt.pts);
+                       }
+               });
+
                assert(pkt.stream_index < MAX_STREAMS);
                frames[pkt.stream_index].push_back(pkt.pts);