XvGrabPort(3)

πŸ“¦
version 1.0.13 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

✨ 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 time is before the current port time, the XvGrabPort request is ignored and XvInvalidTime gets returned. stale request, no thanks πŸ’€
  • if the port is already grabbed by another client, you get XvAlreadyGrabbed back. 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 an XvVideoNotify event with detail XvPreempted is generated for its drawable. main character energy: you walked in, the other client's video had to leave 🌈

πŸ’– RETURN VALUES

  • [Success] β€” returned if XvGrabPort(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 if XvGrabPort(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