Setting and Obtaining the Video Source and Destination Rectangles

Video capture drivers might support a source rectangle to specify a portion of an image that is digitized or transferred to the display. External in ports use the source rectangle to specify the portion of the analog image digitized. External out ports use the source rectangle to specify the portion of frame buffer shown on the external output.

Similarly, video capture drivers might support a destination rectangle to specify the portion of the frame buffer or screen used to receive the image. External in ports can use a destination rectangle to specify the portion of the frame buffer used for the digitized video input. External out ports can use the rectangle to specify the client rectangle on the display.

The DVM_DST_RECT and DVM_SRC_RECT messages are used to set and obtain the video source and destination rectangles.The calling application must modify these messages with flags to indicate their exact meaning. Your driver must examine the flags sent with the messages to determine the proper response. The flags are specified in lParam2. The VIDEO_CONFIGURE_SET, VIDEO_CONFIGURE_GET, and VIDEO_CONFIGURE_QUERY flags define the meaning of the DVM_DST_RECT and DVM_SRC_RECT messages:

The VIDEO_CONFIGURE_SET flag indicates the application is setting a source or destination rectangle. The rectangle coordinates are specified in a RECT structure pointed to by lParam1.

If an application sets a source or destination rectangle for an external out channel, your driver will normally receive a series of messages. For these channels, applications normally send both DVM_SRC_RECT and DVM_DST_RECT to your driver to properly set the rectangles. The application follows these messages with DVM_UPDATE. Video overlay devices should paint their key color in response to DVM_UPDATE.

Applications use the VIDEO_CONFIGURE_GET flag to determine the coordinates of the source and destination rectangles. Applications use additional flags with VIDEO_CONFIGURE_GET to indicate if they want the coordinates of the rectangle currently defined, the maximum size of the rectangle, or the minimum size of the rectangle.

Your driver should return the coordinates for the appropriate rectangle in the RECT structure pointed to by lParam1.

An application use the VIDEO_CONFIGURE_QUERY flag to determine if your driver supports VIDEO_CONFIGURE_QUERY or VIDEO_CONFIGURE_SET. (The VIDEO_CONFIGURE_QUERY flag without VIDEO_CONFIGURE_GET or VIDEO_CONFIGURE_SET is invalid.) Your device driver should return DV_ERR_OK if it supports the flag. Otherwise, it should return DV_ERR_NOTSUPPORTED.