IMFVideoDisplayControl::SetVideoPosition Method
Sets the source and destination rectangles for the video.
Syntax
HRESULT SetVideoPosition(
[in] const MFVideoNormalizedRect *pnrcSource,
[in] const LPRECT prcDest
);
Parameter
pnrcSource [in]
Pointer to an MFVideoNormalizedRect structure that specifies the source rectangle. This parameter can be NULL. If this parameter is NULL, the source rectangle does not change.prcDest [in]
Specifies the destination rectangle. This parameter can be NULL. If this parameter is NULL, the destination rectangle does not change.
Rückgabewert
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Rückgabecode | Beschreibung |
---|---|
S_OK | The method succeeded. |
E_POINTER | At least one parameter must be non-NULL. |
MF_E_SHUTDOWN | The video renderer has been shut down. |
Hinweise
The source rectangle defines which portion of the video is displayed. It is specified in normalized coordinates. For more information, see MFVideoNormalizedRect structure. To display the entire video image, set the source rectangle to {0, 0, 1, 1}. The default source rectangle is {0, 0, 1, 1}.
The destination rectangle defines a rectangle within the clipping window where the video appears. It is specified in pixels, relative to the client area of the window. To fill the entire window, set the destination rectangle to {0, 0, width, height}, where width and height are dimensions of the window client area. The default destination rectangle is {0, 0, 0, 0}.
To update just one of these rectangles, set the other parameter to NULL. You can set pnrcSource or prcDest to NULL, but not both.
Before setting the destination rectangle (prcDest), you must set the video window by calling IMFVideoDisplayControl::SetVideoWindow. (For the Media Foundation version of the EVR, you can also provide the video window in the MFCreateVideoRendererActivate function.) If no video window was provided, SetVideoPosition returns E_POINTER.
Anforderungen
Mindestens unterstützter Client |
Windows Vista |
Mindestens unterstützter Server |
Windows Server 2008 |
Header |
Evr.h |
Bibliothek |
Strmiids.lib |