Skip to content

Commit

Permalink
Add support for decryption related defination
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang, YichiX <[email protected]>
  • Loading branch information
zhangyichix committed Nov 26, 2024
1 parent d18b255 commit acb4b41
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
17 changes: 16 additions & 1 deletion api/vpl/mfxcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
32 changes: 32 additions & 0 deletions api/vpl/mfxstructures.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit acb4b41

Please sign in to comment.