XvGetVideo(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

πŸ’– XvGetVideo(3) πŸ’–

okay bestie, pull up a chair, we're diving into libXv and specifically XvGetVideo(3) β€” the little function that captures video from a drawable. yes. that's the whole vibe. it grabs video out of a drawable and sends it to a port. slay. ✨


✨ SYNOPSIS ✨

#include <X11/extensions/Xvlib.h>

int XvGetVideo(Display *dpy, XvPortID port, Drawable d, GC gc,
               int vx, int vy, unsigned int vw, unsigned int vh,
               int dx, int dy, unsigned int dw, unsigned int dh);

like, that's it. that's the whole signature. no cap. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dpy β€” the connection to the X server. your lil hotline to the server, basically. ☎️
  • port β€” the port that video output gets sent to. this is where the video is headed, bestie.
  • d β€” the drawable (a window, hi) that we're getting the video output from. the source of the whole situation.
  • gc β€” the graphical context. and listen, only these GC components matter here, okay? subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask. the rest of the GC is just standing there, irrelevant. πŸ’…
  • vx, vy, vw, vh β€” these define the location and size of the video region that's getting written to. vx and vy are the x and y coordinates of the upper-left corner of the video region, and vw and vh are the width and height of that region, in pixels. so like, the destination rectangle. the glow-up spot. ✨
  • dx, dy, dw, dh β€” these define where on the source drawable the video image is being taken from. dx and dy are the x and y coordinates of the upper-left corner of the drawable region, and dw and dh are its width and height, in pixels. the source rectangle. the origin story. 🌸

🌈 DESCRIPTION 🌈

so XvGetVideo outputs video from a drawable. the position and size of the destination rectangle is specified by vx, vy, vw, and vh. the position and size of the source rectangle is specified by dx, dy, dw, and dh. two rectangles, one function, immaculate energy.

Drawable data gets clipped to the bounds of the drawable, then scaled to the requested video region size (or like, the closest size that's actually supported, bestie β€” they can't always give you exactly what you asked for), and then clipped to the bounds of the video encoding. and here's the tea: the contents of any region that doesn't get updated with drawable data is undefined. undefined. not zero, not black, not cute. just undefined. πŸ’€

If the video gets successfully initiated, an XvVideoNotify event with detail XvStarted is generated for the drawable. πŸŽ‰

If the port is already in use, its video gets preempted, and if the new drawable is different from the old one, an XvVideoNotify event with detail XvPreempted is generated for the old drawable. sorry babe, you got replaced.

And if the port is grabbed by another client? this request is just straight up ignored, and an XvVideoNotify event with detail XvBusy is generated for the drawable. it's giving "not me being left on read". 😭


⭐ RETURN VALUES ⭐

  • [Success] β€” returned when XvGetVideo(3) completed successfully. we love a happy ending. πŸ‘‘
  • [XvBadExtension] β€” returned if the Xv extension is unavailable. like, the whole extension? gone? can't relate, can't use it.
  • [XvBadAlloc] β€” returned if XvGetVideo(3) failed to allocate memory to process the request. it tried to cook and ran out of ingredients. πŸ“

πŸ’€ DIAGNOSTICS πŸ’€

  • [XvBadPort] β€” generated if the requested port does not exist. that port is not in this friend group.
  • [BadGC] β€” generated if the requested graphics context does not exist. no GC, no service.
  • [BadDrawable] β€” generated if the requested drawable does not exist. bestie where is it. where did it go. πŸ™ˆ
  • [BadAlloc] β€” generated if there were insufficient resources to process the request. the system is broke (resource-wise).
fr fr, watch your ports and drawables, because these errors are generated, not just politely returned. there's a difference and the X server does not care about your feelings.

πŸ‘‘ SEE ALSO πŸ‘‘


X Version 11 Β· libXv 1.0.13 Β· XvGetVideo(3)

okay that's the whole page bestie, go forth and capture that video, you absolute main character. πŸ¦‹πŸ’–βœ¨ periodt.

πŸ“¦ where this page comes from