ConvertVideoInfoToVideoInfo2 function

[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 ConvertVideoInfoToVideoInfo2 function converts a media type that uses VIDEOINFOHEADER to one that uses VIDEOINFOHEADER2.

Syntax

HRESULT STDAPI ConvertVideoInfoToVideoInfo2(
   AM_MEDIA_TYPE *pmt
);

Parameters

pmt

Pointer to the AM_MEDIA_TYPE structure to convert. The structure must have format type FORMAT_VideoInfo.

Return value

Returns S_OK or E_OUTOFMEMORY.

Remarks

This function allocates a new VIDEOINFOHEADER2 structure, copies the members of the VIDEOINFOHEADER structure into it, and replaces the old structure with the new structure in the format block of the media type.

Requirements

Requirement Value
Header
Winutil.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

Video and Image Functions