---
name: "XvQueryBestSize"
section: "3x"
platform: "linux"
package: "libxv-dev"
version: "1:1.0.2-1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/XvQueryBestSize/3x"
---

# XvQueryBestSize(3x)

determine the optimum drawable region size

## Name

XvQueryBestSize - determine the optimum drawable region size

## Syntax

**#include \<X11/extensions/Xvlib.h\>**

**XvQueryBestSize**(*dpy, port, motion, vw, vh, dw, dh, p\_dw, p\_dh*)

**Display *\*dpy*;**\
 **XvPortID *port*;**\
 **Bool *motion*;**\
 **unsigned** **int *vw, vh*;**\
 **unsigned int** *dw, dh;* \
 **unsigned int** *\*p\_dw, \*p\_dh;*

## Arguments

- *dpy*

  Specifies the connection to the X server.

- *port*

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

- *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*

  Specifies the size of the source video region desired.

- *dw,dh*

  Specifies the size of the destination drawable region desired.

- *p\_dw,p\_dh*

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

## Description

Some ports may be able to scale incoming or outgoing video.   [XvQueryBestSize(3x)](/XvQueryBestSize/3x.md) 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.

## Returned Values

- \[Success\]

  Returned if [XvQueryBestSize(3x)](/XvQueryBestSize/3x.md) completed successfully.

- \[XvBadExtension\]

  Returned if the Xv extension is unavailable.

- \[XvBadAlloc\]

  Returned if [XvQueryBestSize(3x)](/XvQueryBestSize/3x.md) failed to allocate memory to process the request.

## Diagnostics

- \[XvBadPort\]

  Generated if the requested port does not exist.\
