Collapse the table of content
Expand the table of content

IMFVideoMixerControl::SetStreamOutputRect method

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


HRESULT SetStreamOutputRect(
  [in]       DWORD                 dwStreamID,
  [inconst MFVideoNormalizedRect *pnrcOutput


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

The method succeeded.


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


Invalid stream identifier.



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.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]





See also

Enhanced Video Renderer



Community Additions

© 2016 Microsoft