IMFVideoMixerControl::SetStreamOutputRect method

Sets the position of a video stream within the composition rectangle.

Syntax


HRESULT SetStreamOutputRect(
  [in]  DWORD dwStreamID,
  [in]  const MFVideoNormalizedRect *pnrcOutput
);

Parameters

dwStreamID [in]

Identifier of the stream. For the EVR media sink, the stream identifier is defined when the IMFMediaSink::AddStreamSink method is called. For the DirectShow EVR filter, the stream identifier corresponds to the pin index. The reference stream is always stream 0.

pnrcOutput [in]

Pointer to an MFVideoNormalizedRect structure that defines the bounding rectangle for the video stream.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_OK

The method succeeded.

E_INVALIDARG

The coordinates of the bounding rectangle given in pnrcOutput are not valid.

MF_E_INVALIDSTREAMNUMBER

Invalid stream identifier.

 

Remarks

The mixer draws each video stream inside a bounding rectangle that is specified relative to the final video image. This bounding rectangle is given in normalized coordinates. For more information, see MFVideoNormalizedRect structure.

The coordinates of the bounding rectangle must fall within the range [0.0, 1.0]. Also, the X and Y coordinates of the upper-left corner cannot exceed the X and Y coordinates of the lower-right corner. In other words, the bounding rectangle must fit entirely within the composition rectangle and cannot be flipped vertically or horizontally.

The following diagram shows how the EVR mixes substreams.

Diagram showing an image, then that image inside a larger output rectangle, then a portion of the image in a source rectangle

The output rectangle for the stream is specified by calling SetStreamOutputRect. The source rectangle is specified by calling IMFVideoDisplayControl::SetVideoPosition. The mixer applies the output rectangle first, when it mixes the streams into a single bounding rectangle. This bounding rectangle is called composition space. Then the presenter applies the source rectangle to the composited image.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Evr.h

Library

Strmiids.lib

See also

IMFVideoMixerControl
Enhanced Video Renderer

 

 

Community Additions

ADD
Show:
© 2014 Microsoft