add error symbol start translating gst-inspect
[platform/upstream/gstreamer.git] / gst / gsterror.h
1 /* GStreamer
2  * Copyright (C) 2004 Thomas Vander Stichele <thomas at apestaart dot org>
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 #ifndef __GST_ERROR_H__
21 #define __GST_ERROR_H__
22
23 G_BEGIN_DECLS
24
25 /*
26  * we define FIXME error domains:
27  * GST_CORE_ERROR
28  * GST_LIBRARY_ERROR
29  * GST_RESOURCE_ERROR
30  * GST_STREAM_ERROR
31  *
32  * Check GError API docs for rationale for naming.
33  */
34
35 /* Core errors are anything that can go wrong in or using
36  * the core GStreamer library */
37 /* FIXME: should we divide in numerical blocks so we can easily add
38           for example PAD errors later ? */
39 typedef enum {
40   GST_CORE_ERROR_FAILED = 1,
41   GST_CORE_ERROR_TOO_LAZY,
42   GST_CORE_ERROR_NOT_IMPLEMENTED,
43   GST_CORE_ERROR_STATE_CHANGE,
44   GST_CORE_ERROR_PAD,
45   GST_CORE_ERROR_THREAD,
46   GST_CORE_ERROR_SCHEDULER,
47   GST_CORE_ERROR_NEGOTIATION,
48   GST_CORE_ERROR_EVENT,
49   GST_CORE_ERROR_SEEK,
50   GST_CORE_ERROR_CAPS,
51   GST_CORE_ERROR_TAG,
52   GST_CORE_ERROR_NUM_ERRORS
53 }
54 GstCoreError;
55
56 #define GST_CORE_ERROR gst_core_error_quark ()
57 GQuark gst_core_error_quark (void);
58
59 /* Library errors are for errors from the library being used by elements
60    initializing, closing, ... */
61 typedef enum {
62   GST_LIBRARY_ERROR_FAILED = 1,
63   GST_LIBRARY_ERROR_TOO_LAZY,
64   GST_LIBRARY_ERROR_INIT,
65   GST_LIBRARY_ERROR_SHUTDOWN,
66   GST_LIBRARY_ERROR_SETTINGS,
67   GST_LIBRARY_ERROR_ENCODE,
68   GST_LIBRARY_ERROR_NUM_ERRORS
69 }
70 GstLibraryError;
71
72 #define GST_LIBRARY_ERROR gst_library_error_quark ()
73 GQuark gst_library_error_quark (void);
74
75
76 /* Resource errors are for anything external used by an element:
77    memory, files, network connections, process space, ...
78    They're typically used by source and sink elements */
79 typedef enum {
80   GST_RESOURCE_ERROR_FAILED = 1,
81   GST_RESOURCE_ERROR_TOO_LAZY,
82   GST_RESOURCE_ERROR_NOT_FOUND,
83   GST_RESOURCE_ERROR_BUSY,
84   GST_RESOURCE_ERROR_OPEN_READ,
85   GST_RESOURCE_ERROR_OPEN_WRITE,
86   GST_RESOURCE_ERROR_OPEN_READ_WRITE,
87   GST_RESOURCE_ERROR_CLOSE,
88   GST_RESOURCE_ERROR_READ,
89   GST_RESOURCE_ERROR_WRITE,
90   GST_RESOURCE_ERROR_SEEK,
91   GST_RESOURCE_ERROR_SYNC,
92   GST_RESOURCE_ERROR_SETTINGS,
93   GST_RESOURCE_ERROR_NUM_ERRORS
94 }
95 GstResourceError;
96
97 #define GST_RESOURCE_ERROR gst_resource_error_quark ()
98 GQuark gst_resource_error_quark (void);
99
100 /* Stream errors are for anything related to the stream being processed:
101    format errors, media type errors, ...
102    They're typically used by decoders, demuxers, converters, ... */
103 typedef enum {
104   GST_STREAM_ERROR_FAILED = 1,
105   GST_STREAM_ERROR_TOO_LAZY,
106   GST_STREAM_ERROR_NOT_IMPLEMENTED,
107   GST_STREAM_ERROR_TYPE_NOT_FOUND,
108   GST_STREAM_ERROR_WRONG_TYPE,
109   GST_STREAM_ERROR_CODEC_NOT_FOUND,
110   GST_STREAM_ERROR_DECODE,
111   GST_STREAM_ERROR_ENCODE,
112   GST_STREAM_ERROR_DEMUX,
113   GST_STREAM_ERROR_MUX,
114   GST_STREAM_ERROR_FORMAT,
115   GST_STREAM_ERROR_NUM_ERRORS
116 }
117 GstStreamError;
118
119 #define GST_STREAM_ERROR gst_stream_error_quark ()
120 GQuark gst_stream_error_quark (void);
121
122
123 #define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno))
124 gchar * gst_error_get_message (GQuark domain, gint code);
125
126 G_END_DECLS
127
128 #endif /* __GST_ERROR_H__ */
129
130