Wednesday, May 02, 2012

capGetVideoFormat macro

透過 VFW 所提供的 capGetVideoFormat 函式, 可以取得視訊畫面資料的寬、高、一個像素(pixel)由幾個位元組成及視訊畫面資料是否經過壓縮... 等等。如果想要修改視訊擷取視窗中的畫面內容, 這些資料就變成相當重要。
The capGetVideoFormat macro retrieves a copy of the video format in use. You can use this macro or explicitly call the WM_CAP_GET_VIDEOFORMAT message.

DWORD capGetVideoFormat(
hwnd,
psVideoFormat,
wSize
);

Parameters

hwnd

Handle to a capture window.

psVideoFormat

Pointer to a BITMAPINFO structure. You can also specify NULL to retrieve the number of bytes needed by BITMAPINFO.

wSize

Size, in bytes, of the structure referenced by s.

Return Values

Returns the size, in bytes, of the video format or zero if the capture window is not connected to a capture driver. For video formats that require a palette, the current palette is also returned.

Remarks

Because compressed video formats vary in size requirements applications must first retrieve the size, then allocate memory, and finally request the video format data.

No comments:

Post a Comment