description | ms.assetid | title | ms.topic | ms.date | topic_type | api_name | api_type | api_location | ms.custom | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The AgreeMediaType method searches for a media type to make a pin connection. |
545186d2-b5e8-4833-b0ff-11160c1dd53b |
CBasePin.AgreeMediaType method (Amfilter.h) |
reference |
4/26/2023 |
|
|
|
|
UpdateFrequency5 |
[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.]
The AgreeMediaType
method searches for a media type to make a pin connection.
virtual HRESULT AgreeMediaType(
IPin *pReceivePin,
const CMediaType *pmt
);
-
pReceivePin
-
Pointer to the receiving pin's IPin interface.
-
pmt
-
Pointer to a CMediaType object that specifies a media type, or NULL.
Returns an HRESULT value. Possible values include those in the following table.
Return code | Description |
---|---|
|
Success. |
|
No acceptable media type was found. |
If the pmt parameter is non-NULL and fully specifies a media type, this method attempts a connection using that media type. If the attempt fails, the method returns an error.
If the pmt parameter is NULL or specifies a partial media type, this method tries media types in the following order:
- The receiving pin's preferred media types.
- This pin's preferred media types.
Preferred media types are enumerated with the CBasePin::EnumMediaTypes method, and the resulting enumerator is passed to the CBasePin::TryMediaTypes method.
Requirement | Value |
---|---|
Header |
|
Library |
|