diff --git a/api/vpl/mfxcommon.h b/api/vpl/mfxcommon.h index 77bad7d6..2fa6bf94 100644 --- a/api/vpl/mfxcommon.h +++ b/api/vpl/mfxcommon.h @@ -148,7 +148,22 @@ typedef enum } mfxPriority; -typedef struct _mfxEncryptedData mfxEncryptedData; +typedef struct { + mfxU64 IV; + mfxU64 Count; +} mfxAES128CipherCounter; + +struct mfxEncryptedData { + mfxEncryptedData *Next; + mfxHDL reserved1; + mfxU8 *Data; + mfxU32 DataOffset; /* offset, in bytes, from beginning of buffer to first byte of encrypted data*/ + mfxU32 DataLength; /* size of plain data in bytes */ + mfxU32 MaxLength; /*allocated buffer size in bytes*/ + mfxAES128CipherCounter CipherCounter; + mfxU32 reserved2[8]; +}; + MFX_PACK_BEGIN_STRUCT_W_L_TYPE() /*! Defines the buffer that holds compressed video data. */ typedef struct { diff --git a/api/vpl/mfxstructures.h b/api/vpl/mfxstructures.h index 12f6e651..2fc86d52 100644 --- a/api/vpl/mfxstructures.h +++ b/api/vpl/mfxstructures.h @@ -2377,6 +2377,10 @@ enum { */ MFX_EXTBUFF_EXPORT_SHARING_DESC_OCL = MFX_MAKEFOURCC('E', 'O', 'C', 'L'), #endif + /*! + See the mfxExtSurfaceOpenCLImg2DExportDescription structure for more details. + */ + MFX_EXTBUFF_ENCRYPTION_PARAM = MFX_MAKEFOURCC('E', 'N', 'C', 'R'), }; /* VPP Conf: Do not use certain algorithms */ @@ -5044,6 +5048,34 @@ typedef struct { MFX_PACK_END() #endif +typedef struct { + /** \brief The offset relative to the start of the bitstream input in + * bytes of the start of the segment */ + mfxU32 segment_start_offset; + /** \brief The length of the segments in bytes */ + mfxU32 segment_length; + /** \brief The length in bytes of the remainder of an incomplete block + * from a previous segment*/ + mfxU32 partial_aes_block_size; + /** \brief The length in bytes of the initial clear data */ + mfxU32 init_byte_length; + /** \brief This will be AES counter for secure decode and secure encode + * when numSegments equals 1, valid size is specified by + * \c key_blob_size */ + mfxU8 aes_cbc_iv_or_ctr[64]; + /** \brief Reserved bytes for future use, must be zero */ + mfxU32 va_reserved[8]; +} EncryptionSegmentInfo; + +typedef struct { + mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_ENCRYPTION_PARAM. */ + mfxU32 encryption_type; + mfxU8 key_blob[16]; + mfxU32 session; + mfxU32 uiNumSegments; + EncryptionSegmentInfo *pSegmentInfo; +} mfxExtEncryptionParam; + #ifdef ONEVPL_EXPERIMENTAL /* The mfxAutoSelectImplType enumerator specifies the method for automatically selecting an implementation. */ typedef enum {