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

πŸ’– XvPutVideo πŸ’–

okay bestie, welcome to the libXv function page for XvPutVideo β€” it's giving "put video in a drawable" energy and honestly? iconic. this is a libXv function, so it lives over in X land, and it is literally here to write video into a drawable. periodt. πŸŽ€


✨ NAME ✨

XvPutVideo β€” write video into a drawable πŸ¦‹


🌸 SYNOPSIS 🌸

#include <X11/extensions/Xvlib.h>

int XvPutVideo(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);

πŸ’… ARGUMENTS πŸ’…

  • dpy β€” the connection to the X server. that's your whole entire link to the server, bestie πŸ’œ
  • port β€” the port you're getting the video from. this is where the video comes in, no cap.
  • d β€” the drawable (aka a window) that the video is gonna be written into. main character destination energy πŸ‘‘
  • gc β€” the graphical context. the GC components in play are: subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask. that's the whole list, not one more, not one less 🫢
  • vx,vy,vw,vh β€” these define the size and location of the source (video) region that's getting written. vx and vy are the upper-left pixel of the region, and vw and vh are the width and height of the region, in pixels. so like, where it starts and how big it is. simple πŸ’–
  • dx,dy,dw,dh β€” these define the location and size of the destination (drawable) region that the video image gets written into. dx and dy are the upper-left pixel of that region, and dw and dh are the width and height, in pixels, of the region. source vs destination, two different vibes, don't mix them up bestie 🌈

πŸ”₯ DESCRIPTION πŸ”₯

so XvPutVideo writes video into a drawable. that's the whole assignment. πŸ’…

the position and size of the source (video) rectangle is specified by vx, vy, vw, and vh. the position and size of the destination (drawable) rectangle is specified by dx, dy, dw, and dh. two rectangles, one function, we love to see it ✨

here's the tea on how the video data actually gets handled: it's clipped to the bounds of the video encoding, then scaled to the requested drawable region size (or the closest size that's actually supported β€” not me being flexible 😌), and then it's clipped to the bounds of the drawable. clip, scale, clip. the three-step glow-up πŸŽ€

now for the events, because there are several and they all matter:

  • if video is successfully initiated, an XvVideoNotify event with detail XvStarted is generated for the drawable. slay, we're live πŸ¦‹
  • if the port is already in use, its video is preempted, and if the new drawable is different than the old one, an XvVideoNotify event with detail XvPreempted is generated for the old drawable. yeah, the old drawable gets the notification. it's giving breakup text πŸ’€
  • if the port is grabbed by another client, this request is ignored, and an XvVideoNotify event with detail XvBusy is generated for the drawable. not us getting ghosted by a grabbed port 😭
  • if the port is not receiving a valid video signal, or if the video signal gets interrupted while video is active, a VideoNotify event with detail XvHardError is generated for the drawable. that's the bad one, bestie. the "something went very wrong" one πŸ™ˆ

⭐ RETURN VALUES ⭐

  • [Success] β€” returned if XvPutVideo(3) completed successfully. we ate and left no crumbs πŸ‘‘
  • [XvBadExtension] β€” returned if the Xv extension is unavailable. the extension said "not today" πŸ’€
  • [XvBadAlloc] β€” returned if there were insufficient resources to process the request. no resources, no vibes 😭

πŸ’œ DIAGNOSTICS πŸ’œ

  • [XvBadPort] β€” generated if the requested port does not exist. that port is a ghost, fr fr πŸ‘»
  • [BadDrawable] β€” generated if the requested drawable does not exist.
  • [BadGC] β€” generated if the requested graphics context does not exist.
  • [BadAlloc] β€” generated if there were insufficient resources to process the request.
heads up bestie β€” these are errors, they get generated when stuff doesn't exist or you're out of resources. keep your ports, drawables and GCs real and alive πŸ’…

🌈 SEE ALSO 🌈


and that's the whole page, bestie!! πŸ«ΆπŸ’– you now know how to write video into a drawable, which is lowkey a flex. go forth and be iconic with it ✨

kisses, and remember: this came to you from X Version 11, libXv 1.0.13 β€” mwah, xoxo πŸŽ€πŸŒΈπŸ’œ

πŸ“¦ where this page comes from