diff --git a/FrOSCon26/.gitignore b/FrOSCon26/.gitignore index 994ac21..a10df0f 100644 --- a/FrOSCon26/.gitignore +++ b/FrOSCon26/.gitignore @@ -4,4 +4,5 @@ .settings build .~lock* -*.log \ No newline at end of file +*.log +*.raw diff --git a/FrOSCon26/FrOSCon.26.mm b/FrOSCon26/FrOSCon.26.mm index e4f728f..d24b5a8 100644 --- a/FrOSCon26/FrOSCon.26.mm +++ b/FrOSCon26/FrOSCon.26.mm @@ -2418,8 +2418,7 @@ im State SHOW pasiert jetzt gar nicht mehr das Display, sondern es bedeutet nun, daß der Frame weitergegeben werden muß

- - + @@ -2433,9 +2432,157 @@ + + + + + +

+ ...weil das der Default ist, ich hab deshalb nämlich gar keine angegeben +

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + +

+ ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 30 demovideo-320.raw +

+ +
+ +
+ + + + +

+ vlc --demux rawvideo --rawvid-width 320 --rawvid-height 240 --rawvid-chroma RV24 --rawvid-fps 30 demovideo-320.raw +

+ +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ das ist zwar nicht logisch, und auch nicht so dokumentiert, wurde aber von anderen Leuten bereits für GTK-3 beobachtet +

+ +
+ +
+ + + +
+ + + + + + + + + +

+ prevState != SHOW +

+ +
+ + + +

+ denn zur Anzeige wird der Slot auf SHOW gesetzt; zu prüfen ist also, daß dieser Zustand sich geändert hat. +

+

+ +

+ +
+
+
+
+ + + + + + + +

+ io_uring_submit(&uRing)  vergessen +

+ +
+ +
+
+ + + + + + + + + + + + - -
diff --git a/FrOSCon26/examples/demo-uring.cpp b/FrOSCon26/examples/demo-uring.cpp index 483e4d7..2825873 100644 --- a/FrOSCon26/examples/demo-uring.cpp +++ b/FrOSCon26/examples/demo-uring.cpp @@ -170,6 +170,7 @@ UringVideoPlayer::playVideo() { maybeDisplayFrame(); addNextReadSubmissions (uRing, inputFD); + io_uring_submit (&uRing); } else handleCompletedRead (*completion); @@ -202,6 +203,7 @@ UringVideoPlayer::addNextReadSubmissions (io_uring& uRing, int inputFD) ,BUFFSIZ * srcOffset ); io_uring_sqe_set_data64 (readSubmission, nextRead_); + buffState_[nextRead_ % RING_SIZ].store (READ, std::memory_order_relaxed); ++nextRead_; } } @@ -236,10 +238,10 @@ UringVideoPlayer::handleCompletedRead (io_uring_cqe& completion) void UringVideoPlayer::maybeDisplayFrame() { - auto prevState = buffState_[currShow_ % RING_SIZ].load (std::memory_order_relaxed); + auto prevState = buffState_[currShow_ % RING_SIZ].load (std::memory_order_acquire); auto nextState = buffState_[nextShow_ % RING_SIZ].load (std::memory_order_relaxed); - if (nextState == FEED and prevState == FREE) + if (nextState == FEED and prevState != SHOW) { // can hand over this next frame to the VideoDisplay in the GUI-thread currShow_ = nextShow_; ++nextShow_; @@ -307,8 +309,10 @@ UringVideoPlayer::terminate() unique_ptr launchPlayer (Gtk::Window& appWindow) -{ - appWindow.resize (VIDEO_WIDTH, VIDEO_HEIGHT); +{ // force minimum size to fit the player... + appWindow.set_size_request (VIDEO_WIDTH, VIDEO_HEIGHT); + appWindow.set_resizable (false); + return std::make_unique (appWindow); } diff --git a/FrOSCon26/examples/gtk-uring-app.hpp b/FrOSCon26/examples/gtk-uring-app.hpp index b98697d..ecca33d 100644 --- a/FrOSCon26/examples/gtk-uring-app.hpp +++ b/FrOSCon26/examples/gtk-uring-app.hpp @@ -48,7 +48,6 @@ class GtkUringApp public: DemoWindow() { -// set_default_size (CTX::VIDEO_WIDTH, CTX::VIDEO_HEIGHT); set_resizable (false); add (button_); button_.show();