Condividi tramite


struttura WMDM_FORMAT_CAPABILITY

La struttura WMDM_FORMAT_CAPABILITY descrive le funzionalità di un dispositivo per un formato specifico. Questa struttura contiene un set di configurazioni di proprietà in una matrice di strutture WMDM_PROP_CONFIG . Ogni configurazione di proprietà rappresenta un set di valori di proprietà compatibili in tutte le proprietà supportate per un determinato formato. L'applicazione può ottenere questa struttura chiamando il metodo IWMDMDevice3::GetFormatCapability e passando il codice di formato. Per un elenco di codici di formato, vedere WMDM_FORMATCODE.

Sintassi

typedef struct _WMDM_FORMAT_CAPABILITY {
  UINT              nPropConfig;
  WMDM_PROP_CONFIG  *pConfigs;
} WMDM_FORMAT_CAPABILITY;

Members

nPropConfig

Numero di configurazioni di proprietà nella matrice pConfigs .

pConfigs

Puntatore a una matrice di strutture WMDM_PROP_CONFIG . La dimensione della matrice è uguale al valore di nPropConfig.

Commenti

La struttura WMDM_FORMAT_CAPABILITY fornisce un meccanismo flessibile per esprimere le funzionalità del dispositivo per un formato specifico.

Se il rendering del contenuto deve essere eseguito dal dispositivo (ad esempio, un file audio da riprodurre dal dispositivo), le proprietà del contenuto devono corrispondere a una delle configurazioni di proprietà restituite da IWMDMDevice3::GetFormatCapability nella struttura WMDM_FORMAT_CAPABILITY . Ad esempio, per un file audio, la frequenza di bit e la frequenza di campionamento devono soddisfare una delle configurazioni delle proprietà restituite.

Il chiamante è responsabile della liberazione della memoria allocata per questa struttura. La funzione seguente illustra come cancellare una struttura WMDM_FORMAT_CAPABILITY .

void FreeFormatCapability(WMDM_FORMAT_CAPABILITY formatCap)
{
    // Loop through all configurations.
    for (UINT i=0; i < formatCap.nPropConfig; i++) 
    {
        // Loop through all descriptions of a configuration and delete
        // the values particular to that description type.
        for (UINT j=0; j < formatCap.pConfigs[i].nPropDesc; j++) 
        {
            switch (formatCap.pConfigs[i].pPropDesc[j].ValidValuesForm)
            {
                case WMDM_ENUM_PROP_VALID_VALUES_ENUM:
                    for (UINT k=0; k < formatCap.pConfigs[i].pPropDesc[j].ValidValues.EnumeratedValidValues.cEnumValues; k++)
                    {
                        PropVariantClear (&(formatCap.pConfigs[i].pPropDesc[j].ValidValues.EnumeratedValidValues.pValues[k]));
                    }
                    CoTaskMemFree(formatCap.pConfigs[i].pPropDesc[j].ValidValues.EnumeratedValidValues.pValues);
                    break;
                case WMDM_ENUM_PROP_VALID_VALUES_RANGE:
                    PropVariantClear (&(formatCap.pConfigs[i].pPropDesc[j].ValidValues.ValidValuesRange.rangeMin));
                    PropVariantClear (&(formatCap.pConfigs[i].pPropDesc[j].ValidValues.ValidValuesRange.rangeMax));
                    PropVariantClear (&(formatCap.pConfigs[i].pPropDesc[j].ValidValues.ValidValuesRange.rangeStep));
                    break;
                case WMDM_ENUM_PROP_VALID_VALUES_ANY:
                    // No dynamically allocated memory for this value.
                default:
                    break;
            }

            // Free the memory for the description name.
            CoTaskMemFree(formatCap.pConfigs[i].pPropDesc[j].pwszPropName);
        }
        // Free the memory holding the array of description items for this configuration.
        CoTaskMemFree(formatCap.pConfigs[i].pPropDesc);
    }

    // Free the memory pointing to the array of configurations.
    CoTaskMemFree(formatCap.pConfigs);
    formatCap.nPropConfig = 0;
}

Requisiti

Requisito Valore
Intestazione
Wmdm.idl

Vedi anche

IWMDMDevice3::GetFormatCapability

WMDM_ENUM_PROP_VALID_VALUES_FORM

WMDM_PROP_CONFIG

WMDM_PROP_DESC

WMDM_PROP_VALUES_ENUM

WMDM_PROP_VALUES_RANGE

Strutture