IPersistMediaPropertyBag::Load method (strmif.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 Load method loads properties from the media property bag into the filter.

Syntax

HRESULT Load(
  [in] IMediaPropertyBag *pPropBag,
  [in] IErrorLog         *pErrorLog
);

Parameters

[in] pPropBag

Pointer to the IMediaPropertyBag interface of a media property bag created by the caller.

[in] pErrorLog

Reserved. Set the value to NULL.

Return value

Returns an HRESULT value. Possible values include the following:

Return code Description
S_OK
Success.
E_POINTER
NULL pointer argument.
STG_E_ACCESSDENIED
Access denied.
VFW_E_WRONG_STATE
Filter graph is not in a stopped state.

Remarks

Call this method on the AVI Mux filter to write the properties into the AVI stream. Call the method when the filter is stopped, before you run the filter graph to author the file. When the graph runs, the filter writes the INFO chunks into the AVI header.

The following code example adds an IART (author name) INFO chunk to a file:

C++
IPersistMediaPropertyBag *pPersist = NULL;
IMediaPropertyBag *pBag = NULL;
VARIANT val;

// Query the AVI Mux filter for IPersistMediaPropertyBag (not shown).

CoCreateInstance(CLSID_MediaPropertyBag, NULL, CLSCTX_INPROC, IID_IMediaPropertyBag, (LPVOID *)&pBag);

val.vt = VT_BSTR; val.bstrVal = SysAllocString(OLESTR("Author Name")); pBag->Write(OLESTR("INFO/IART"), &val); pPersist->Load(pBag, NULL); VariantClear(&val);

The AVI Splitter filter and the WAVE Parser do not support this method.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

IPersistMediaPropertyBag Interface