Поделиться через


VIDEOINFO structure (amvideo.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The VIDEOINFO structure is equivalent to a VIDEOINFOHEADER structure, but it contains enough memory to hold three color masks plus a color table with 256 colors.

If you are writing a video filter, you can use this structure to guarantee that the format block always has enough memory to contain the largest possible VIDEOINFOHEADER structure.

Syntax

typedef struct tagVIDEOINFO {
  RECT             rcSource;
  RECT             rcTarget;
  DWORD            dwBitRate;
  DWORD            dwBitErrorRate;
  REFERENCE_TIME   AvgTimePerFrame;
  BITMAPINFOHEADER bmiHeader;
  union {
    RGBQUAD       bmiColors[iPALETTE_COLORS];
    DWORD         dwBitMasks[iMASK_COLORS];
    TRUECOLORINFO TrueColorInfo;
  };
} VIDEOINFO;

Members

rcSource

Portion of the input video to use.

rcTarget

Where the video should be displayed.

dwBitRate

Approximate data rate in bits per second.

dwBitErrorRate

Bit error rate for this stream.

AvgTimePerFrame

The desired average time per frame, in 100-nanosecond units. For more information, see the Remarks section for the VIDEOINFOHEADER structure.

bmiHeader

BITMAPINFOHEADER structure that contains color and dimension information for a device-independent bitmap.

bmiColors[iPALETTE_COLORS]

Array of Win32 RGBQUAD structures that specifies the video's color palette. Each structure represents a single color, which is a combination of red, green, and blue intensities.

dwBitMasks[iMASK_COLORS]

Array of DWORD values that specify true-color bitmasks.

TrueColorInfo

TRUECOLORINFO structure that contains both a color palette and an array of color bitmasks.

Remarks

Never use this structure unless you are sure that you will use it only to store standard RGB formats. If you store anything other than standard RGB, the variable size of the bmiHeader structure will almost certainly cause problems, and you should use the VIDEOINFOHEADER structure instead. If you find it absolutely necessary to use the VIDEOINFO structure, do not access the TrueColorInfo, dwBitMasks, or bmiColors members directly. Instead, use the TRUECOLOR, COLORS, and BITMASKS macros to return the pointers to the color information. Which of these members is valid depends on the contents of the BITMAPINFOHEADER structure.

The first five data members are equivalent to a VIDEOINFOHEADER structure. They are expanded in full simply to reduce the amount of dereferencing needed when dealing with a pointer to a VIDEOINFO structure.

For information about using the rcSource and rcTarget members, see Source and Target Rectangles in Video Renderers.

Requirements

Requirement Value
Header amvideo.h (include Dshow.h)

See also

DirectShow Structures