Setting Source and Destination Rectangles

Video capture drivers can support the use of source and destination rectangles. A rectangle’s typical use is dependent on the channel for which it is defined, as illustrated by the following table.

Channel

Source Rectangle

Destination Rectangle

VIDEO_EXTERNALIN

Specifies the portion of the analog image to be digitized.

Specifies the portion of the frame buffer to receive digitized input data.

VIDEO_IN

Specifies the portion of the frame buffer to be copied to the client.

Not applicable.

VIDEO_OUT

Not applicable.

Specifies the portion of the frame buffer to copy client data into.

VIDEO_EXTERNALOUT

Specifies the portion of the frame buffer to display inside the overlay area.

Specifies the portion of the display device to use as the overlay area.

A driver does not have to support all rectangles for all channels. Two messages, DVM_SRC_RECT and DVM_DST_RECT, are provided to allow clients to set and query the size of rectangles. Drivers that define rectangles on some or all channels must support these two messages. Even if your driver does not allow client modification of rectangle sizes, it should allow the client to send these messages to determine a rectangle’s predefined size. Rectangles are always specified using screen coordinates, which are described in the Win32 SDK.

After a client changes a VIDEO_EXTERNALOUT rectangle’s coordinates, it typically sends a DVM_UPDATE message to request the driver to update the display.

Clients send the DVM_GET_CHANNEL_CAPS message to determine the rectangular capabilities that a driver provides for a particular channel. In response to this message, your driver indicates its overlay, clipping, and scaling capabilities, along with allowable re-sizing parameters.