X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgsterror.h;h=9cb6d403557fd2af3cb42dbe88f9898cf36c0481;hb=e6bd5b41935f125bf43e030dcb909c3537d33b31;hp=d2bb65983576ebbdab8d6202b9f3f3c003545441;hpb=ca511598f43050595835e15b18b604cbdc85b079;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gsterror.h b/gst/gsterror.h index d2bb659..9cb6d40 100644 --- a/gst/gsterror.h +++ b/gst/gsterror.h @@ -13,8 +13,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GST_ERROR_H__ @@ -36,22 +36,27 @@ G_BEGIN_DECLS */ /** * GstCoreError: - * @GST_CORE_ERROR_FAILED: GStreamer encountered a general core library error. - * @GST_CORE_ERROR_TOO_LAZY: GStreamer developers were too lazy to assign an error code to this error. Please file a bug. - * @GST_CORE_ERROR_NOT_IMPLEMENTED: Internal GStreamer error: code not implemented. File a bug. - * @GST_CORE_ERROR_STATE_CHANGE: Internal GStreamer error: state change failed. File a bug. - * @GST_CORE_ERROR_PAD: Internal GStreamer error: pad problem. File a bug. - * @GST_CORE_ERROR_THREAD: Internal GStreamer error: thread problem. File a bug. - * @GST_CORE_ERROR_SCHEDULER: Internal GStreamer error: scheduler problem. File a bug. - * @GST_CORE_ERROR_NEGOTIATION: Internal GStreamer error: negotiation problem. File a bug. - * @GST_CORE_ERROR_EVENT: Internal GStreamer error: event problem. File a bug. - * @GST_CORE_ERROR_SEEK: Internal GStreamer error: seek problem. File a bug. - * @GST_CORE_ERROR_CAPS: Internal GStreamer error: caps problem. File a bug. - * @GST_CORE_ERROR_TAG: Internal GStreamer error: tag problem. File a bug. - * @GST_CORE_ERROR_NUM_ERRORS: the error count + * @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. + * @GST_CORE_ERROR_MISSING_PLUGIN: used if a plugin is missing. + * @GST_CORE_ERROR_CLOCK: used for clock related errors. + * @GST_CORE_ERROR_DISABLED: used if functionality has been disabled at + * compile time. + * @GST_CORE_ERROR_NUM_ERRORS: the number of core error types. * - * Core errors are anything that can go wrong in or using - * the core GStreamer library + * Core errors are errors inside the core GStreamer library. */ /* FIXME: should we divide in numerical blocks so we can easily add for example PAD errors later ? */ @@ -63,27 +68,31 @@ typedef enum GST_CORE_ERROR_STATE_CHANGE, GST_CORE_ERROR_PAD, GST_CORE_ERROR_THREAD, - GST_CORE_ERROR_SCHEDULER, GST_CORE_ERROR_NEGOTIATION, GST_CORE_ERROR_EVENT, GST_CORE_ERROR_SEEK, GST_CORE_ERROR_CAPS, GST_CORE_ERROR_TAG, + GST_CORE_ERROR_MISSING_PLUGIN, + GST_CORE_ERROR_CLOCK, + GST_CORE_ERROR_DISABLED, GST_CORE_ERROR_NUM_ERRORS } GstCoreError; /** * GstLibraryError: - * @GST_LIBRARY_ERROR_FAILED: GStreamer encountered a general supporting library error. - * @GST_LIBRARY_ERROR_TOO_LAZY: GStreamer developers were too lazy to assign an error code to this error. Please file a bug. - * @GST_LIBRARY_ERROR_INIT: Could not initialize supporting library. - * @GST_LIBRARY_ERROR_SHUTDOWN: Could not close supporting library. - * @GST_LIBRARY_ERROR_SETTINGS: Could not close supporting library. - * @GST_LIBRARY_ERROR_ENCODE: - * @GST_LIBRARY_ERROR_NUM_ERRORS: the error count + * @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. * * Library errors are for errors from the library being used by elements - * initializing, closing, ... + * (initializing, finalizing, settings, ...) */ typedef enum { @@ -98,24 +107,31 @@ typedef enum /** * GstResourceError: - * @GST_RESOURCE_ERROR_FAILED: GStreamer encountered a general resource error - * @GST_RESOURCE_ERROR_TOO_LAZY: GStreamer developers were too lazy to assign an error code to this error. Please file a bug. - * @GST_RESOURCE_ERROR_NOT_FOUND: Resource not found - * @GST_RESOURCE_ERROR_BUSY: Resource busy or not available - * @GST_RESOURCE_ERROR_OPEN_READ: Could not open resource for reading - * @GST_RESOURCE_ERROR_OPEN_WRITE: Could not open resource for writing - * @GST_RESOURCE_ERROR_OPEN_READ_WRITE: Could not open resource for reading and writing - * @GST_RESOURCE_ERROR_CLOSE: Could not close resource - * @GST_RESOURCE_ERROR_READ: Could not read from resource - * @GST_RESOURCE_ERROR_WRITE: Could not write to resource - * @GST_RESOURCE_ERROR_SEEK: Could not perform seek on resource - * @GST_RESOURCE_ERROR_SYNC: Could not synchronize on resource - * @GST_RESOURCE_ERROR_SETTINGS: Could not get/set settings from/on resource - * @GST_RESOURCE_ERROR_NUM_ERRORS: the error count + * @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. + * @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. + * @GST_RESOURCE_ERROR_NOT_AUTHORIZED: used when the resource can't be opened + * due to missing authorization. + * (Since: 1.2.4) + * @GST_RESOURCE_ERROR_NUM_ERRORS: the number of resource error types. * - * Resource errors are for anything external used by an element: + * Resource errors are for any resource used by an element: * memory, files, network connections, process space, ... - * They're typically used by source and sink elements + * They're typically used by source and sink elements. */ typedef enum { @@ -132,23 +148,36 @@ typedef enum GST_RESOURCE_ERROR_SEEK, GST_RESOURCE_ERROR_SYNC, GST_RESOURCE_ERROR_SETTINGS, + GST_RESOURCE_ERROR_NO_SPACE_LEFT, + GST_RESOURCE_ERROR_NOT_AUTHORIZED, GST_RESOURCE_ERROR_NUM_ERRORS } GstResourceError; /** * GstStreamError: - * @GST_STREAM_ERROR_FAILED: GStreamer encountered a general stream error - * @GST_STREAM_ERROR_TOO_LAZY: GStreamer developers were too lazy to assign an error code to this error. Please file a bug - * @GST_STREAM_ERROR_NOT_IMPLEMENTED: Element doesn't implement handling of this stream. Please file a bug. - * @GST_STREAM_ERROR_TYPE_NOT_FOUND: Could not determine type of stream - * @GST_STREAM_ERROR_WRONG_TYPE: The stream is of a different type than handled by this element - * @GST_STREAM_ERROR_CODEC_NOT_FOUND: There is no codec present that can handle the stream's type - * @GST_STREAM_ERROR_DECODE: Could not decode stream - * @GST_STREAM_ERROR_ENCODE: Could not encode stream - * @GST_STREAM_ERROR_DEMUX: Could not demultiplex stream - * @GST_STREAM_ERROR_MUX: Could not multiplex stream - * @GST_STREAM_ERROR_FORMAT: Stream is of the wrong format - * @GST_STREAM_ERROR_NUM_ERRORS: the error count + * @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). + * @GST_STREAM_ERROR_DECRYPT: used when the stream is encrypted and can't be + * decrypted because this is not supported by the element. + * @GST_STREAM_ERROR_DECRYPT_NOKEY: used when the stream is encrypted and + * can't be decrypted because no suitable key is available. + * @GST_STREAM_ERROR_NUM_ERRORS: the number of stream error types. * * Stream errors are for anything related to the stream being processed: * format errors, media type errors, ... @@ -167,24 +196,65 @@ typedef enum GST_STREAM_ERROR_DEMUX, GST_STREAM_ERROR_MUX, GST_STREAM_ERROR_FORMAT, + GST_STREAM_ERROR_DECRYPT, + GST_STREAM_ERROR_DECRYPT_NOKEY, GST_STREAM_ERROR_NUM_ERRORS } GstStreamError; -/* This should go away once we convinced glib people to register GError */ -#define GST_TYPE_G_ERROR (gst_g_error_get_type ()) - +/** + * 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. + */ #define GST_LIBRARY_ERROR gst_library_error_quark () +/** + * 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. + */ #define GST_RESOURCE_ERROR gst_resource_error_quark () +/** + * 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. + */ #define GST_CORE_ERROR gst_core_error_quark () +/** + * 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. + */ #define GST_STREAM_ERROR gst_stream_error_quark () +/** + * GST_ERROR_SYSTEM: (skip): + * + * Builds a string using errno describing the previously failed system + * call. To be used as the debug argument in #GST_ELEMENT_ERROR. + */ #define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno)) -GType gst_g_error_get_type (void); +GST_API gchar *gst_error_get_message (GQuark domain, gint code); + +GST_API GQuark gst_stream_error_quark (void); + +GST_API GQuark gst_core_error_quark (void); + +GST_API GQuark gst_resource_error_quark (void); + +GST_API GQuark gst_library_error_quark (void); G_END_DECLS