• 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      * @error the operation completed successfully.
54      */
55     AV_ERR_OK = 0,
56     /**
57      * @error no memory.
58      */
59     AV_ERR_NO_MEMORY = 1,
60     /**
61      * @error opertation not be permitted.
62      */
63     AV_ERR_OPERATE_NOT_PERMIT = 2,
64     /**
65      * @error invalid argument.
66      */
67     AV_ERR_INVALID_VAL = 3,
68     /**
69      * @error IO error.
70      */
71     AV_ERR_IO = 4,
72     /**
73      * @error network timeout.
74      */
75     AV_ERR_TIMEOUT = 5,
76     /**
77      * @error unknown error.
78      */
79     AV_ERR_UNKNOWN = 6,
80     /**
81      * @error media service died.
82      */
83     AV_ERR_SERVICE_DIED = 7,
84     /**
85      * @error the state is not support this operation.
86      */
87     AV_ERR_INVALID_STATE = 8,
88     /**
89      * @error 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 18
100      */
101     AV_ERR_UNSUPPORTED_FORMAT = 11,
102     /**
103      * @error extend err start.
104      */
105     AV_ERR_EXTEND_START = 100,
106     /**
107      * @error drm error base.
108      * @since 12
109      */
110     AV_ERR_DRM_BASE = 200,
111     /**
112      * @error drm decypt failed.
113      * @since 12
114      */
115     AV_ERR_DRM_DECRYPT_FAILED = 201,
116     /**
117      * @error video error base.
118      * @since 12
119      */
120     AV_ERR_VIDEO_BASE = 300,
121     /**
122      * @error video unsupported color space conversion.
123      * @since 12
124      */
125     AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301,
126     /**
127      * @error can not find host, maybe the address of server is incorrect.
128      * @since 14
129      */
130     AV_ERR_IO_CANNOT_FIND_HOST = 5411001,
131     /**
132      * @error network connection timeout.
133      * @since 14
134      */
135     AV_ERR_IO_CONNECTION_TIMEOUT = 5411002,
136     /**
137      * @error failed link due to abnormal network.
138      * @since 14
139      */
140     AV_ERR_IO_NETWORK_ABNORMAL = 5411003,
141     /**
142      * @error failed link due to unavailable network.
143      * @since 14
144      */
145     AV_ERR_IO_NETWORK_UNAVAILABLE = 5411004,
146     /**
147      * @error network permission dennied.
148      * @since 14
149      */
150     AV_ERR_IO_NO_PERMISSION = 5411005,
151     /**
152      * @error the client request parameters are incorrect or exceed the processing capacity.
153      * @since 14
154      */
155     AV_ERR_IO_NETWORK_ACCESS_DENIED = 5411006,
156     /**
157      * @error cannot find available network resources.
158      * @since 14
159      */
160     AV_ERR_IO_RESOURCE_NOT_FOUND = 5411007,
161     /**
162      * @error the server failed to verify the client certificate because the certificate is not carried,
163      *  the certificate is invalid, or the certificate is expired.
164      * @since 14
165      */
166     AV_ERR_IO_SSL_CLIENT_CERT_NEEDED = 5411008,
167     /**
168      * @error the client failed to verify the server certificate because the certificate is not carried,
169      *  the certificate is invalid, or the certificate is expired.
170      * @since 14
171      */
172     AV_ERR_IO_SSL_CONNECT_FAIL = 5411009,
173     /**
174      * @error SSL server cert untrusted.
175      * @since 14
176      */
177     AV_ERR_IO_SSL_SERVER_CERT_UNTRUSTED = 5411010,
178     /**
179      * @error unsupported request due to network protocols.
180      * @since 14
181      */
182     AV_ERR_IO_UNSUPPORTED_REQUEST = 5411011,
183     /**
184      * @error Signals a stream format change in synchronous mode.
185      * Required follow-up actions:
186      *    - For video encoders: Call {@link OH_VideoEncoder_GetOutputDescription}
187      *    - For video decoders: Call {@link OH_VideoDecoder_GetOutputDescription}
188      *    - For audio decoders : Call {@link OH_AudioCodec_GetOutputDescription}
189      * to retrieve updated stream configuration.
190      * @since 20
191      */
192     AV_ERR_STREAM_CHANGED = 5410005,
193     /**
194      * @error Indicates temporary buffer query failure in synchronous mode,
195      * it's recommended to wait and retry the operation after a short interval.
196      * @since 20
197      */
198     AV_ERR_TRY_AGAIN_LATER = 5410006,
199 } OH_AVErrCode;
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif // NATIVE_AVERRORS_H
206 /** @} */