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 Core
18  * @{
19  *
20  * @brief The Core module provides basic backbone capabilities for media frameworks,
21  * including functions such as memory, error codes, and media data structures.
22  *
23  * @syscap SystemCapability.Multimedia.Media.Core
24  * @since 9
25  */
26 
27 /**
28  * @file native_averrors.h
29  *
30  * @brief Media framework error code.
31  *
32  * @kit AVCodecKit
33  * @library libnative_media_core.so
34  * @syscap SystemCapability.Multimedia.Media.Core
35  * @since 9
36  */
37 
38 #ifndef NATIVE_AVERRORS_H
39 #define NATIVE_AVERRORS_H
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /**
46  * @brief AV error code
47  * @syscap SystemCapability.Multimedia.Media.Core
48  * @since 9
49  * @version 1.0
50  */
51 typedef enum OH_AVErrCode {
52     /**
53      * the operation completed successfully.
54      */
55     AV_ERR_OK = 0,
56     /**
57      * no memory.
58      */
59     AV_ERR_NO_MEMORY = 1,
60     /**
61      * opertation not be permitted.
62      */
63     AV_ERR_OPERATE_NOT_PERMIT = 2,
64     /**
65      * invalid argument.
66      */
67     AV_ERR_INVALID_VAL = 3,
68     /**
69      * IO error.
70      */
71     AV_ERR_IO = 4,
72     /**
73      * network timeout.
74      */
75     AV_ERR_TIMEOUT = 5,
76     /**
77      * unknown error.
78      */
79     AV_ERR_UNKNOWN = 6,
80     /**
81      * media service died.
82      */
83     AV_ERR_SERVICE_DIED = 7,
84     /**
85      * the state is not support this operation.
86      */
87     AV_ERR_INVALID_STATE = 8,
88     /**
89      * unsupport interface.
90      */
91     AV_ERR_UNSUPPORT = 9,
92     /**
93      * @error input data error.
94      * @since 12
95      */
96     AV_ERR_INPUT_DATA_ERROR = 10,
97     /**
98      * extend err start.
99      */
100     AV_ERR_EXTEND_START = 100,
101     /**drm error base.
102      * @since 12
103      */
104     AV_ERR_DRM_BASE = 200,
105     /** drm decypt failed.
106      * @since 12
107      */
108     AV_ERR_DRM_DECRYPT_FAILED = 201,
109     /**
110      * @error video error base.
111      * @since 12
112      */
113     AV_ERR_VIDEO_BASE = 300,
114     /**
115      * @error video unsupported color space conversion.
116      * @since 12
117      */
118     AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301,
119     /**
120      * @error the address of server is incorrect, and IO can not find host.
121      * @since 14
122      */
123     AV_ERR_IO_CANNOT_FIND_HOST = 5411001,
124     /**
125      * @error network connection timeout.
126      * @since 14
127      */
128     AV_ERR_IO_CONNECTION_TIMEOUT = 5411002,
129     /**
130      * @error failed link due to abnormal network.
131      * @since 14
132      */
133     AV_ERR_IO_NETWORK_ABNORMAL = 5411003,
134     /**
135      * @error failed link due to unavailable network.
136      * @since 14
137      */
138     AV_ERR_IO_NETWORK_UNAVAILABLE = 5411004,
139     /**
140      * @error network permission dennied.
141      * @since 14
142      */
143     AV_ERR_IO_NO_PERMISSION = 5411005,
144     /**
145      * @error the client request parameters are incorrect or exceed the processing capacity.
146      * @since 14
147      */
148     AV_ERR_IO_NETWORK_ACCESS_DENIED = 5411006,
149     /**
150      * @error cannot find available network resources.
151      * @since 14
152      */
153     AV_ERR_IO_RESOURCE_NOT_FOUND = 5411007,
154     /**
155      * @error the server fails to verify the client certificate because the certificate is not carried,
156      *  the certificate is invalid, or the certificate is expired.
157      * @since 14
158      */
159     AV_ERR_IO_SSL_CLIENT_CERT_NEEDED = 5411008,
160     /**
161      * @error the client fails to verify the server certificate because the certificate is not carried,
162      *  the certificate is invalid, or the certificate is expired.
163      * @since 14
164      */
165     AV_ERR_IO_SSL_CONNECT_FAIL = 5411009,
166     /**
167      * @error IO SSL server cert untrusted.
168      * @since 14
169      */
170     AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED = 5411010,
171     /**
172      * @error unsupported request due to network protocols.
173      * @since 14
174      */
175     AV_ERR_IO_UNSUPPORTED_REQUEST = 5411011,
176 } OH_AVErrCode;
177 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif // NATIVE_AVERRORS_H
183 /** @} */
184