Prototype: demo works — after fixing obvious mistakes
No fundamental problem discovered thus far... - GTK-3 does not resize the window, need to `set_size_request()` (instead of `resize()`) - forgot to set slot-state to READ ⟹ submissions flood the full queue - condition to allow frame display was too tight, thus slipping at first frame - forgot to submit follow-up read tasks
This commit is contained in:
parent
c9f9fec117
commit
0cda45278c
4 changed files with 161 additions and 10 deletions
3
FrOSCon26/.gitignore
vendored
3
FrOSCon26/.gitignore
vendored
|
|
@ -4,4 +4,5 @@
|
|||
.settings
|
||||
build
|
||||
.~lock*
|
||||
*.log
|
||||
*.log
|
||||
*.raw
|
||||
|
|
|
|||
|
|
@ -2418,8 +2418,7 @@
|
|||
im State SHOW pasiert jetzt gar nicht mehr das Display, sondern es bedeutet nun, daß der Frame weitergegeben werden muß
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<linktarget COLOR="#a03127" DESTINATION="ID_194548529" ENDARROW="Default" ENDINCLINATION="373;0;" ID="Arrow_ID_726120332" SOURCE="ID_312946304" STARTARROW="None" STARTINCLINATION="-39;152;"/>
|
||||
</node>
|
||||
<node CREATED="1784221423989" ID="ID_1367029376" MODIFIED="1784221595584" TEXT="nenne diese Phase jetzt FEED">
|
||||
|
|
@ -2433,9 +2432,157 @@
|
|||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1784229335474" ID="ID_476891533" MODIFIED="1784229337398" TEXT="Fragen">
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1784229339746" ID="ID_655619575" MODIFIED="1784229414327" TEXT="bisher habe ich in addNext... die mem_order_seq_cst">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
...weil das der Default ist, ich hab deshalb nämlich gar keine angegeben
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<font NAME="SansSerif" SIZE="12"/>
|
||||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1784229415567" ID="ID_572644187" MODIFIED="1784229431525" TEXT="gäbe es einen Unterschied zu mem_order_acquire?"/>
|
||||
<node CREATED="1784229436588" ID="ID_1851133925" MODIFIED="1784229459165" TEXT="oder wird beim Lesen keine Write-Barrier erzeugt?"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1784222841942" ID="ID_74519525" MODIFIED="1784239417461" TEXT="zum Laufen bringen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1784223517618" ID="ID_609106899" MODIFIED="1784223526502" TEXT="startet schon mal bis zum Öffnen des File"/>
|
||||
<node CREATED="1784223529015" ID="ID_1980887771" MODIFIED="1784223533004" TEXT="brauche nun ein Testvideo">
|
||||
<node CREATED="1784223536006" ID="ID_44452226" MODIFIED="1784223551564" TEXT="Test-1: nehme die Animation von letztem Jahr">
|
||||
<node BACKGROUND_COLOR="#accdc3" COLOR="#010101" CREATED="1784226368203" ID="ID_1901417329" MODIFIED="1784226455132" STYLE="fork" TEXT="lasse mir von Claude ein Aufruf-Programm erzeugen">
|
||||
<edge COLOR="#808080" STYLE="bezier" WIDTH="thin"/>
|
||||
<icon BUILTIN="idea"/>
|
||||
<node CREATED="1784226456781" ID="ID_401970861" MODIFIED="1784226467897" TEXT="hinzugefügt zum letztjährigen Froscon-Projekt"/>
|
||||
<node CREATED="1784226468341" ID="ID_399827309" MODIFIED="1784226488382" TEXT="als neuer Unterordner examples/raw"/>
|
||||
<node CREATED="1784226522365" ID="ID_303378535" MODIFIED="1784226528208" TEXT="verwendet image-gen"/>
|
||||
<node CREATED="1784226528773" ID="ID_1747867217" MODIFIED="1784226537423" TEXT="schreibt ein Raw-Video ins aktuelle Verzeichnis"/>
|
||||
</node>
|
||||
<node CREATED="1784226886199" ID="ID_1477642542" MODIFIED="1784227084689" TEXT="anzeigen....">
|
||||
<icon BUILTIN="back"/>
|
||||
<node CREATED="1784226890979" ID="ID_634134790" MODIFIED="1784226920034" TEXT="ffplay">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 30 demovideo-320.raw
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="wizard"/>
|
||||
</node>
|
||||
<node CREATED="1784226921919" ID="ID_454447584" MODIFIED="1784226963886" TEXT="vlc">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
vlc --demux rawvideo --rawvid-width 320 --rawvid-height 240 --rawvid-chroma RV24 --rawvid-fps 30 demovideo-320.raw
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="wizard"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1784228106784" ID="ID_1212494407" MODIFIED="1784229520498" STYLE="fork" TEXT="Segfault">
|
||||
<font NAME="SansSerif" SIZE="12"/>
|
||||
<icon BUILTIN="broken-line"/>
|
||||
<node CREATED="1784228751285" ID="ID_1565658342" MODIFIED="1784228767139" TEXT="beim ersten initialen Befüllen der SQ"/>
|
||||
<node CREATED="1784228768814" ID="ID_259879669" MODIFIED="1784228789008" TEXT="der Timer-Entry funktioniert"/>
|
||||
<node CREATED="1784228840197" ID="ID_870664557" MODIFIED="1784228851823" TEXT="ein SQE kommt als NULL zurück"/>
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1784228853179" ID="ID_1537742880" MODIFIED="1784229512039" TEXT="AUA ... nextRead_ steht auf 7">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1784228886607" ID="ID_630552952" MODIFIED="1784228889758" TEXT="wir wrappen">
|
||||
<node CREATED="1784228902224" ID="ID_1676148614" MODIFIED="1784228918826" TEXT="(intern faßt die Queue sogar 8 Einträge)">
|
||||
<icon BUILTIN="idea"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1784228920986" ID="ID_815377389" MODIFIED="1784239445118" TEXT="der State-Marker wurde nicht weitergeschaltet">
|
||||
<icon BUILTIN="broken-line"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1784235804029" ID="ID_1424148212" MODIFIED="1784235907976" TEXT="Fenster zu klein">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1784235809692" ID="ID_1855255977" MODIFIED="1784235916712" TEXT="das window.set_size() wird ignoriert">
|
||||
<icon BUILTIN="help"/>
|
||||
</node>
|
||||
<node CREATED="1784235819503" ID="ID_1683175695" LINK="https://stackoverflow.com/a/3582628/444796" MODIFIED="1784235920446" TEXT="Suche im Netz: set_resizable(false) zwingt auf den size-request zurück">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
das ist zwar nicht logisch, und auch nicht so dokumentiert, wurde aber von anderen Leuten bereits für GTK-3 beobachtet
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="idea"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1784235892210" ID="ID_1028422738" MODIFIED="1784235902975" TEXT="Lösung: set_size_request() direkt im launchPlayer()">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1784229521721" ID="ID_698829631" MODIFIED="1784238411088" TEXT="Alle Frames Slipped">
|
||||
<icon BUILTIN="broken-line"/>
|
||||
<node CREATED="1784238232017" ID="ID_1493418690" MODIFIED="1784238248280" TEXT="Anzeigebedingung greift nicht im Anfangszustand"/>
|
||||
<node CREATED="1784238248956" ID="ID_1279441149" MODIFIED="1784238267938" TEXT="zu Beginn ist currShow ≡ nextShow">
|
||||
<node CREATED="1784238311811" ID="ID_210721081" MODIFIED="1784238324834" TEXT="Bedingung präziser formulieren"/>
|
||||
<node CREATED="1784238325286" ID="ID_782122885" MODIFIED="1784238407314">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<font color="#3a1f18" face="DejaVu Sans Mono" size="9pt">prevState </font><font color="#65533c" face="DejaVu Sans Mono" size="9pt">!=</font><font color="#3a1f18" face="DejaVu Sans Mono" size="9pt"> </font><font color="#9d724e" face="DejaVu Sans Mono" size="9pt"><i>SHOW</i></font>
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
denn zur Anzeige wird der Slot auf <font color="#9d724e" face="DejaVu Sans Mono"><i>SHOW </i></font>gesetzt; zu prüfen ist also, daß dieser Zustand sich geändert hat.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1784238412197" ID="ID_377076622" MODIFIED="1784239365101" TEXT="5 Frames angezeigt — dann Slipped">
|
||||
<icon BUILTIN="broken-line"/>
|
||||
<node CREATED="1784239290031" ID="ID_826828158" MODIFIED="1784239308912" TEXT="im 5. ≙ 0.Slot steht READ"/>
|
||||
<node CREATED="1784239309460" ID="ID_686652707" MODIFIED="1784239363002">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
<font color="#642880" face="DejaVu Sans Mono"><b>io_uring_submit</b></font><font color="#11123a" face="DejaVu Sans Mono">(</font><font color="#65533c" face="DejaVu Sans Mono">&</font><font color="#803435" face="DejaVu Sans Mono">uRing</font><font color="#11123a" face="DejaVu Sans Mono">)</font>  vergessen
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="broken-line"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#174956" COLOR="#8dfd49" CREATED="1784239367168" HGAP="13" ID="ID_790023827" MODIFIED="1784239428069" STYLE="bubble" TEXT="Kaum macht mans richtig — schon funktioniert's" VSHIFT="12">
|
||||
<edge COLOR="#61fe5b" STYLE="bezier" WIDTH="thin"/>
|
||||
<font NAME="SansSerif" SIZE="14"/>
|
||||
<node COLOR="#054262" CREATED="1784239826448" ID="ID_273149802" MODIFIED="1784239872263" STYLE="fork" TEXT="auch getested: schnellere Wiedergabe">
|
||||
<font NAME="SansSerif" SIZE="11"/>
|
||||
</node>
|
||||
<node COLOR="#054262" CREATED="1784239826448" ID="ID_776972591" MODIFIED="1784239931511" STYLE="fork" TEXT="getested: Playback-Stop bei end-of-file">
|
||||
<font NAME="SansSerif" SIZE="11"/>
|
||||
</node>
|
||||
<node COLOR="#054262" CREATED="1784239826448" ID="ID_1233113947" MODIFIED="1784239901209" STYLE="fork" TEXT="getested: Fenster verschieben während Widergabe">
|
||||
<font NAME="SansSerif" SIZE="11"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1784222841942" ID="ID_74519525" MODIFIED="1784222846614" TEXT="zum Laufen bringen">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
|||
|
|
@ -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<UringVideoPlayer>
|
||||
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<UringVideoPlayer> (appWindow);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ class GtkUringApp
|
|||
public:
|
||||
DemoWindow()
|
||||
{
|
||||
// set_default_size (CTX::VIDEO_WIDTH, CTX::VIDEO_HEIGHT);
|
||||
set_resizable (false);
|
||||
add (button_);
|
||||
button_.show();
|
||||
|
|
|
|||
Loading…
Reference in a new issue