XvQueryBestSize(3) libXv Functions XvQueryBestSize(3)

# [NAME](#NAME)

XvQueryBestSize - determine the optimum drawable region size

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;X11/extensions/Xvlib.h&gt;**

```
int XvQueryBestSize(Display *dpy, XvPort port, Bool motion,
                    unsigned int vw, unsigned int vh,
                    unsigned int dw, unsigned int dh,
                    unsigned int *p_dw, unsigned int *p_dh);
```

# [ARGUMENTS](#ARGUMENTS)

[*dpy*](#dpy)

Specifies the connection to the X server.

[*port*](#port)

Defines the port associated with the display and adaptor for which the optimum size is to be calculated.

[*motion*](#motion)

Specifies *True* if the destination size needs to support full motion, and *False* if the destination size need only support still images.

[*vw,vh*](#vw,vh)

Specifies the size of the source video region desired.

[*dw,dh*](#dw,dh)

Specifies the size of the destination drawable region desired.

[*p\_dw,p\_dh*](#p_dw,p_dh)

Pointers to where the closest destination sizes supported by the server are returned.

# [DESCRIPTION](#DESCRIPTION)

Some ports may be able to scale incoming or outgoing video. [**XvQueryBestSize**(3)](/man/os/libxv/XvQueryBestSize.3) returns the size of the closest destination region that is supported by the adaptor. The returned size is guaranteed to be smaller than the requested size if a smaller size is supported.

# [RETURN VALUES](#RETURN_VALUES)

\[Success]

Returned if [**XvQueryBestSize**(3)](/man/os/libxv/XvQueryBestSize.3) completed successfully.

\[XvBadExtension]

Returned if the Xv extension is unavailable.

\[XvBadAlloc]

Returned if [**XvQueryBestSize**(3)](/man/os/libxv/XvQueryBestSize.3) failed to allocate memory to process the request.

# [DIAGNOSTICS](#DIAGNOSTICS)

\[XvBadPort]

Generated if the requested port does not exist.

libXv 1.0.13 X Version 11

---

Document: XvQueryBestSize(3) from libxv 1.0.13-r6 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libxv
