1 /* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup Drm 18 * @{ 19 * 20 * @brief Provides APIs of Drm. 21 * @kit DrmKit. 22 * @since 11 23 * @version 1.0 24 */ 25 26 /** 27 * @file native_drm_err.h 28 * @brief Defines the Drm errors. 29 * @library libnative_drm.z.so 30 * @syscap SystemCapability.Multimedia.Drm.Core 31 * @since 11 32 * @version 1.0 33 */ 34 35 #ifndef NATIVE_DRM_ERR_H 36 #define NATIVE_DRM_ERR_H 37 38 #include <stdint.h> 39 #include <stdio.h> 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 /** 46 * @brief DRM error code 47 * @syscap SystemCapability.Multimedia.Drm.Core 48 * @since 11 49 * @version 1.0 50 */ 51 typedef enum Drm_ErrCode { 52 /** 53 * the operation completed successfully. 54 */ 55 DRM_ERR_OK = 0, 56 /** 57 * DRM CAPI ERROR BASE. 58 */ 59 DRM_CAPI_ERR_BASE = 24700500, 60 /** 61 * no memory. 62 */ 63 DRM_ERR_NO_MEMORY = DRM_CAPI_ERR_BASE + 1, 64 /** 65 * opertation not be permitted. 66 */ 67 DRM_ERR_OPERATION_NOT_PERMITTED = DRM_CAPI_ERR_BASE + 2, 68 /** 69 * invalid argument. 70 */ 71 DRM_ERR_INVALID_VAL = DRM_CAPI_ERR_BASE + 3, 72 /** 73 * IO error. 74 */ 75 DRM_ERR_IO = DRM_CAPI_ERR_BASE + 4, 76 /** 77 * network timeout. 78 */ 79 DRM_ERR_TIMEOUT = DRM_CAPI_ERR_BASE + 5, 80 /** 81 * unknown error. 82 */ 83 DRM_ERR_UNKNOWN = DRM_CAPI_ERR_BASE + 6, 84 /** 85 * drm service died. 86 */ 87 DRM_ERR_SERVICE_DIED = DRM_CAPI_ERR_BASE + 7, 88 /** 89 * not support this operation in this state. 90 */ 91 DRM_ERR_INVALID_STATE = DRM_CAPI_ERR_BASE + 8, 92 /** 93 * unsupport interface. 94 */ 95 DRM_ERR_UNSUPPORTED = DRM_CAPI_ERR_BASE + 9, 96 /** 97 * Meet max MediaKeySystem num limit. 98 */ 99 DRM_ERR_MAX_SYSTEM_NUM_REACHED = DRM_CAPI_ERR_BASE + 10, 100 /** 101 * Meet max MediaKeySession num limit. 102 */ 103 DRM_ERR_MAX_SESSION_NUM_REACHED = DRM_CAPI_ERR_BASE + 11, 104 /** 105 * extend err start. 106 */ 107 DRM_ERR_EXTEND_START = DRM_CAPI_ERR_BASE + 100, 108 } Drm_ErrCode; 109 110 #ifdef __cplusplus 111 } 112 #endif 113 114 #endif // NATIVE_DRM_ERR_H