• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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      * @error unsupported format.
99      * @since 16
100      */
101     AV_ERR_UNSUPPORTED_FORMAT = 11,
102     /**
103      * @error hardware failed.
104      * @since 20
105      */
106     AV_ERR_HARDWARE_FAILED = 12,
107     /**
108      * extend err start.
109      */
110     AV_ERR_EXTEND_START = 100,
111     /**drm error base.
112      * @since 12
113      */
114     AV_ERR_DRM_BASE = 200,
115     /** drm decypt failed.
116      * @since 12
117      */
118     AV_ERR_DRM_DECRYPT_FAILED = 201,
119     /**
120      * @error video error base.
121      * @since 12
122      */
123     AV_ERR_VIDEO_BASE = 300,
124     /**
125      * @error video unsupported color space conversion.
126      * @since 12
127      */
128     AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301,
129     /**
130      * @error the address of server is incorrect, and IO can not find host.
131      * @since 14
132      */
133     AV_ERR_IO_CANNOT_FIND_HOST = 5411001,
134     /**
135      * @error network connection timeout.
136      * @since 14
137      */
138     AV_ERR_IO_CONNECTION_TIMEOUT = 5411002,
139     /**
140      * @error failed link due to abnormal network.
141      * @since 14
142      */
143     AV_ERR_IO_NETWORK_ABNORMAL = 5411003,
144     /**
145      * @error failed link due to unavailable network.
146      * @since 14
147      */
148     AV_ERR_IO_NETWORK_UNAVAILABLE = 5411004,
149     /**
150      * @error network permission dennied.
151      * @since 14
152      */
153     AV_ERR_IO_NO_PERMISSION = 5411005,
154     /**
155      * @error the client request parameters are incorrect or exceed the processing capacity.
156      * @since 14
157      */
158     AV_ERR_IO_NETWORK_ACCESS_DENIED = 5411006,
159     /**
160      * @error cannot find available network resources.
161      * @since 14
162      */
163     AV_ERR_IO_RESOURCE_NOT_FOUND = 5411007,
164     /**
165      * @error the server fails to verify the client certificate because the certificate is not carried,
166      *  the certificate is invalid, or the certificate is expired.
167      * @since 14
168      */
169     AV_ERR_IO_SSL_CLIENT_CERT_NEEDED = 5411008,
170     /**
171      * @error the client fails to verify the server certificate because the certificate is not carried,
172      *  the certificate is invalid, or the certificate is expired.
173      * @since 14
174      */
175     AV_ERR_IO_SSL_CONNECT_FAIL = 5411009,
176     /**
177      * @error IO SSL server cert untrusted.
178      * @since 14
179      */
180     AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED = 5411010,
181     /**
182      * @error unsupported request due to network protocols.
183      * @since 14
184      */
185     AV_ERR_IO_UNSUPPORTED_REQUEST = 5411011,
186     /**
187      * @error Signals a stream format change in synchronous mode.
188      * Required follow-up actions:
189      *    - For video encoders: Call {@link OH_VideoEncoder_GetOutputDescription}
190      *    - For video decoders: Call {@link OH_VideoDecoder_GetOutputDescription}
191      *    - For audio decoders : Call {@link OH_AudioCodec_GetOutputDescription}
192      * to retrieve updated stream configuration.
193      * @since 20
194      */
195     AV_ERR_STREAM_CHANGED = 5410005,
196     /**
197      * @error Indicates temporary buffer query failure in synchronous mode,
198      * it's recommended to wait and retry the operation after a short interval.
199      * @since 20
200      */
201     AV_ERR_TRY_AGAIN_LATER = 5410006,
202 } OH_AVErrCode;
203 
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif // NATIVE_AVERRORS_H
209 /** @} */
210