Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Spécifie le schéma de protection pour les exemples chiffrés.
Type de données
UINT32
Notes
La valeur de cet attribut est membre de l’énumération MFSampleEncryptionProtectionScheme . Dans les cas où la source du média est basée sur MP4, la valeur est définie en fonction de la valeur du champ scheme_type dans la zone de type de schéma (« schm ») dans l’en-tête MP4 (« moov » ou « moof »).
Si le champ scheme_type dans un fichier ou un flux MP4 est défini sur « cenc » ou « cbc1 », l’attribut MFSampleExtension_Encryption_ProtectionScheme doit être défini sur PROTECTION_SCHEME_AES_CTR ou PROTECTION_SCHEME_CBC, respectivement, et aucune valeur ne doit être définie pour MFSampleExtension_Encryption_CryptByteBlock et MFSampleExtension_Encryption_SkipByteBlock.
Si le champ scheme_type dans un fichier mp4, ou un flux, est défini sur « cens » ou « cbcs », l’attribut MFSampleExtension_Encryption_ProtectionScheme doit être défini sur PROTECTION_SCHEME_AES_CTR ou PROTECTION_SCHEME_CBC, respectivement, et MFSampleExtension_Encryption_CryptByteBlock et MFSampleExtension_Encryption_SkipByteBlock doivent être définis à l’aide des valeurs de la zone « tenc ».
Exemples
L’exemple suivant montre comment définir le MFSampleExtension_Encryption_ProtectionScheme et les attributs MFSampleExtension_Encryption_CryptByteBlock et MFSampleExtension_Encryption_SkipByteBlock associés.
HRESULT AddEncryptionAttributes(_In_ IMFSample* pSample, _In_ bool fIsEncrypted)
{
HRESULT hr = S_OK;
if (fIsEncrypted)
{
//Set Encryption Protection Scheme
hr = pSample->UINT32(MFSampleExtension_Encryption_ProtectionScheme,
SAMPLE_ENCRYPTION_PROTECTION_SCHEME_AES_CBC);
if (FAILED(hr))
return hr;
//Set the Initialization Vector (IV)
//(spSampleEncryptionData is omitted from this example for simplicity.)
hr = pSample->SetBlob(MFSampleExtension_Encryption_SampleID,
(BYTE*)(spSampleEncryptionData->m_pInitializationVector),
spSampleEncryptionData->m_bIVSize);
if (FAILED(hr))
return hr;
//Set crypt and skip byte blocks for pattern encryption
hr = pSample->SetUINT32(MFSampleExtension_Encryption_CryptByteBlock, 1);
if (FAILED(hr))
return hr;
hr = pSample->SetUINT32(MFSampleExtension_Encryption_SkipByteBlock, 9);
if (FAILED(hr))
return hr;
}
return hr;
}
Spécifications
| Condition requise | Valeur |
|---|---|
| Client minimal pris en charge |
Windows 10, version 1709 [applications de bureau uniquement] |
| Serveur minimal pris en charge |
Aucun pris en charge |
| En-tête |
|