• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 #ifndef OHOS_DRM_DRM_ERROR_CODE_NAPI_H
16 #define OHOS_DRM_DRM_ERROR_CODE_NAPI_H
17 
18 #include "drm_error_code.h"
19 
20 namespace OHOS {
21 namespace DrmStandard {
22 
23 enum DrmNapiErrCode : int32_t {
24     /**
25      * the operation completed successfully.
26      */
27     DRM_NAPI_ERR_OK = 0,
28     /**
29      * invalid argument.
30      */
31     DRM_NAPI_ERR_INVALID_VAL = 401,
32     /**
33      * DRM_NAPI_ERR_BASE.
34      */
35     DRM_NAPI_ERR_BASE = 24700100,
36     /**
37      * all unknown errors.
38      */
39     DRM_NAPI_ERR_UNKNOWN = DRM_NAPI_ERR_BASE + 1,
40     /**
41      * Meet max MediaKeySystem num limit.
42      */
43     DRM_NAPI_ERR_MAX_SYSTEM_NUM_REACHED = DRM_NAPI_ERR_BASE + 3,
44     /**
45      * Meet max MediaKeySession num limit.
46      */
47     DRM_NAPI_ERR_MAX_SESSION_NUM_REACHED = DRM_NAPI_ERR_BASE + 4,
48     /**
49      * device not provisioned.
50      */
51     DRM_NAPI_ERR_NOT_PROVISIONED = DRM_NAPI_ERR_BASE + 5,
52     /**
53      * no device cert.
54      */
55     DRM_NAPI_ERR_NO_DEVICE_CERT = DRM_NAPI_ERR_BASE + 6,
56     /**
57      * drm certificates are revoked.
58      */
59     DRM_NAPI_ERR_DRM_CERTIFICATES_REVOKED = DRM_NAPI_ERR_BASE + 7,
60     /**
61      * time error.
62      */
63     DRM_NAPI_ERR_DEVICE_TIME_ERROR = DRM_NAPI_ERR_BASE + 8,
64     /**
65      * service denied when processing key response.
66      */
67     DRM_NAPI_ERR_SERVICE_DENIED = DRM_NAPI_ERR_BASE + 9,
68     /**
69      * no license when decrypting media samples.
70      */
71     DRM_NAPI_ERR_NO_LICENSE = DRM_NAPI_ERR_BASE + 10,
72     /**
73      * no key when decrypting media samples.
74      */
75     DRM_NAPI_ERR_NO_KEY = DRM_NAPI_ERR_BASE + 11,
76     /**
77      * service fatal error, for example, service died.
78      */
79     DRM_NAPI_ERR_SERVICE_FATAL = 24700201,
80 
81 //缺少memory error
82 };
83 
84 __attribute__((visibility("default"))) DrmNapiErrCode DrmInnerErrToNapiErr(DrmInnerErrCode errCode);
85 
86 __attribute__((visibility("default"))) DrmNapiErrCode DrmInnerErrToNapiErrAPI12(DrmInnerErrCode errCode);
87 
88 } // namespace DrmStandard
89 } // namespace OHOS
90 #endif // OHOS_DRM_DRM_ERROR_CODE_NAPI_H