Microsoft DirectX 8.1 (C++)

ISampleGrabber::GetConnectedMediaType

The GetConnectedMediaType method retrieves the media type for the connection on the Sample Grabber's input pin.

Syntax

HRESULT GetConnectedMediaType(
  AM_MEDIA_TYPE *pType
);

Parameters

pType

Pointer to an AM_MEDIA_TYPE structure allocated by the caller.

Return Value

Returns one of the following values.

Return code Description
E_POINTER NULL pointer argument.
S_OK Success.
VFW_E_NOT_CONNECTED The filter is not connected.

Remarks

This method copies the media type into the AM_MEDIA_TYPE structure specified by pType. The caller must free the media type's format block. You can use the CoTaskMemFree function, or the FreeMediaType function in the base-class library.

See Also