Microsoft DirectX 8.0

IPersistMediaPropertyBag Interface

The IPersistMediaPropertyBag interface sets and retrieves INFO and DISP chunks in Audio-Video Interleaved (AVI) streams. It uses the IMediaPropertyBag interface to store the chunks as name/value pairs.

The AVI Splitter filter and the WAV Parser filter support this interface for reading INFO and DISP chunks from an AVI or WAV file. The AVI MUX filter supports the interface for writing these chunks into a file.

IPersistMediaPropertyBag is modeled after, but does not inherit from, the IPersistPropertyBag interface. For more information on IPersistPropertyBag, see the Platform SDK.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IPersistMediaPropertyBag methodsDescription
InitNew Initializes a new property bag that will hold the media file header information.
Load Retrieves the properties from the media file and stores them in the property bag.
Save Saves the media file properties.

IPersistMediaPropertyBag::InitNew

IPersistMediaPropertyBag Interface

Initializes the object to receive new properties.

Syntax

HRESULT InitNew(void);

Return Value

Returns S_OK.

Remarks

Calling this method on the AVI Mux filter clears any properties that were previously set using the Load method.

Calling this method on the AVI Splitter filter or the WAV Parser has no effect.

IPersistMediaPropertyBag::Load

IPersistMediaPropertyBag Interface

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:

S_OKSuccess.
E_POINTERNULL pointer argument.
STG_E_ACCESSDENIEDAccess denied.
VFW_E_WRONG_STATEFilter graph is not in a stopped state.

Remarks

Call this method on the AVI Mux filter to write the properties into the AVI stream. The following code example writes an IART (author name) INFO chunk to the stream.

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(L"Author Name");
pBag->Write(L"INFO/IART", &val);
pPersist->Load(pBag, NULL);
VariantClear(&val);

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

IPersistMediaPropertyBag::Save

IPersistMediaPropertyBag Interface

Saves properties from the filter into the media property bag.

Syntax

HRESULT Save(
    IMediaPropertyBag *pPropBag
    BOOL fClearDirty
    BOOL fSaveAllProperties
);

Parameters

pPropBag
[in] Pointer to the IMediaPropertyBag interface of a media property bag created by the caller.
fClearDirty
[in] Reserved. Can be any value.
fSaveAllProperties
[in] Reserved. Can be any value.

Return Value

Returns an HRESULT value. Possible values include the following:

S_OKSuccess.
E_NOTIMPLNot implemented.
E_OUTOFMEMORYInsufficient memory.
HRESULT_FROM_WIN32(ERROR_INVALID_DATA)Invalid data.

Remarks

If you call this method on the AVI Splitter filter or the WAV Parser, the filter reads any INFO and DISP chunks from the file and stores them in the media property bag. You can use the IMediaPropertyBag::Read or IMediaPropertyBag::EnumProperty method to retrieve the chunks.

The AVI Mux filter does not implement this method.