IPersistMediaPropertyBag::Load

 
Microsoft DirectShow 9.0

IPersistMediaPropertyBag::Load

The Load method loads properties from the media property bag into the filter.

Syntax

  HRESULT Load(
  IMediaPropertyBag *pPropBag,
  IErrorLog *pErrorLog
);

Parameters

pPropBag

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

pErrorLog

[in] Reserved. Set the value to NULL.

Return Value

Returns an HRESULT value. Possible values include the following:

Value 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:

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

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also