Condividi tramite


IMediaParams::SetParam method (medparam.h)

[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 SetParam method sets the value of a parameter.

Syntax

HRESULT SetParam(
  [in] DWORD   dwParamIndex,
  [in] MP_DATA value
);

Parameters

[in] dwParamIndex

Zero-based index of the parameter, or DWORD_ALLPARAMS to apply the value to every parameter.

[in] value

New value of the parameter.

Return value

Returns an HRESULT value. Possible values include the following.

Return code Description
E_INVALIDARG
Index out of range, or illegal parameter value.
S_OK
Success.

Remarks

If the parameter is currently within an envelope segment, the envelope segment will overwrite the new value. To remove an envelope segment, call the FlushEnvelope method.

To enumerate the parameters supported by this object, along with their index values, use the IMediaParamInfo interface.

Requirements

Requirement Value
Target Platform Windows
Header medparam.h
Library Dmoguids.lib

See also

IMediaParams Interface