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: GStreamer encountered a general core library error.
40 * @GST_CORE_ERROR_TOO_LAZY: GStreamer developers were too lazy to assign an error code to this error. Please file a bug.
41 * @GST_CORE_ERROR_NOT_IMPLEMENTED: Internal GStreamer error: code not implemented. File a bug.
42 * @GST_CORE_ERROR_STATE_CHANGE: Internal GStreamer error: state change failed. File a bug.
43 * @GST_CORE_ERROR_PAD: Internal GStreamer error: pad problem. File a bug.
44 * @GST_CORE_ERROR_THREAD: Internal GStreamer error: thread problem. File a bug.
45 * @GST_CORE_ERROR_SCHEDULER: Internal GStreamer error: scheduler problem. File a bug.
46 * @GST_CORE_ERROR_NEGOTIATION: Internal GStreamer error: negotiation problem. File a bug.
47 * @GST_CORE_ERROR_EVENT: Internal GStreamer error: event problem. File a bug.
48 * @GST_CORE_ERROR_SEEK: Internal GStreamer error: seek problem. File a bug.
49 * @GST_CORE_ERROR_CAPS: Internal GStreamer error: caps problem. File a bug.
50 * @GST_CORE_ERROR_TAG: Internal GStreamer error: tag problem. File a bug.
51 * @GST_CORE_ERROR_NUM_ERRORS: the error count
53 * Core errors are anything that can go wrong in or using
54 * the core GStreamer library
56 /* FIXME: should we divide in numerical blocks so we can easily add
57 for example PAD errors later ? */
60 GST_CORE_ERROR_FAILED = 1,
61 GST_CORE_ERROR_TOO_LAZY,
62 GST_CORE_ERROR_NOT_IMPLEMENTED,
63 GST_CORE_ERROR_STATE_CHANGE,
65 GST_CORE_ERROR_THREAD,
66 GST_CORE_ERROR_SCHEDULER,
67 GST_CORE_ERROR_NEGOTIATION,
72 GST_CORE_ERROR_NUM_ERRORS
77 * @GST_LIBRARY_ERROR_FAILED: GStreamer encountered a general supporting library error.
78 * @GST_LIBRARY_ERROR_TOO_LAZY: GStreamer developers were too lazy to assign an error code to this error. Please file a bug.
79 * @GST_LIBRARY_ERROR_INIT: Could not initialize supporting library.
80 * @GST_LIBRARY_ERROR_SHUTDOWN: Could not close supporting library.
81 * @GST_LIBRARY_ERROR_SETTINGS: Could not close supporting library.
82 * @GST_LIBRARY_ERROR_ENCODE:
83 * @GST_LIBRARY_ERROR_NUM_ERRORS: the error count
85 * Library errors are for errors from the library being used by elements
86 * initializing, closing, ...
90 GST_LIBRARY_ERROR_FAILED = 1,
91 GST_LIBRARY_ERROR_TOO_LAZY,
92 GST_LIBRARY_ERROR_INIT,
93 GST_LIBRARY_ERROR_SHUTDOWN,
94 GST_LIBRARY_ERROR_SETTINGS,
95 GST_LIBRARY_ERROR_ENCODE,
96 GST_LIBRARY_ERROR_NUM_ERRORS
101 * @GST_RESOURCE_ERROR_FAILED: GStreamer encountered a general resource error
102 * @GST_RESOURCE_ERROR_TOO_LAZY: GStreamer developers were too lazy to assign an error code to this error. Please file a bug.
103 * @GST_RESOURCE_ERROR_NOT_FOUND: Resource not found
104 * @GST_RESOURCE_ERROR_BUSY: Resource busy or not available
105 * @GST_RESOURCE_ERROR_OPEN_READ: Could not open resource for reading
106 * @GST_RESOURCE_ERROR_OPEN_WRITE: Could not open resource for writing
107 * @GST_RESOURCE_ERROR_OPEN_READ_WRITE: Could not open resource for reading and writing
108 * @GST_RESOURCE_ERROR_CLOSE: Could not close resource
109 * @GST_RESOURCE_ERROR_READ: Could not read from resource
110 * @GST_RESOURCE_ERROR_WRITE: Could not write to resource
111 * @GST_RESOURCE_ERROR_SEEK: Could not perform seek on resource
112 * @GST_RESOURCE_ERROR_SYNC: Could not synchronize on resource
113 * @GST_RESOURCE_ERROR_SETTINGS: Could not get/set settings from/on resource
114 * @GST_RESOURCE_ERROR_NUM_ERRORS: the error count
116 * Resource errors are for anything external used by an element:
117 * memory, files, network connections, process space, ...
118 * They're typically used by source and sink elements
122 GST_RESOURCE_ERROR_FAILED = 1,
123 GST_RESOURCE_ERROR_TOO_LAZY,
124 GST_RESOURCE_ERROR_NOT_FOUND,
125 GST_RESOURCE_ERROR_BUSY,
126 GST_RESOURCE_ERROR_OPEN_READ,
127 GST_RESOURCE_ERROR_OPEN_WRITE,
128 GST_RESOURCE_ERROR_OPEN_READ_WRITE,
129 GST_RESOURCE_ERROR_CLOSE,
130 GST_RESOURCE_ERROR_READ,
131 GST_RESOURCE_ERROR_WRITE,
132 GST_RESOURCE_ERROR_SEEK,
133 GST_RESOURCE_ERROR_SYNC,
134 GST_RESOURCE_ERROR_SETTINGS,
135 GST_RESOURCE_ERROR_NUM_ERRORS
140 * @GST_STREAM_ERROR_FAILED: GStreamer encountered a general stream error
141 * @GST_STREAM_ERROR_TOO_LAZY: GStreamer developers were too lazy to assign an error code to this error. Please file a bug
142 * @GST_STREAM_ERROR_NOT_IMPLEMENTED: Element doesn't implement handling of this stream. Please file a bug.
143 * @GST_STREAM_ERROR_TYPE_NOT_FOUND: Could not determine type of stream
144 * @GST_STREAM_ERROR_WRONG_TYPE: The stream is of a different type than handled by this element
145 * @GST_STREAM_ERROR_CODEC_NOT_FOUND: There is no codec present that can handle the stream's type
146 * @GST_STREAM_ERROR_DECODE: Could not decode stream
147 * @GST_STREAM_ERROR_ENCODE: Could not encode stream
148 * @GST_STREAM_ERROR_DEMUX: Could not demultiplex stream
149 * @GST_STREAM_ERROR_MUX: Could not multiplex stream
150 * @GST_STREAM_ERROR_FORMAT: Stream is of the wrong format
151 * @GST_STREAM_ERROR_NUM_ERRORS: the error count
153 * Stream errors are for anything related to the stream being processed:
154 * format errors, media type errors, ...
155 * They're typically used by decoders, demuxers, converters, ...
159 GST_STREAM_ERROR_FAILED = 1,
160 GST_STREAM_ERROR_TOO_LAZY,
161 GST_STREAM_ERROR_NOT_IMPLEMENTED,
162 GST_STREAM_ERROR_TYPE_NOT_FOUND,
163 GST_STREAM_ERROR_WRONG_TYPE,
164 GST_STREAM_ERROR_CODEC_NOT_FOUND,
165 GST_STREAM_ERROR_DECODE,
166 GST_STREAM_ERROR_ENCODE,
167 GST_STREAM_ERROR_DEMUX,
168 GST_STREAM_ERROR_MUX,
169 GST_STREAM_ERROR_FORMAT,
170 GST_STREAM_ERROR_NUM_ERRORS
173 /* This should go away once we convinced glib people to register GError */
174 #define GST_TYPE_G_ERROR (gst_g_error_get_type ())
176 #define GST_LIBRARY_ERROR gst_library_error_quark ()
177 #define GST_RESOURCE_ERROR gst_resource_error_quark ()
178 #define GST_CORE_ERROR gst_core_error_quark ()
179 #define GST_STREAM_ERROR gst_stream_error_quark ()
181 #define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno))
183 GType gst_g_error_get_type (void);
184 gchar *gst_error_get_message (GQuark domain, gint code);
185 GQuark gst_stream_error_quark (void);
186 GQuark gst_core_error_quark (void);
187 GQuark gst_resource_error_quark (void);
188 GQuark gst_library_error_quark (void);
191 #endif /* __GST_ERROR_H__ */