structure WMDM_FORMAT_CAPABILITY

La structure WMDM_FORMAT_CAPABILITY décrit les fonctionnalités d’un appareil pour un format particulier. Cette structure contient un ensemble de configurations de propriétés dans un tableau de structures WMDM_PROP_CONFIG . Chaque configuration de propriété représente un ensemble de valeurs de propriété compatibles pour toutes les propriétés prises en charge pour un format donné. L’application peut obtenir cette structure en appelant la méthode IWMDMDevice3::GetFormatCapability et en transmettant le code de format. Pour obtenir la liste des codes de format, consultez WMDM_FORMATCODE.

Syntaxe

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

Membres

nPropConfig

Nombre de configurations de propriétés dans le tableau pConfigs .

pConfigs

Pointeur vers un tableau de structures WMDM_PROP_CONFIG . La taille du tableau est égale à la valeur de nPropConfig.

Notes

La structure WMDM_FORMAT_CAPABILITY fournit un mécanisme flexible pour exprimer les fonctionnalités de l’appareil pour un format particulier.

Si le contenu est destiné à être rendu par l’appareil (par exemple, un fichier audio à lire par l’appareil), les propriétés du contenu doivent correspondre à l’une des configurations de propriété retournées par IWMDMDevice3::GetFormatCapability dans la structure WMDM_FORMAT_CAPABILITY . Par exemple, pour un fichier audio, le débit binaire et le taux d’échantillonnage doivent satisfaire à l’une des configurations de propriété retournées.

L’appelant est chargé de libérer la mémoire allouée pour cette structure. La fonction suivante montre comment effacer une structure de 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;
}

Spécifications

Condition requise Valeur
En-tête
Wmdm.idl

Voir aussi

IWMDMDevice3::GetFormatCapability

WMDM_ENUM_PROP_VALID_VALUES_FORM

WMDM_PROP_CONFIG

WMDM_PROP_DESC

WMDM_PROP_VALUES_ENUM

WMDM_PROP_VALUES_RANGE

Structures