2004-01-18 21:36:20 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2004 Thomas Vander Stichele <thomas at apestaart dot org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2004-01-18 21:36:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_ERROR_H__
|
|
|
|
#define __GST_ERROR_H__
|
|
|
|
|
2004-04-30 17:57:41 +00:00
|
|
|
#include <glib.h>
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <errno.h>
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2004-04-30 17:57:41 +00:00
|
|
|
G_BEGIN_DECLS
|
2004-01-18 21:36:20 +00:00
|
|
|
/*
|
|
|
|
* we define FIXME error domains:
|
|
|
|
* GST_CORE_ERROR
|
|
|
|
* GST_LIBRARY_ERROR
|
|
|
|
* GST_RESOURCE_ERROR
|
|
|
|
* GST_STREAM_ERROR
|
|
|
|
*
|
|
|
|
* Check GError API docs for rationale for naming.
|
|
|
|
*/
|
2005-01-04 18:13:51 +00:00
|
|
|
/**
|
|
|
|
* GstCoreError:
|
2005-02-11 09:58:31 +00:00
|
|
|
* @GST_CORE_ERROR_FAILED: a general error which doesn't fit in any other
|
|
|
|
* category. Make sure you add a custom message to the error call.
|
|
|
|
* @GST_CORE_ERROR_TOO_LAZY: do not use this except as a placeholder for
|
|
|
|
* deciding where to go while developing code.
|
|
|
|
* @GST_CORE_ERROR_NOT_IMPLEMENTED: use this when you do not want to implement
|
|
|
|
* this functionality yet.
|
|
|
|
* @GST_CORE_ERROR_STATE_CHANGE: used for state change errors.
|
|
|
|
* @GST_CORE_ERROR_PAD: used for pad-related errors.
|
|
|
|
* @GST_CORE_ERROR_THREAD: used for thread-related errors.
|
|
|
|
* @GST_CORE_ERROR_NEGOTIATION: used for negotiation-related errors.
|
|
|
|
* @GST_CORE_ERROR_EVENT: used for event-related errors.
|
|
|
|
* @GST_CORE_ERROR_SEEK: used for seek-related errors.
|
|
|
|
* @GST_CORE_ERROR_CAPS: used for caps-related errors.
|
|
|
|
* @GST_CORE_ERROR_TAG: used for negotiation-related errors.
|
2005-11-21 18:27:26 +00:00
|
|
|
* @GST_CORE_ERROR_MISSING_PLUGIN: used if a plugin is missing.
|
2005-11-23 11:22:39 +00:00
|
|
|
* @GST_CORE_ERROR_CLOCK: used for clock related errors.
|
2007-04-12 12:59:49 +00:00
|
|
|
* @GST_CORE_ERROR_DISABLED: used if functionality has been disabled at
|
2012-07-10 09:46:41 +00:00
|
|
|
* compile time.
|
2005-02-11 09:58:31 +00:00
|
|
|
* @GST_CORE_ERROR_NUM_ERRORS: the number of core error types.
|
2005-01-04 18:13:51 +00:00
|
|
|
*
|
2005-02-11 09:58:31 +00:00
|
|
|
* Core errors are errors inside the core GStreamer library.
|
2005-01-04 18:13:51 +00:00
|
|
|
*/
|
2004-01-18 21:36:20 +00:00
|
|
|
/* FIXME: should we divide in numerical blocks so we can easily add
|
|
|
|
for example PAD errors later ? */
|
2004-07-21 11:32:09 +00:00
|
|
|
typedef enum
|
2004-04-30 17:57:41 +00:00
|
|
|
{
|
2004-01-18 21:36:20 +00:00
|
|
|
GST_CORE_ERROR_FAILED = 1,
|
|
|
|
GST_CORE_ERROR_TOO_LAZY,
|
|
|
|
GST_CORE_ERROR_NOT_IMPLEMENTED,
|
|
|
|
GST_CORE_ERROR_STATE_CHANGE,
|
|
|
|
GST_CORE_ERROR_PAD,
|
|
|
|
GST_CORE_ERROR_THREAD,
|
|
|
|
GST_CORE_ERROR_NEGOTIATION,
|
|
|
|
GST_CORE_ERROR_EVENT,
|
|
|
|
GST_CORE_ERROR_SEEK,
|
|
|
|
GST_CORE_ERROR_CAPS,
|
|
|
|
GST_CORE_ERROR_TAG,
|
2005-11-21 18:27:26 +00:00
|
|
|
GST_CORE_ERROR_MISSING_PLUGIN,
|
2005-11-23 11:22:39 +00:00
|
|
|
GST_CORE_ERROR_CLOCK,
|
2007-04-12 12:59:49 +00:00
|
|
|
GST_CORE_ERROR_DISABLED,
|
2004-01-18 21:36:20 +00:00
|
|
|
GST_CORE_ERROR_NUM_ERRORS
|
2005-01-04 18:13:51 +00:00
|
|
|
} GstCoreError;
|
2004-01-18 21:36:20 +00:00
|
|
|
|
2005-01-04 18:13:51 +00:00
|
|
|
/**
|
|
|
|
* GstLibraryError:
|
2005-02-11 09:58:31 +00:00
|
|
|
* @GST_LIBRARY_ERROR_FAILED: a general error which doesn't fit in any other
|
|
|
|
* category. Make sure you add a custom message to the error call.
|
|
|
|
* @GST_LIBRARY_ERROR_TOO_LAZY: do not use this except as a placeholder for
|
|
|
|
* deciding where to go while developing code.
|
|
|
|
* @GST_LIBRARY_ERROR_INIT: used when the library could not be opened.
|
|
|
|
* @GST_LIBRARY_ERROR_SHUTDOWN: used when the library could not be closed.
|
|
|
|
* @GST_LIBRARY_ERROR_SETTINGS: used when the library doesn't accept settings.
|
|
|
|
* @GST_LIBRARY_ERROR_ENCODE: used when the library generated an encoding error.
|
|
|
|
* @GST_LIBRARY_ERROR_NUM_ERRORS: the number of library error types.
|
2005-01-04 18:13:51 +00:00
|
|
|
*
|
|
|
|
* Library errors are for errors from the library being used by elements
|
2005-02-11 09:58:31 +00:00
|
|
|
* (initializing, finalizing, settings, ...)
|
2005-01-04 18:13:51 +00:00
|
|
|
*/
|
2004-04-30 17:57:41 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2004-01-18 21:36:20 +00:00
|
|
|
GST_LIBRARY_ERROR_FAILED = 1,
|
|
|
|
GST_LIBRARY_ERROR_TOO_LAZY,
|
|
|
|
GST_LIBRARY_ERROR_INIT,
|
|
|
|
GST_LIBRARY_ERROR_SHUTDOWN,
|
|
|
|
GST_LIBRARY_ERROR_SETTINGS,
|
2004-01-26 09:45:55 +00:00
|
|
|
GST_LIBRARY_ERROR_ENCODE,
|
2004-01-20 12:42:56 +00:00
|
|
|
GST_LIBRARY_ERROR_NUM_ERRORS
|
2005-01-04 18:13:51 +00:00
|
|
|
} GstLibraryError;
|
2004-01-18 21:36:20 +00:00
|
|
|
|
2005-01-04 18:13:51 +00:00
|
|
|
/**
|
|
|
|
* GstResourceError:
|
2005-02-11 09:58:31 +00:00
|
|
|
* @GST_RESOURCE_ERROR_FAILED: a general error which doesn't fit in any other
|
|
|
|
* category. Make sure you add a custom message to the error call.
|
|
|
|
* @GST_RESOURCE_ERROR_TOO_LAZY: do not use this except as a placeholder for
|
|
|
|
* deciding where to go while developing code.
|
|
|
|
* @GST_RESOURCE_ERROR_NOT_FOUND: used when the resource could not be found.
|
|
|
|
* @GST_RESOURCE_ERROR_BUSY: used when resource is busy.
|
|
|
|
* @GST_RESOURCE_ERROR_OPEN_READ: used when resource fails to open for reading.
|
|
|
|
* @GST_RESOURCE_ERROR_OPEN_WRITE: used when resource fails to open for writing.
|
|
|
|
* @GST_RESOURCE_ERROR_OPEN_READ_WRITE: used when resource cannot be opened for
|
|
|
|
* both reading and writing, or either (but unspecified which).
|
|
|
|
* @GST_RESOURCE_ERROR_CLOSE: used when the resource can't be closed.
|
|
|
|
* @GST_RESOURCE_ERROR_READ: used when the resource can't be read from.
|
|
|
|
* @GST_RESOURCE_ERROR_WRITE: used when the resource can't be written to.
|
|
|
|
* @GST_RESOURCE_ERROR_SEEK: used when a seek on the resource fails.
|
|
|
|
* @GST_RESOURCE_ERROR_SYNC: used when a synchronize on the resource fails.
|
2006-03-04 13:54:26 +00:00
|
|
|
* @GST_RESOURCE_ERROR_SETTINGS: used when settings can't be manipulated on.
|
|
|
|
* @GST_RESOURCE_ERROR_NO_SPACE_LEFT: used when the resource has no space left.
|
2014-02-11 12:09:11 +00:00
|
|
|
* @GST_RESOURCE_ERROR_NOT_AUTHORIZED: used when the resource can't be opened
|
|
|
|
* due to missing authorization.
|
2014-02-11 12:27:25 +00:00
|
|
|
* Since: 1.2.4
|
2006-03-04 14:45:40 +00:00
|
|
|
* @GST_RESOURCE_ERROR_NUM_ERRORS: the number of resource error types.
|
2005-01-04 18:13:51 +00:00
|
|
|
*
|
2005-02-11 09:58:31 +00:00
|
|
|
* Resource errors are for any resource used by an element:
|
2005-01-04 18:13:51 +00:00
|
|
|
* memory, files, network connections, process space, ...
|
2005-02-11 09:58:31 +00:00
|
|
|
* They're typically used by source and sink elements.
|
2005-01-04 18:13:51 +00:00
|
|
|
*/
|
2004-04-30 17:57:41 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2004-01-18 21:36:20 +00:00
|
|
|
GST_RESOURCE_ERROR_FAILED = 1,
|
|
|
|
GST_RESOURCE_ERROR_TOO_LAZY,
|
|
|
|
GST_RESOURCE_ERROR_NOT_FOUND,
|
|
|
|
GST_RESOURCE_ERROR_BUSY,
|
|
|
|
GST_RESOURCE_ERROR_OPEN_READ,
|
|
|
|
GST_RESOURCE_ERROR_OPEN_WRITE,
|
|
|
|
GST_RESOURCE_ERROR_OPEN_READ_WRITE,
|
|
|
|
GST_RESOURCE_ERROR_CLOSE,
|
|
|
|
GST_RESOURCE_ERROR_READ,
|
|
|
|
GST_RESOURCE_ERROR_WRITE,
|
|
|
|
GST_RESOURCE_ERROR_SEEK,
|
|
|
|
GST_RESOURCE_ERROR_SYNC,
|
|
|
|
GST_RESOURCE_ERROR_SETTINGS,
|
2006-03-04 13:54:26 +00:00
|
|
|
GST_RESOURCE_ERROR_NO_SPACE_LEFT,
|
2014-02-11 12:09:11 +00:00
|
|
|
GST_RESOURCE_ERROR_NOT_AUTHORIZED,
|
2004-01-18 21:36:20 +00:00
|
|
|
GST_RESOURCE_ERROR_NUM_ERRORS
|
2005-01-04 18:13:51 +00:00
|
|
|
} GstResourceError;
|
2004-01-18 21:36:20 +00:00
|
|
|
|
2005-01-04 18:13:51 +00:00
|
|
|
/**
|
|
|
|
* GstStreamError:
|
2005-02-11 09:58:31 +00:00
|
|
|
* @GST_STREAM_ERROR_FAILED: a general error which doesn't fit in any other
|
|
|
|
* category. Make sure you add a custom message to the error call.
|
|
|
|
* @GST_STREAM_ERROR_TOO_LAZY: do not use this except as a placeholder for
|
|
|
|
* deciding where to go while developing code.
|
|
|
|
* @GST_STREAM_ERROR_NOT_IMPLEMENTED: use this when you do not want to implement
|
|
|
|
* this functionality yet.
|
|
|
|
* @GST_STREAM_ERROR_TYPE_NOT_FOUND: used when the element doesn't know the
|
|
|
|
* stream's type.
|
|
|
|
* @GST_STREAM_ERROR_WRONG_TYPE: used when the element doesn't handle this type
|
|
|
|
* of stream.
|
|
|
|
* @GST_STREAM_ERROR_CODEC_NOT_FOUND: used when there's no codec to handle the
|
|
|
|
* stream's type.
|
|
|
|
* @GST_STREAM_ERROR_DECODE: used when decoding fails.
|
|
|
|
* @GST_STREAM_ERROR_ENCODE: used when encoding fails.
|
|
|
|
* @GST_STREAM_ERROR_DEMUX: used when demuxing fails.
|
|
|
|
* @GST_STREAM_ERROR_MUX: used when muxing fails.
|
|
|
|
* @GST_STREAM_ERROR_FORMAT: used when the stream is of the wrong format
|
|
|
|
* (for example, wrong caps).
|
2008-04-09 17:34:54 +00:00
|
|
|
* @GST_STREAM_ERROR_DECRYPT: used when the stream is encrypted and can't be
|
2012-07-10 09:46:41 +00:00
|
|
|
* decrypted because this is not supported by the element.
|
2008-04-09 17:34:54 +00:00
|
|
|
* @GST_STREAM_ERROR_DECRYPT_NOKEY: used when the stream is encrypted and
|
2012-07-10 09:46:41 +00:00
|
|
|
* can't be decrypted because no suitable key is available.
|
2006-03-04 14:45:40 +00:00
|
|
|
* @GST_STREAM_ERROR_NUM_ERRORS: the number of stream error types.
|
2005-01-04 18:13:51 +00:00
|
|
|
*
|
|
|
|
* Stream errors are for anything related to the stream being processed:
|
|
|
|
* format errors, media type errors, ...
|
|
|
|
* They're typically used by decoders, demuxers, converters, ...
|
|
|
|
*/
|
2004-04-30 17:57:41 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2004-01-18 21:36:20 +00:00
|
|
|
GST_STREAM_ERROR_FAILED = 1,
|
|
|
|
GST_STREAM_ERROR_TOO_LAZY,
|
|
|
|
GST_STREAM_ERROR_NOT_IMPLEMENTED,
|
|
|
|
GST_STREAM_ERROR_TYPE_NOT_FOUND,
|
|
|
|
GST_STREAM_ERROR_WRONG_TYPE,
|
2004-02-03 11:23:59 +00:00
|
|
|
GST_STREAM_ERROR_CODEC_NOT_FOUND,
|
2004-01-18 21:36:20 +00:00
|
|
|
GST_STREAM_ERROR_DECODE,
|
|
|
|
GST_STREAM_ERROR_ENCODE,
|
|
|
|
GST_STREAM_ERROR_DEMUX,
|
|
|
|
GST_STREAM_ERROR_MUX,
|
|
|
|
GST_STREAM_ERROR_FORMAT,
|
2008-04-09 17:34:54 +00:00
|
|
|
GST_STREAM_ERROR_DECRYPT,
|
|
|
|
GST_STREAM_ERROR_DECRYPT_NOKEY,
|
2004-01-18 21:36:20 +00:00
|
|
|
GST_STREAM_ERROR_NUM_ERRORS
|
2005-01-04 18:13:51 +00:00
|
|
|
} GstStreamError;
|
2004-01-18 21:36:20 +00:00
|
|
|
|
2005-10-13 09:57:15 +00:00
|
|
|
/**
|
|
|
|
* GST_LIBRARY_ERROR:
|
|
|
|
*
|
|
|
|
* Error domain for library loading. Errors in this domain will
|
|
|
|
* be from the #GstLibraryError enumeration.
|
|
|
|
* See #GError for information on error domains.
|
|
|
|
*/
|
2004-03-09 14:44:36 +00:00
|
|
|
#define GST_LIBRARY_ERROR gst_library_error_quark ()
|
2005-10-13 09:57:15 +00:00
|
|
|
/**
|
|
|
|
* GST_RESOURCE_ERROR:
|
|
|
|
*
|
|
|
|
* Error domain for resource handling. Errors in this domain will
|
|
|
|
* be from the #GstResourceError enumeration.
|
|
|
|
* See #GError for information on error domains.
|
|
|
|
*/
|
2004-03-09 14:44:36 +00:00
|
|
|
#define GST_RESOURCE_ERROR gst_resource_error_quark ()
|
2005-10-13 09:57:15 +00:00
|
|
|
/**
|
|
|
|
* GST_CORE_ERROR:
|
|
|
|
*
|
|
|
|
* Error domain for core system. Errors in this domain will
|
|
|
|
* be from the #GstCoreError enumeration.
|
|
|
|
* See #GError for information on error domains.
|
|
|
|
*/
|
2004-03-09 14:44:36 +00:00
|
|
|
#define GST_CORE_ERROR gst_core_error_quark ()
|
2005-10-13 09:57:15 +00:00
|
|
|
/**
|
|
|
|
* GST_STREAM_ERROR:
|
|
|
|
*
|
|
|
|
* Error domain for media stream processing. Errors in this domain will
|
|
|
|
* be from the #GstStreamError enumeration.
|
|
|
|
* See #GError for information on error domains.
|
|
|
|
*/
|
2004-03-09 14:44:36 +00:00
|
|
|
#define GST_STREAM_ERROR gst_stream_error_quark ()
|
2004-01-18 21:36:20 +00:00
|
|
|
|
2005-08-31 14:08:45 +00:00
|
|
|
/**
|
|
|
|
* GST_ERROR_SYSTEM:
|
|
|
|
*
|
2005-11-21 14:50:22 +00:00
|
|
|
* Builds a string using errno describing the previously failed system
|
2005-11-18 18:55:24 +00:00
|
|
|
* call. To be used as the debug argument in #GST_ELEMENT_ERROR.
|
2005-08-31 14:08:45 +00:00
|
|
|
*/
|
2004-03-09 14:44:36 +00:00
|
|
|
#define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno))
|
2004-01-18 21:36:20 +00:00
|
|
|
|
2004-04-30 17:57:41 +00:00
|
|
|
gchar *gst_error_get_message (GQuark domain, gint code);
|
|
|
|
GQuark gst_stream_error_quark (void);
|
|
|
|
GQuark gst_core_error_quark (void);
|
|
|
|
GQuark gst_resource_error_quark (void);
|
|
|
|
GQuark gst_library_error_quark (void);
|
2004-01-18 21:36:20 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GST_ERROR_H__ */
|