IMFMediaEngine::TransferVideoFrame method

Copies the current video frame to a DXGI surface or WIC bitmap.


HRESULT TransferVideoFrame(
  IUnknown                    *pDstSurf,
  const MFVideoNormalizedRect *pSrc,
  const RECT                  *pDst,
  const MFARGB                *pBorderClr



A pointer to the IUnknown interface of the destination surface.


A pointer to an MFVideoNormalizedRect structure that specifies the source rectangle.


A pointer to a RECT structure that specifies the destination rectangle.


A pointer to an MFARGB structure that specifies the border color.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


In frame-server mode, call this method to blit the video frame to a DXGI or WIC surface. The application can call this method at any time after the Media Engine loads a video resource. Typically, however, the application calls IMFMediaEngine::OnVideoStreamTick first, to determine whether a new frame is available. If OnVideoStreamTick returns S_OK, the application then calls TransferVideoFrame.

The Media Engine scales and letterboxes the video to fit the destination rectangle. It fills the letterbox area with the border color.

For protected content, call the IMFMediaEngineProtectedContent::TransferVideoFrame method instead of this method.



See also