XvGrabPort(3)
β¨ XvGrabPort π β lock port for exclusive use by client
okay bestie, welcome to the libXv manual, XvGrabPort edition. this one lives in the libXv Functions family, and it's giving "i call dibs and i mean it" energy. let's get into it π«Ά
πΈ SYNOPSIS
#include <X11/extensions/Xvlib.h>
int XvGrabPort(Display *dpy, XvPortID port, Time time);
like yes, that's the whole thing. short. iconic. she doesn't need a glow-up β¨
π ARGUMENTS
dpyβ the connection to the X server. your whole link-up, basically. that's how you two are talking rn πportβ the port you're about to grab. this is the one you're claiming as yours πtimeβ the timestamp of the request. very much a "when was this asked for" situation β°
π¦ DESCRIPTION
so, XvGrabPort(3) grabs a port. periodt. once a client grabs a port, only that client can make video requests to that port. everybody else? locked out. sorry not sorry π
here's the vibe check on the timing, because this part is literally important:
- if
timeis before the current port time, theXvGrabPortrequest is ignored andXvInvalidTimegets returned. stale request, no thanks π - if the port is already grabbed by another client, you get
XvAlreadyGrabbedback. she's taken, bestie π - otherwise it returns a status of
Success. slay π
and the port time gets updated when these requests are processed β memorise the list, iykyk:
also, if the port is actively processing video for another client, that video gets preempted (!!), and anXvVideoNotifyevent with detailXvPreemptedis generated for its drawable. main character energy: you walked in, the other client's video had to leave π
π RETURN VALUES
[Success]β returned ifXvGrabPort(3)completed successfully. we love a win β¨[XvInvalidTime]β returned if the requested time is older than the current port time. too late, babes β³[XvAlreadyGrabbed]β returned if the port is already grabbed by another client. it's not you, it's them π[XvBadExtension]β returned if the Xv extension is unavailable. no extension, no service π«[XvBadAlloc]β returned ifXvGrabPort(3)failed to allocate memory to process the request. brain empty, cannot compute π
β DIAGNOSTICS
[XvBadPort]β generated if the requested port does not exist. that port is not real, bestie π³οΈ
π SEE ALSO
X Version 11 Β· libXv 1.0.13 β that's the version and the date tag straight from the footer, no cap. stay slaying, and go grab that port πππ¦
π¦ where this page comes from
- alpine 3.22: libxv-doc 1.0.13-r0 Β· MIT
- alpine 3.23: libxv-doc 1.0.13-r0 Β· MIT
- alpine 3.24: libxv-doc 1.0.13-r0 Β· MIT
- arch rolling: libxv 1.0.13-1 Β· SMLNJ AND HPND-sell-variant
- fedora 43: libXv-devel 1.0.13-3.fc43 Β· SMLNJ AND HPND-sell-variant
- fedora 43: libXv-devel 1.0.13-3.fc43 Β· SMLNJ AND HPND-sell-variant
- fedora 44: libXv-devel 1.0.13-4.fc44 Β· SMLNJ AND HPND-sell-variant
- fedora 44: libXv-devel 1.0.13-4.fc44 Β· SMLNJ AND HPND-sell-variant
- ubuntu resolute: libxv-dev 2:1.0.13-1 Β· MIT
- ubuntu stonking: libxv-dev 2:1.0.13-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms