2 * Copyright (C) 2004 Thomas Vander Stichele <thomas at apestaart dot org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_ERROR_H__
21 #define __GST_ERROR_H__
24 #include <glib-object.h>
29 * we define FIXME error domains:
35 * Check GError API docs for rationale for naming.
39 * @GST_CORE_ERROR_FAILED: a general error which doesn't fit in any other
40 * category. Make sure you add a custom message to the error call.
41 * @GST_CORE_ERROR_TOO_LAZY: do not use this except as a placeholder for
42 * deciding where to go while developing code.
43 * @GST_CORE_ERROR_NOT_IMPLEMENTED: use this when you do not want to implement
44 * this functionality yet.
45 * @GST_CORE_ERROR_STATE_CHANGE: used for state change errors.
46 * @GST_CORE_ERROR_PAD: used for pad-related errors.
47 * @GST_CORE_ERROR_THREAD: used for thread-related errors.
48 * @GST_CORE_ERROR_SCHEDULER: used for scheduler-related errors.
49 * @GST_CORE_ERROR_NEGOTIATION: used for negotiation-related errors.
50 * @GST_CORE_ERROR_EVENT: used for event-related errors.
51 * @GST_CORE_ERROR_SEEK: used for seek-related errors.
52 * @GST_CORE_ERROR_CAPS: used for caps-related errors.
53 * @GST_CORE_ERROR_TAG: used for negotiation-related errors.
54 * @GST_CORE_ERROR_NUM_ERRORS: the number of core error types.
56 * Core errors are errors inside the core GStreamer library.
57 * the core GStreamer library
59 /* FIXME: should we divide in numerical blocks so we can easily add
60 for example PAD errors later ? */
63 GST_CORE_ERROR_FAILED = 1,
64 GST_CORE_ERROR_TOO_LAZY,
65 GST_CORE_ERROR_NOT_IMPLEMENTED,
66 GST_CORE_ERROR_STATE_CHANGE,
68 GST_CORE_ERROR_THREAD,
69 GST_CORE_ERROR_SCHEDULER,
70 GST_CORE_ERROR_NEGOTIATION,
75 GST_CORE_ERROR_NUM_ERRORS
80 * @GST_LIBRARY_ERROR_FAILED: a general error which doesn't fit in any other
81 * category. Make sure you add a custom message to the error call.
82 * @GST_LIBRARY_ERROR_TOO_LAZY: do not use this except as a placeholder for
83 * deciding where to go while developing code.
84 * @GST_LIBRARY_ERROR_INIT: used when the library could not be opened.
85 * @GST_LIBRARY_ERROR_SHUTDOWN: used when the library could not be closed.
86 * @GST_LIBRARY_ERROR_SETTINGS: used when the library doesn't accept settings.
87 * @GST_LIBRARY_ERROR_ENCODE: used when the library generated an encoding error.
88 * @GST_LIBRARY_ERROR_NUM_ERRORS: the number of library error types.
90 * Library errors are for errors from the library being used by elements
91 * (initializing, finalizing, settings, ...)
95 GST_LIBRARY_ERROR_FAILED = 1,
96 GST_LIBRARY_ERROR_TOO_LAZY,
97 GST_LIBRARY_ERROR_INIT,
98 GST_LIBRARY_ERROR_SHUTDOWN,
99 GST_LIBRARY_ERROR_SETTINGS,
100 GST_LIBRARY_ERROR_ENCODE,
101 GST_LIBRARY_ERROR_NUM_ERRORS
106 * @GST_RESOURCE_ERROR_FAILED: a general error which doesn't fit in any other
107 * category. Make sure you add a custom message to the error call.
108 * @GST_RESOURCE_ERROR_TOO_LAZY: do not use this except as a placeholder for
109 * deciding where to go while developing code.
110 * @GST_RESOURCE_ERROR_NOT_FOUND: used when the resource could not be found.
111 * @GST_RESOURCE_ERROR_BUSY: used when resource is busy.
112 * @GST_RESOURCE_ERROR_OPEN_READ: used when resource fails to open for reading.
113 * @GST_RESOURCE_ERROR_OPEN_WRITE: used when resource fails to open for writing.
114 * @GST_RESOURCE_ERROR_OPEN_READ_WRITE: used when resource cannot be opened for
115 * both reading and writing, or either (but unspecified which).
116 * @GST_RESOURCE_ERROR_CLOSE: used when the resource can't be closed.
117 * @GST_RESOURCE_ERROR_READ: used when the resource can't be read from.
118 * @GST_RESOURCE_ERROR_WRITE: used when the resource can't be written to.
119 * @GST_RESOURCE_ERROR_SEEK: used when a seek on the resource fails.
120 * @GST_RESOURCE_ERROR_SYNC: used when a synchronize on the resource fails.
121 * @GST_RESOURCE_ERROR_SETTINGS: used when settings can't be manipulated on
122 * @GST_RESOURCE_ERROR_NUM_ERRORS: the number of library error types.
124 * Resource errors are for any resource used by an element:
125 * memory, files, network connections, process space, ...
126 * They're typically used by source and sink elements.
130 GST_RESOURCE_ERROR_FAILED = 1,
131 GST_RESOURCE_ERROR_TOO_LAZY,
132 GST_RESOURCE_ERROR_NOT_FOUND,
133 GST_RESOURCE_ERROR_BUSY,
134 GST_RESOURCE_ERROR_OPEN_READ,
135 GST_RESOURCE_ERROR_OPEN_WRITE,
136 GST_RESOURCE_ERROR_OPEN_READ_WRITE,
137 GST_RESOURCE_ERROR_CLOSE,
138 GST_RESOURCE_ERROR_READ,
139 GST_RESOURCE_ERROR_WRITE,
140 GST_RESOURCE_ERROR_SEEK,
141 GST_RESOURCE_ERROR_SYNC,
142 GST_RESOURCE_ERROR_SETTINGS,
143 GST_RESOURCE_ERROR_NUM_ERRORS
148 * @GST_STREAM_ERROR_FAILED: a general error which doesn't fit in any other
149 * category. Make sure you add a custom message to the error call.
150 * @GST_STREAM_ERROR_TOO_LAZY: do not use this except as a placeholder for
151 * deciding where to go while developing code.
152 * @GST_STREAM_ERROR_NOT_IMPLEMENTED: use this when you do not want to implement
153 * this functionality yet.
154 * @GST_STREAM_ERROR_TYPE_NOT_FOUND: used when the element doesn't know the
156 * @GST_STREAM_ERROR_WRONG_TYPE: used when the element doesn't handle this type
158 * @GST_STREAM_ERROR_CODEC_NOT_FOUND: used when there's no codec to handle the
160 * @GST_STREAM_ERROR_DECODE: used when decoding fails.
161 * @GST_STREAM_ERROR_ENCODE: used when encoding fails.
162 * @GST_STREAM_ERROR_DEMUX: used when demuxing fails.
163 * @GST_STREAM_ERROR_MUX: used when muxing fails.
164 * @GST_STREAM_ERROR_FORMAT: used when the stream is of the wrong format
165 * (for example, wrong caps).
166 * @GST_STREAM_ERROR_STOPPED: Streaming stopped.
167 * @GST_STREAM_ERROR_NUM_ERRORS: the number of library error types.
169 * Stream errors are for anything related to the stream being processed:
170 * format errors, media type errors, ...
171 * They're typically used by decoders, demuxers, converters, ...
175 GST_STREAM_ERROR_FAILED = 1,
176 GST_STREAM_ERROR_TOO_LAZY,
177 GST_STREAM_ERROR_NOT_IMPLEMENTED,
178 GST_STREAM_ERROR_TYPE_NOT_FOUND,
179 GST_STREAM_ERROR_WRONG_TYPE,
180 GST_STREAM_ERROR_CODEC_NOT_FOUND,
181 GST_STREAM_ERROR_DECODE,
182 GST_STREAM_ERROR_ENCODE,
183 GST_STREAM_ERROR_DEMUX,
184 GST_STREAM_ERROR_MUX,
185 GST_STREAM_ERROR_FORMAT,
186 GST_STREAM_ERROR_STOPPED,
187 GST_STREAM_ERROR_NUM_ERRORS
190 /* This should go away once we convinced glib people to register GError */
191 #define GST_TYPE_G_ERROR (gst_g_error_get_type ())
193 #define GST_LIBRARY_ERROR gst_library_error_quark ()
194 #define GST_RESOURCE_ERROR gst_resource_error_quark ()
195 #define GST_CORE_ERROR gst_core_error_quark ()
196 #define GST_STREAM_ERROR gst_stream_error_quark ()
198 #define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno))
200 GType gst_g_error_get_type (void);
201 gchar *gst_error_get_message (GQuark domain, gint code);
202 GQuark gst_stream_error_quark (void);
203 GQuark gst_core_error_quark (void);
204 GQuark gst_resource_error_quark (void);
205 GQuark gst_library_error_quark (void);
208 #endif /* __GST_ERROR_H__ */