Export (0) Print
Expand All
Expand Minimize

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 TypeDescriptionSize (bytes)
DWORDNumber of style strings.4
For each style string:
DWORDSize of the string in bytes, including the NULL character.4
LPWSTRNull-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

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Mfidl.h

See also

IMFAttributes::GetBlob
IMFAttributes::SetBlob
IMFPresentationDescriptor
Presentation Descriptor Attributes
SAMI Media Source

 

 

Community Additions

ADD
Show:
© 2015 Microsoft