• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# native_cencinfo.h
2
3
4## Overview
5
6The file declares the native APIs used to set decryption parameters.
7
8**Library**: libnative_media_avcencinfo.so
9
10**File to include**: <multimedia/player_framework/native_cencinfo.h>
11
12**Since**: 12
13
14**Related module**: [Multimedia_Drm](_multimedia___drm.md)
15
16
17## Summary
18
19
20### Structs
21
22| Name| Description|
23| -------- | -------- |
24| struct  [DrmSubsample](_drm_subsample.md) | Describes the subsample type.|
25
26
27### Macros
28
29| Name| Description|
30| -------- | -------- |
31| [DRM_KEY_ID_SIZE](_multimedia___drm.md#drm_key_id_size)   16 | The length of the key ID is 16 bytes.|
32| [DRM_KEY_IV_SIZE](_multimedia___drm.md#drm_key_iv_size)   16 | The length of the Initialization Vector (IV) is 16 bytes.|
33| [DRM_KEY_MAX_SUB_SAMPLE_NUM](_multimedia___drm.md#drm_key_max_sub_sample_num)   64 | The maximum number of subsamples is 64.|
34
35
36### Types
37
38| Name| Description|
39| -------- | -------- |
40| typedef struct [OH_AVBuffer](_multimedia___drm.md#oh_avbuffer) [OH_AVBuffer](_multimedia___drm.md#oh_avbuffer) | Defines a struct for the audio/video buffer.|
41| typedef struct [OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) [OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) | Defines a struct for the audio/video Common Encryption Scheme (CENC) information.|
42| typedef enum [DrmCencAlgorithm](_multimedia___drm.md#drmcencalgorithm) [DrmCencAlgorithm](_multimedia___drm.md#drmcencalgorithm) | Defines an enum for the DRM CENC algorithm types.|
43| typedef enum [DrmCencInfoMode](_multimedia___drm.md#drmcencinfomode) [DrmCencInfoMode](_multimedia___drm.md#drmcencinfomode) | Defines an enum for the modes for setting the key ID, IV, and subsample information in the CENC information.|
44| typedef struct [DrmSubsample](_drm_subsample.md) [DrmSubsample](_multimedia___drm.md#drmsubsample) | Defines a struct for the subsample type.|
45
46
47### Enums
48
49| Name| Description|
50| -------- | -------- |
51| [DrmCencAlgorithm](_multimedia___drm.md#drmcencalgorithm) {<br>DRM_ALG_CENC_UNENCRYPTED = 0x0, DRM_ALG_CENC_AES_CTR = 0x1,<br>DRM_ALG_CENC_AES_WV = 0x2, DRM_ALG_CENC_AES_CBC = 0x3,<br>DRM_ALG_CENC_SM4_CBC = 0x4, DRM_ALG_CENC_SM4_CTR = 0x5<br>} | Enumerates the DRM CENC algorithm types.|
52| [DrmCencInfoMode](_multimedia___drm.md#drmcencinfomode) {<br>DRM_CENC_INFO_KEY_IV_SUBSAMPLES_SET = 0x0,<br>DRM_CENC_INFO_KEY_IV_SUBSAMPLES_NOT_SET = 0x1 } | Enumerates the modes for setting the key ID, IV, and subsample information in the CENC information.|
53
54
55### Functions
56
57| Name| Description|
58| -------- | -------- |
59| [OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) \* [OH_AVCencInfo_Create](_multimedia___drm.md#oh_avcencinfo_create) () | Creates an OH_AVCencInfo instance for setting the CENC information.|
60| [OH_AVErrCode](_core.md#oh_averrcode) \* [OH_AVCencInfo_Destroy](_multimedia___drm.md#oh_avcencinfo_destroy) ([OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) \*cencInfo) | Destroys an OH_AVCencInfo instance and clears internal resources.|
61| [OH_AVErrCode](_core.md#oh_averrcode) \* [OH_AVCencInfo_SetAlgorithm](_multimedia___drm.md#oh_avcencinfo_setalgorithm) ([OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) \*cencInfo, enum [DrmCencAlgorithm](_multimedia___drm.md#drmcencalgorithm) algo) | Sets an encryption algorithm of the CENC information.|
62| [OH_AVErrCode](_core.md#oh_averrcode) \* [OH_AVCencInfo_SetKeyIdAndIv](_multimedia___drm.md#oh_avcencinfo_setkeyidandiv) ([OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) \*cencInfo, uint8_t \*keyId, uint32_t keyIdLen, uint8_t \*iv, uint32_t ivLen) | Sets the key ID and IV in the CENC information.|
63| [OH_AVErrCode](_core.md#oh_averrcode) \* [OH_AVCencInfo_SetSubsampleInfo](_multimedia___drm.md#oh_avcencinfo_setsubsampleinfo) ([OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) \*cencInfo, uint32_t encryptedBlockCount, uint32_t skippedBlockCount, uint32_t firstEncryptedOffset, uint32_t subsampleCount, [DrmSubsample](_drm_subsample.md) \*subsamples) | Sets the subsample information in the CENC information.|
64| [OH_AVErrCode](_core.md#oh_averrcode) \* [OH_AVCencInfo_SetMode](_multimedia___drm.md#oh_avcencinfo_setmode) ([OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) \*cencInfo, enum [DrmCencInfoMode](_multimedia___drm.md#drmcencinfomode) mode) | Sets the CENC information mode.|
65| [OH_AVErrCode](_core.md#oh_averrcode) \* [OH_AVCencInfo_SetAVBuffer](_multimedia___drm.md#oh_avcencinfo_setavbuffer) ([OH_AVCencInfo](_multimedia___drm.md#oh_avcencinfo) \*cencInfo, [OH_AVBuffer](_multimedia___drm.md#oh_avbuffer) \*buffer) | Sets the CENC information to an AVBuffer.|
66