Export (0) Print
Expand All

IMFMetadata interface

Manages metadata for an object. Metadata is information that describes a media file, stream, or other content. Metadata consists of individual properties, where each property contains a descriptive name and a value. A property may be associated with a particular language.

To get this interface from a media source, use the IMFMetadataProvider interface.

Members

The IMFMetadata interface inherits from the IUnknown interface. IMFMetadata also has these types of members:

Methods

The IMFMetadata interface has these methods.

MethodDescription
DeleteProperty

Deletes a metadata property.

GetAllLanguages

Retrieves a list of all the languages in which metadata is available.

GetAllPropertyNames

Retrieves a list of all the metadata property names on this object.

GetLanguage

Retrieves the current language setting.

GetProperty

Retrieves the value of a metadata property.

SetLanguage

Sets the language for setting and retrieving metadata.

SetProperty

Sets the value of a metadata property.

 

Examples

The following example shows how to get an IMFMetadata pointer from a media source.


HRESULT GetMetadata(
    IMFMediaSource *pSource, IMFMetadata **ppMetadata, DWORD dwStream = 0)
{
    IMFPresentationDescriptor *pPD = NULL;
    IMFMetadataProvider *pProvider = NULL;

    HRESULT hr = pSource->CreatePresentationDescriptor(&pPD);
    if (FAILED(hr))
    {
        goto done;
    }

    hr = MFGetService(
        pSource, MF_METADATA_PROVIDER_SERVICE, IID_PPV_ARGS(&pProvider));

    if (FAILED(hr))
    {
        goto done;
    }

    hr = pProvider->GetMFMetadata(pPD, dwStream, 0, ppMetadata);

done:
    SafeRelease(&pPD);
    SafeRelease(&pProvider);
    return hr;
}


Requirements

Minimum supported client

Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Mfidl.h

Library

Mfuuid.lib

See also

Media Foundation Interfaces
Media Metadata
IMFMetadataProvider

 

 

Community Additions

ADD
Show:
© 2014 Microsoft