LEADTOOLS Transforms Help > Filters, Codecs and Interfaces > Using Media Foundation Transform Attributes |
In order to use the Attributes of any Media Foundation transform, perform the following steps:
1. |
Get an interface of type IMFTransform by calling QueryInterface over the LEAD Transform Object: |
IMFTransform *pTransform = NULL;
LEADTransform->QueryInterface(IID_IMFTransform, (void**) &pTransform);
2. |
Get the attribute store: |
IMFAttributes *pAttributes = NULL;
pTransform->GetAttributes(&pAttributes);
3. |
get or set any attribute supported by the transform: |
Get a Value
for example, get a long (UINT32) value which has a CLSID of MF_CLSID_SOMEATTRIBUTE
long unVal;
pAttributes->GetUINT32(MF_CLSID_SOMEATTRIBUTE, &unVal);
Set a Value
for example, set a long (UINT32) value to an attribute which has a CLSID of MF_CLSID_SOMEATTRIBUTE
long unVal = 10;
pAttributes->SetUINT32(MF_CLSID_SOMEATTRIBUTE, unVal);
4. |
Release the attribute store (and all active objects) when you are finished. |