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

πŸ’– NAME πŸ’–

XvQueryAdaptors β€” bestie, this is the one that pulls up all the adaptor info for a screen. like, the whole roster. πŸŽ€


✨ SYNOPSIS ✨

#include <X11/extensions/Xvlib.h>

int XvQueryAdaptors(Display *dpy, Window window,
                    unsigned int *p_num_adaptors,
                    XvAdaptorInfo **pp_adaptor_info);

okay so this is from libXv, the manual page lives in section 3, and she's serving c function realness πŸ’…


🌸 ARGUMENTS 🌸

  • dpy β€” the connection to the X server. your whole vibe-link to the display, no cap.
  • window β€” a window of the screen you want adaptor info for. literally any window on that screen, she'll figure out which screen you mean from it. πŸͺŸ
  • p_num_adaptors β€” a pointer to where the number of adaptors for the specified screen gets dropped off. you give her the address, she fills it in. ✨
  • pp_adaptor_info β€” a pointer to where the list of returned adaptor information lands. yes that's a pointer to a pointer. she's that kind of girl. πŸ’…

πŸ‘‘ DESCRIPTION πŸ‘‘

So XvQueryAdaptors(3) returns video adaptor information for the screen of the specified drawable. iconic behaviour honestly.

The XvAdaptorInfo structure has this exact organization:

typedef struct {
  XvPortID base_id;
  unsigned long num_ports;
  char type;
  char *name;
  unsigned long num_formats;
  XvFormat *formats;
  unsigned long num_adaptors;
} XvAdaptorInfo;

and here's what each lil field is giving:

  • base_id β€” the resource ID of the first adaptor port. the origin point, the main character's entrance. ⭐
  • num_ports β€” how many ports this adaptor supports.
  • type β€” a bit mask, okay pay attention bestie 🫢. XvInputMask is asserted if the adaptor supports video input, and XvOutputMask is asserted if it supports video output. AND in Xv protocol 2.2 and later, there are 3 new bits defined β€” XvVideoMask, XvStillMask and XvImageMask β€” indicating the adaptor is capable of video, still or image primitives respectively. three new icons dropped in the update, we love to see it. πŸ”₯
  • name β€” a vendor specific name that identifies the adaptor. her government name, basically.
  • num_formats β€” the number of depth/visual id formats supported by the adaptor.
  • formats β€” a pointer to an array of XvFormat structures.

and the XvFormat structure looks like THIS:

typedef struct {
  char depth;
  unsigned long visual_id;
} XvFormat;
  • depth β€” a drawable depth supported by the adaptor.
  • visual_id β€” a visual-id supported for the given depth by the adaptor. the two of them are a package deal, fr fr. πŸ¦‹

🌈 RETURN VALUES 🌈

  • [Success] β€” returned if XvQueryAdaptors(3) completed successfully. she ate and left no crumbs. πŸ’…
  • [XvBadExtension] β€” returned if the Xv extension is unavailable. the extension ghosted you, sorry babe 😭
  • [XvBadAlloc] β€” returned if XvQueryAdaptors(3) failed to allocate memory to process the request. no room, no memory, no service. πŸ’€

🩺 DIAGNOSTICS 🩺

  • [Drawable] β€” returned if the requested drawable does not exist. you asked for a window that isn't there. she looked. she found nothing. πŸ™ˆ

πŸ”— SEE ALSO πŸ”—

  • XvFreeAdaptorInfo(3) β€” yes bestie, you HAVE to free that info afterwards. go read it, it's the sequel. ✨

reminder: this page is part of the libXv Functions crew, and she's the XvQueryAdaptors(3) one. πŸŽ€

okay that's the whole thing, love u, go free your adaptor info 🫢

X Version 11 Β· libXv 1.0.13 Β· XvQueryAdaptors(3) β€” mwah, bye bestie! πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from