XvPutVideo(3)
π 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, andclip-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.vxandvyare the upper-left pixel of the region, andvwandvhare 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.dxanddyare the upper-left pixel of that region, anddwanddhare 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
XvVideoNotifyevent with detailXvStartedis 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
XvVideoNotifyevent with detailXvPreemptedis 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
XvVideoNotifyevent with detailXvBusyis 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
VideoNotifyevent with detailXvHardErroris generated for the drawable. that's the bad one, bestie. the "something went very wrong" one π
β RETURN VALUES β
[Success]β returned ifXvPutVideo(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
- 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