detached adcd7e5

docs(readme): check loop and context errors in the video example

commit
adcd7e54016728e72a3127d3fbfab0bb62f055b0
author
brice · · 2026-10-15 02:40 UTC
parent
d7dc935
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +11 -4
M README.md +11 -4
@@ -115,9 +115,15 @@ if err != nil {
115115 }
116116 defer rt.Deinit()
117117
118-loop, _ := rt.NewLoop()
118+loop, err := rt.NewLoop()
119+if err != nil {
120+ return err
121+}
119122 defer loop.Destroy()
120-ctx, _ := rt.NewContext(loop)
123+ctx, err := rt.NewContext(loop)
124+if err != nil {
125+ return err
126+}
121127 defer ctx.Destroy()
122128 core, err := ctx.Connect()
123129 if err != nil {
@@ -151,8 +157,9 @@ if b := src.Dequeue(); b != nil { // nil: no buffer is free, skip the frame
151157
152158 Buffers that PipeWire removes while you still hold them (renegotiation,
153159 `Resize`, `Destroy`, the consumer leaving) stay mapped until you hand them back
154-with `Queue` or `Release`. `Resize` and `Destroy` are best called when no buffer
155-is borrowed. A consumer that is not a plain `pipewiresrc` may need to declare
160+with `Queue` or `Release`. `Resize` fails with `ErrVideoBorrowed` while a buffer
161+is borrowed, and `Destroy` is best called when none is. Formats are BGRx and
162+BGRA. A consumer that is not a plain `pipewiresrc` may need to declare
156163 `media.type=Video` (for example `pipewiresrc stream-properties=props,media.type=Video`)
157164 for WirePlumber to link it.
158165
@@ -115,9 +115,15 @@ if err != nil {
115 }115 }
116 defer rt.Deinit()116 defer rt.Deinit()
117 117
118-loop, _ := rt.NewLoop()118+loop, err := rt.NewLoop()
119+if err != nil {
120+ return err
121+}
119 defer loop.Destroy()122 defer loop.Destroy()
120-ctx, _ := rt.NewContext(loop)123+ctx, err := rt.NewContext(loop)
124+if err != nil {
125+ return err
126+}
121 defer ctx.Destroy()127 defer ctx.Destroy()
122 core, err := ctx.Connect()128 core, err := ctx.Connect()
123 if err != nil {129 if err != nil {
@@ -151,8 +157,9 @@ if b := src.Dequeue(); b != nil { // nil: no buffer is free, skip the frame
151 157
152 Buffers that PipeWire removes while you still hold them (renegotiation,158 Buffers that PipeWire removes while you still hold them (renegotiation,
153 `Resize`, `Destroy`, the consumer leaving) stay mapped until you hand them back159 `Resize`, `Destroy`, the consumer leaving) stay mapped until you hand them back
154-with `Queue` or `Release`. `Resize` and `Destroy` are best called when no buffer160+with `Queue` or `Release`. `Resize` fails with `ErrVideoBorrowed` while a buffer
155-is borrowed. A consumer that is not a plain `pipewiresrc` may need to declare161+is borrowed, and `Destroy` is best called when none is. Formats are BGRx and
162+BGRA. A consumer that is not a plain `pipewiresrc` may need to declare
156 `media.type=Video` (for example `pipewiresrc stream-properties=props,media.type=Video`)163 `media.type=Video` (for example `pipewiresrc stream-properties=props,media.type=Video`)
157 for WirePlumber to link it.164 for WirePlumber to link it.
158 165

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 8

↑↓ moveenter openesc close