diff --git a/api/vpl/mfxcommon.h b/api/vpl/mfxcommon.h index 47228376..a25c69da 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 a34548c7..e4aa1685 100644 --- a/api/vpl/mfxstructures.h +++ b/api/vpl/mfxstructures.h @@ -2453,6 +2453,10 @@ enum { See the mfxExtAlphaChannelSurface structure for more details. */ MFX_EXTBUFF_ALPHA_CHANNEL_SURFACE = MFX_MAKEFOURCC('A', 'C', 'S', 'F'), + /*! + See the mfxExtEncryptionParam structure for more details. + */ + MFX_EXTBUFF_ENCRYPTION_PARAM = MFX_MAKEFOURCC('E', 'N', 'C', 'R'), }; /* VPP Conf: Do not use certain algorithms */ @@ -5313,6 +5317,34 @@ typedef struct { } mfxExtAlphaChannelSurface; MFX_PACK_END() +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 __cplusplus } // extern "C"