Muokkaa

Jaa


CBasePin.TryMediaTypes method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

Given a list of media types, the TryMediaTypes method tries to complete a connection using one of those types.

Syntax

virtual HRESULT TryMediaTypes(
         IPin            *pReceivePin,
   const CMediaType      *pmt,
         IEnumMediaTypes *pEnum
);

Parameters

pReceivePin

Pointer to the receiving pin's IPin interface.

pmt

Pointer to a CMediaType object that limits the possible media types, or NULL.

pEnum

Pointer to an IEnumMediaTypes interface, used to enumerate the list of media types.

Return value

Returns an HRESULT value. Possible values include those in the following table.

Return code Description
S_OK
Success.
VFW_E_NO_ACCEPTABLE_TYPES
Did not find an acceptable media type.

Remarks

For each media type returned by the IEnumMediaTypes interface, this method attempts a connection by calling the CBasePin::AttemptConnection method.

If the pmt parameter is non-NULL, the pin skips media types that do not match this type. The pmt parameter can specify a partial media type. A partial media type has a value of GUID_NULL for either the major type, the subtype, or the format. The GUID_NULL value matches any type, similar to a "wildcard" value.

Requirements

Requirement Value
Header
Amfilter.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBasePin Class