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 Sep 20, 2024
1 parent d18b255 commit f786f33
Show file tree
Hide file tree
Showing 2 changed files with 34 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
18 changes: 18 additions & 0 deletions api/vpl/mfxstructures.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifndef __MFXSTRUCTURES_H__
#define __MFXSTRUCTURES_H__
#include "mfxcommon.h"
#include "va/va.h"

#if !defined (__GNUC__)
#pragma warning(disable: 4201)
Expand Down Expand Up @@ -2377,6 +2378,11 @@ 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'),
MFX_EXTBUFF_PROTECTEDSESSION_PARAM = MFX_MAKEFOURCC('V', 'A', 'P', 'S'),
};

/* VPP Conf: Do not use certain algorithms */
Expand Down Expand Up @@ -5044,6 +5050,18 @@ typedef struct {
MFX_PACK_END()
#endif

typedef struct {
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_PROTECTEDSESSION_PARAM. */
mfxU64 VAProtectedSessionID;
} mfxExtProtectedSession;

typedef struct {
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_ENCRYPTION_PARAM. */
mfxU32 encryption_type;
mfxU32 uiNumSegments;
VAEncryptionSegmentInfo *pSegmentInfo;
} mfxExtEncryptionParam;

#ifdef ONEVPL_EXPERIMENTAL
/* The mfxAutoSelectImplType enumerator specifies the method for automatically selecting an implementation. */
typedef enum {
Expand Down

0 comments on commit f786f33

Please sign in to comment.