Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for decryption related defination #17

Open
wants to merge 1 commit into
base: celadon/u/mr0/master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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