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

πŸ’– XvSetPortAttribute(3) β€” the libXv glow-up for your video port ✨

okay bestie, come sit with me, because this one is literally a libXv function and it's giving main character energy. This page is XvSetPortAttribute(3), and it lives in the libXv family. If you've ever wanted to reach into a video port and just… change its vibe? This is the girl. πŸŽ€


🌸 NAME 🌸

XvSetPortAttribute β€” sets an attribute of a video port πŸ’…


✨ SYNOPSIS ✨

#include <X11/extensions/Xvlib.h>

int XvSetPortAttribute(Display *dpy, XvPortID port,
                       Atom attribute, int value);

no cap, that's the whole signature. four args, one int back. iconic. πŸ¦‹


🫢 ARGUMENTS 🫢

  • dpy β€” the connection to the X server. your whole line to the server, basically your group chat with it.
  • port β€” the port whose attribute is getting used. like, which port are we doing this to.
  • attribute β€” identifies the port attribute this request is gonna set. it can be one of the table entries under the column "String," below. yep, the strings below, those ones. πŸ‘‡
  • value β€” the value that attribute is being set to. it can be one of the table entries under the column "Type," below. yes queen, cross-reference the table.

πŸ’… DESCRIPTION πŸ’…

So XvSetPortAttribute(3) lets a client set the port attribute to specified values. that's it, that's the job. and this request supports the following values:

  • "XV_ENCODING" β€” type XvEncodingID β€” default: Server dependent
  • "XV_HUE" β€” type [-1000...1000] β€” default: 0
  • "XV_SATURATION" β€” type [-1000...1000] β€” default: 0
  • "XV_BRIGHTNESS" β€” type [-1000...1000] β€” default: 0
  • "XV_CONTRAST" β€” type [-1000...1000] β€” default: 0

(that's the Attribute String / Type / Default situation, all five rows, nothing skipped, we keep the receipts. 🧾)

The supplied encoding must be one of the encodings listed for the adaptor, otherwise an Encoding error results. so like… don't freestyle the encoding, it will not eat. πŸ™ˆ

If the adaptor does not support the exact hue, saturation, brightness, and contrast levels you supplied, the closest levels supported are assumed. it's doing its best, okay?? and heads up β€” use XvGetPortAttribute(3) to query the resulting levels, because what you asked for and what you got might not be twins fr fr. πŸ”

When an XvSetPortAttribute(3) request is processed, a XvPortNotify(3) event is generated for all clients that have requested notification of port changes using XvSelectPortNotify(3). so everybody who signed up for the notifs gets pinged. group chat goes off. πŸ””


⭐ RETURN VALUES ⭐

  • [Success] β€” returned if XvSetPortAttribute(3) completed successfully. slay, we ate. πŸ’–
  • [XvBadExtension] β€” returned if the Xv extension is unavailable. she's not here, she's not coming. 😭
  • [XvBadAlloc] β€” returned if XvSelectVideoNotify(3) failed to allocate memory to process the request. ran out of room, tragic. πŸ’€

πŸ”₯ DIAGNOSTICS πŸ”₯

  • [XvBadPort] β€” generated if the requested port does not exist. that port is a ghost, bestie. πŸ‘»
  • [XvBadEncoding] β€” generated if an encoding is specified that does not exist. made-up encoding? not on my watch. 🚫
  • [BadMatch] β€” generated if the requested attribute atom does not specify an attribute supported by the adaptor. the adaptor said "never heard of her." πŸ™…β™€οΈ

🌈 SEE ALSO 🌈

XvGetPortAttribute(3), XvQueryPortAttributes(3), XvSelectPortNotify(3), XvPortNotify(3)

like, go read those too, iykyk. πŸ‘‘


real talk: if the levels you asked for aren't supported, the closest ones get assumed β€” so always circle back with XvGetPortAttribute(3) before you trust the numbers. no guessing, just checking. 🫢

and that's the page, periodt. πŸ’œ this whole thing came out of X Version 11, specifically libXv 1.0.13 β€” so when you see XvSetPortAttribute(3) out in the wild, that's the era she's from. mwah, bye bestie! πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from