native_drm_common.h
Overview
The file declares the DRM data types.
File to include: <multimedia/drm_framework/native_drm_common.h>
Library: libnative_drm.so
System capability: SystemCapability.Multimedia.Drm.Core
Since: 11
Related module: Drm
Summary
Structs
| Name | typedef Keyword | Description |
|---|---|---|
| DRM_MediaKeyRequestInfo | DRM_MediaKeyRequestInfo | Describes the information about a media key request. |
| DRM_MediaKeyRequest | DRM_MediaKeyRequest | Describes the media key request. |
| DRM_Statistics | DRM_Statistics | Describes the metrics for a media key system. |
| DRM_OfflineMediakeyIdArray | DRM_OfflineMediakeyIdArray | Describes an array of offline media key IDs. |
| DRM_KeysInfo | DRM_KeysInfo | Describes the information about media keys. |
| DRM_MediaKeyStatus | DRM_MediaKeyStatus | Describes the media key status. |
| DRM_PsshInfo | DRM_PsshInfo | Describes the Protection System Specific Header (PSSH) data for a DRM system. |
| DRM_MediaKeySystemInfo | DRM_MediaKeySystemInfo | Describes the DRM information for encrypted content. |
| DRM_MediaKeySystemDescription | DRM_MediaKeySystemDescription | Describes the DRM solution name and UUID list. |
| MediaKeySystem | MediaKeySystem | Describes the media key system. |
| MediaKeySession | MediaKeySession | Describes the media key session. |
Enums
| Name | typedef Keyword | Description |
|---|---|---|
| DRM_EventType | DRM_EventType | Enumerates the types of events that can be subscribed to. |
| DRM_ContentProtectionLevel | DRM_ContentProtectionLevel | Enumerates the content protection levels. |
| DRM_MediaKeyType | DRM_MediaKeyType | Enumerates the types of media keys. |
| DRM_MediaKeyRequestType | DRM_MediaKeyRequestType | Enumerates the types of media key requests. |
| DRM_OfflineMediaKeyStatus | DRM_OfflineMediaKeyStatus | Enumerates the statuses of offline media keys. |
| DRM_CertificateStatus | DRM_CertificateStatus | Enumerates the device certificate statuses. |
Functions
| Name | typedef Keyword | Description |
|---|---|---|
| typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo *mediaKeySystemInfo) | DRM_MediaKeySystemInfoCallback | Defines the callback used to obtain DRM information from a media source. |
Macros
| Name | Description |
|---|---|
| MAX_MEDIA_KEY_REQUEST_OPTION_COUNT 16 | Maximum number of optional data entries in a media key request. Since: 11 |
| MAX_MEDIA_KEY_REQUEST_OPTION_NAME_LEN 64 | Maximum length of an optional data name in a media key request. Since: 11 |
| MAX_MEDIA_KEY_REQUEST_OPTION_DATA_LEN 128 | Maximum length of optional data in a media key request. Since: 11 |
| MAX_INIT_DATA_LEN 2048 | Maximum length of initialization data for a media key request. Since: 11 |
| MAX_MIMETYPE_LEN 64 | Maximum length of a MIME type. Since: 11 |
| MAX_MEDIA_KEY_REQUEST_DATA_LEN 8192 | Maximum length of data in a media key request. Since: 11 |
| MAX_DEFAULT_URL_LEN 2048 | Maximum length of a URL. Since: 11 |
| MAX_STATISTICS_COUNT 10 | Maximum number of metric records. Since: 11 |
| MAX_STATISTICS_NAME_LEN 64 | Maximum length of a metric name. Since: 11 |
| MAX_STATISTICS_BUFFER_LEN 256 | Maximum length of a metric buffer. Since: 11 |
| MAX_OFFLINE_MEDIA_KEY_ID_COUNT 512 | Maximum number of offline media key IDs. Since: 11 |
| MAX_OFFLINE_MEDIA_KEY_ID_LEN 64 | Maximum length of an offline media key ID. Since: 11 |
| MAX_KEY_INFO_COUNT 64 | Maximum number of key information entries. Since: 11 |
| MAX_KEY_ID_LEN 16 | Maximum length of a key ID. Since: 11 |
| MAX_KEY_STATUS_VALUE_LEN 128 | Maximum length of a key status value. Since: 11 |
| MAX_MEDIA_KEY_STATUS_COUNT 64 | Maximum number of media key statuses. Since: 11 |
| MAX_MEDIA_KEY_STATUS_NAME_LEN 64 | Maximum length of a media key status name. Since: 11 |
| MAX_MEDIA_KEY_STATUS_VALUE_LEN 256 | Maximum length of a media key status value. Since: 11 |
| DRM_UUID_LEN 16 | Length of the UUID of a DRM solution. Since: 11 |
| MAX_PSSH_DATA_LEN 2048 | Maximum length of PSSH data. Since: 11 |
| MAX_PSSH_INFO_COUNT 8 | Maximum number of PSSH data entries. Since: 11 |
| MAX_MEDIA_KEY_SYSTEM_NAME_LEN 128 | Maximum length of a MediaKeySystem instance name. Since: 12 |
| MAX_MEDIA_KEY_SYSTEM_NUM 8 | Maximum number of MediaKeySystem instances. Since: 12 |
Enum Description
DRM_EventType
enum DRM_EventType
Description
Enumerates the types of events that can be subscribed to.
System capability: SystemCapability.Multimedia.Drm.Core
Since: 11
| Enum Item | Description |
|---|---|
| EVENT_DRM_BASE = 200 | DRM event. |
| EVENT_PROVISION_REQUIRED = 201 | Event indicating that the application needs to request a device certificate. |
| EVENT_KEY_REQUIRED = 202 | Event indicating that the application needs to request a media key. |
| EVENT_KEY_EXPIRED = 203 | Event indicating that the media key expires. |
| EVENT_VENDOR_DEFINED = 204 | Vendor-defined event. |
| EVENT_EXPIRATION_UPDATE = 206 | Event indicating that the media key is updated on expiry. |
DRM_ContentProtectionLevel
enum DRM_ContentProtectionLevel
Description
Enumerates the content protection levels.
System capability: SystemCapability.Multimedia.Drm.Core
Since: 11
| Enum Item | Description |
|---|---|
| CONTENT_PROTECTION_LEVEL_UNKNOWN = 0 | Unknown level. |
| CONTENT_PROTECTION_LEVEL_SW_CRYPTO | Software-based content protection. |
| CONTENT_PROTECTION_LEVEL_HW_CRYPTO | Hardware-based content protection. |
| CONTENT_PROTECTION_LEVEL_ENHANCED_HW_CRYPTO | Enhanced hardware-based content protection. |
| CONTENT_PROTECTION_LEVEL_MAX | Maximum content protection level. |
DRM_MediaKeyType
enum DRM_MediaKeyType
Description
Enumerates the types of media keys.
System capability: SystemCapability.Multimedia.Drm.Core
Since: 11
| Enum Item | Description |
|---|---|
| MEDIA_KEY_TYPE_OFFLINE = 0 | Offline media key. |
| MEDIA_KEY_TYPE_ONLINE | Online media key. |
DRM_MediaKeyRequestType
enum DRM_MediaKeyRequestType
Description
Enumerates the types of media key requests.
System capability: SystemCapability.Multimedia.Drm.Core
Since: 11
| Enum Item | Description |
|---|---|
| MEDIA_KEY_REQUEST_TYPE_UNKNOWN = 0 | Unknown type. |
| MEDIA_KEY_REQUEST_TYPE_INITIAL | Initialization request. |
| MEDIA_KEY_REQUEST_TYPE_RENEWAL | Renewal request. |
| MEDIA_KEY_REQUEST_TYPE_RELEASE | Release request. |
| MEDIA_KEY_REQUEST_TYPE_NONE | No request. |
| MEDIA_KEY_REQUEST_TYPE_UPDATE | Update request. |
DRM_OfflineMediaKeyStatus
enum DRM_OfflineMediaKeyStatus
Description
Enumerates the statuses of offline media keys.
System capability: SystemCapability.Multimedia.Drm.Core
Since: 11
| Enum Item | Description |
|---|---|
| OFFLINE_MEDIA_KEY_STATUS_UNKNOWN = 0 | Unknown status. |
| OFFLINE_MEDIA_KEY_STATUS_USABLE | The media key is available. |
| OFFLINE_MEDIA_KEY_STATUS_INACTIVE | The media key is inactive. |
DRM_CertificateStatus
enum DRM_CertificateStatus
Description
Enumerates the device certificate statuses.
System capability: SystemCapability.Multimedia.Drm.Core
Since: 11
| Enum Item | Description |
|---|---|
| CERT_STATUS_PROVISIONED = 0 | A device certificate is provisioned. |
| CERT_STATUS_NOT_PROVISIONED | No device certificate is provisioned or the certificate status is abnormal. |
| CERT_STATUS_EXPIRED | The device certificate has expired. |
| CERT_STATUS_INVALID | The device certificate is invalid. |
| CERT_STATUS_UNAVAILABLE | The device certificate is unavailable. |
Function Description
DRM_MediaKeySystemInfoCallback()
typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo *mediaKeySystemInfo)
Description
Defines the callback used to obtain DRM information from a media source.
Since: 11
Parameters
| Name | Description |
|---|---|
| DRM_MediaKeySystemInfo *mediaKeySystemInfo | Pointer to the DRM information obtained from the media source. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-drm-drm-mediakeysystemdescription
openharmony 鸿蒙 capi-drm-drm-offlinemediakeyidarray
openharmony 鸿蒙 arkts-apis-drm-MediaKeySession
openharmony 鸿蒙 capi-drm-drm-keysinfo
openharmony 鸿蒙 capi-native-mediakeysystem-h
openharmony 鸿蒙 capi-drm-drm-mediakeyrequest
openharmony 鸿蒙 capi-native-mediakeysession-h