Blame gst/gsterror.h

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