MF_PD_SAMI_STYLELIST attribute

Contains the friendly names of the Synchronized Accessible Media Interchange (SAMI) styles defined in the SAMI file.

The SAMI Media Source sets this attribute on the presentation descriptor that it creates.

Data type

Byte array

Remarks

The attribute blob has the following structure:

Data Type

Description

Size (bytes)

DWORD

Number of style strings.

4

For each style string:

DWORD

Size of the string in bytes, including the NULL character.

4

LPWSTR

Null-terminated wide-character string containing the name of the style.

Varies

 

To set the style or retrieve the current style, use the IMFSAMIStyle interface.

The GUID constant for this attribute is exported from mfuuid.lib.

Examples

HRESULT DisplaySAMIStyleNames(IMFPresentationDescriptor *pPD)
{
    UINT8 *pBuf = NULL;
    UINT32 cbBuf = 0;

    HRESULT hr = pPD->GetAllocatedBlob(MF_PD_SAMI_STYLELIST, &pBuf, &cbBuf);

    if (SUCCEEDED(hr))
    {

        DWORD cStyles = ((DWORD*)pBuf)[0];
        UINT8 *pStrings = pBuf + sizeof(DWORD);

        for (DWORD i = 0; i < cStyles; i++)
        {
            DWORD cbString = ((DWORD*)pStrings)[0];
            pStrings += sizeof(DWORD);

            wprintf_s(L"%s\n", (WCHAR*)pStrings);

            pStrings += cbString;
        }
    }
    CoTaskMemFree(pBuf);
    return hr;
}

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Header
Mfidl.h

See also

Alphabetical List of Media Foundation Attributes

IMFAttributes::GetBlob

IMFAttributes::SetBlob

IMFPresentationDescriptor

Presentation Descriptor Attributes

SAMI Media Source