diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-01-18 21:46:58 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-01-18 21:46:58 +0000 |
commit | b95a710d416f46a64f7b1251359b8031fbf0a30d (patch) | |
tree | 39b2a82db86699a71705ace479aa9e77c3badc3e /ext | |
parent | 1abf388f8522fcd540fcd6457d0034a5d31d14c7 (diff) |
use new error signal and classification
Original commit message from CVS:
use new error signal and classification
Diffstat (limited to 'ext')
-rw-r--r-- | ext/alsa/gstalsa.c | 8 | ||||
-rw-r--r-- | ext/alsa/gstalsasink.c | 4 | ||||
-rw-r--r-- | ext/alsa/gstalsasrc.c | 3 | ||||
-rw-r--r-- | ext/gnomevfs/gstgnomevfssink.c | 10 | ||||
-rw-r--r-- | ext/gnomevfs/gstgnomevfssrc.c | 24 | ||||
-rw-r--r-- | ext/ogg/gstoggdemux.c | 9 | ||||
-rw-r--r-- | ext/vorbis/vorbisenc.c | 2 | ||||
-rw-r--r-- | ext/vorbis/vorbisfile.c | 2 |
8 files changed, 36 insertions, 26 deletions
diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 6c092f8a6..60bb3fc65 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -658,7 +658,8 @@ gst_alsa_link (GstPad *pad, const GstCaps *caps) GstCaps *old = gst_alsa_caps (this->format->format, this->format->rate, this->format->channels); for (--i; i >= 0; i--) { if (gst_pad_try_set_caps (this->pad[i], old) == GST_PAD_LINK_REFUSED) { - gst_element_error (GST_ELEMENT (this), "error resetting caps to sane value"); + gst_element_error (this, CORE, NEGOTIATION, NULL, + ("could not reset caps to a sane value")); gst_caps_free (old); break; } else { @@ -679,7 +680,7 @@ gst_alsa_link (GstPad *pad, const GstCaps *caps) g_free (this->format); this->format = format; if (! gst_alsa_start_audio (this)) { - gst_element_error (GST_ELEMENT (this), "Probed format doesn't work"); + gst_element_error (this, RESOURCE, SETTINGS, NULL, NULL); return GST_PAD_LINK_REFUSED; } @@ -872,7 +873,8 @@ gst_alsa_xrun_recovery (GstAlsa *this) } if (!(gst_alsa_stop_audio (this) && gst_alsa_start_audio (this))) { - gst_element_error (GST_ELEMENT (this), "alsasink: Error restarting audio after xrun"); + gst_element_error (this, RESOURCE, FAILED, NULL, + ("Error restarting audio after xrun")); } } diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index 361ff0f05..d6160a71f 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -342,8 +342,8 @@ sink_restart: } /* caps nego failed somewhere */ if (this->format == NULL) { - gst_element_error (GST_ELEMENT (this), "alsasink: No caps available"); - return; + gst_element_error (this, CORE, NEGOTIATION, NULL, + ("ALSA format not negotiated")); } samplestamp = gst_alsa_timestamp_to_samples (this, GST_BUFFER_TIMESTAMP (sink->buf[i])); max_discont = gst_alsa_timestamp_to_samples (this, this->max_discont); diff --git a/ext/alsa/gstalsasrc.c b/ext/alsa/gstalsasrc.c index 4bd096a03..273ba9b2e 100644 --- a/ext/alsa/gstalsasrc.c +++ b/ext/alsa/gstalsasrc.c @@ -311,7 +311,8 @@ gst_alsa_src_loop (GstElement *element) /* set the caps on all pads */ if (!this->format) { if (!gst_alsa_src_set_caps (src, FALSE)) { - gst_element_error (element, "Could not set caps"); + gst_element_error (element, CORE, NEGOTIATION, NULL, + ("ALSA format not negotiated")); return; } } diff --git a/ext/gnomevfs/gstgnomevfssink.c b/ext/gnomevfs/gstgnomevfssink.c index f7b66b1a4..6e6ccea4d 100644 --- a/ext/gnomevfs/gstgnomevfssink.c +++ b/ext/gnomevfs/gstgnomevfssink.c @@ -27,6 +27,8 @@ #include "config.h" #endif +#include "gst-libs/gst/gst-i18n-plugin.h" + #include "gstgnomevfs.h" #include <gst/gst.h> @@ -280,7 +282,9 @@ gst_gnomevfssink_open_file (GstGnomeVFSSink *sink) gst_gnomevfssink_signals[SIGNAL_ERASE_ASK], 0, sink->erase); } - gst_element_error (GST_ELEMENT (sink), "opening file \"%s\" (%s)", sink->filename, strerror (errno)); + gst_element_error (sink, RESOURCE, OPEN_WRITE, + (_("Error opening vfs file \"%s\""), sink->filename), + GST_ERROR_SYSTEM); return FALSE; } } else @@ -303,7 +307,9 @@ gst_gnomevfssink_close_file (GstGnomeVFSSink *sink) result = gnome_vfs_close(sink->handle); if (result != GNOME_VFS_OK) - gst_element_error (GST_ELEMENT (sink), "closing file \"%s\" (%s)", sink->filename, strerror (errno)); + gst_element_error (sink, RESOURCE, CLOSE, + (_("Error closing file \"%s\""), sink->filename), + GST_ERROR_SYSTEM); } GST_FLAG_UNSET (sink, GST_GNOMEVFSSINK_OPEN); diff --git a/ext/gnomevfs/gstgnomevfssrc.c b/ext/gnomevfs/gstgnomevfssrc.c index c7fbecea5..a59a45f5c 100644 --- a/ext/gnomevfs/gstgnomevfssrc.c +++ b/ext/gnomevfs/gstgnomevfssrc.c @@ -30,6 +30,8 @@ #include "config.h" #endif +#include "gst-libs/gst/gst-i18n-plugin.h" + #include "gstgnomevfs.h" #include <sys/types.h> @@ -525,7 +527,8 @@ static int audiocast_init(GstGnomeVFSSrc *src) return TRUE; GST_DEBUG ("audiocast: registering listener"); if (audiocast_register_listener(&src->audiocast_port, &src->audiocast_fd) < 0) { - gst_element_error(GST_ELEMENT(src), "unable to register UDP port"); + gst_element_error (src, RESOURCE, OPEN_READ, NULL, + ("Unable to listen on UDP port %d", src->audiocast_port)); close(src->audiocast_fd); return FALSE; } @@ -541,8 +544,8 @@ static int audiocast_init(GstGnomeVFSSrc *src) GST_DEBUG ("audiocast: creating audiocast thread"); src->audiocast_thread = g_thread_create((GThreadFunc) audiocast_thread_run, src, TRUE, &error); if (error != NULL) { - gst_element_error(GST_ELEMENT(src), - "unable to create thread: %s", error->message); + gst_element_error (src, RESOURCE, TOO_LAZY, NULL, + ("Unable to create thread: %s", error->message)); close(src->audiocast_fd); return FALSE; } @@ -1048,8 +1051,8 @@ static gboolean gst_gnomevfssrc_open_file(GstGnomeVFSSrc *src) /* create the uri */ src->uri = gnome_vfs_uri_new(src->filename); if (!src->uri) { - gst_element_error(GST_ELEMENT(src), "creating uri \"%s\" (%s)", - src->filename, strerror (errno)); + gst_element_error (src, RESOURCE, OPEN_READ, + (_("Error opening URI \"%s\" for reading"), src->filename), GST_ERROR_SYSTEM); return FALSE; } } @@ -1066,19 +1069,18 @@ static gboolean gst_gnomevfssrc_open_file(GstGnomeVFSSrc *src) result = GNOME_VFS_OK; if (result != GNOME_VFS_OK) { char *escaped; - + gst_gnomevfssrc_pop_callbacks (src); audiocast_thread_kill(src); escaped = gnome_vfs_unescape_string_for_display (src->filename); - gst_element_error(GST_ELEMENT(src), - "opening vfs file \"%s\" (%s)", - escaped, - gnome_vfs_result_to_string(result)); + gst_element_error (src, RESOURCE, OPEN_READ, + (_("Error opening vfs file \"%s\""), escaped), + (gnome_vfs_result_to_string (result))); g_free (escaped); return FALSE; } - + info = gnome_vfs_file_info_new (); if (gnome_vfs_get_file_info_from_handle (src->handle, info, GNOME_VFS_FILE_INFO_DEFAULT) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 34e40cf65..a3bae8b78 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -313,7 +313,7 @@ gst_ogg_demux_chain (GstPad *pad, GstData *buffer) memcpy (data, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer)); if (ogg_sync_wrote (&ogg->sync, GST_BUFFER_SIZE (buffer)) != 0) { gst_data_unref (buffer); - gst_element_error (GST_ELEMENT (ogg), "ogg_sync_wrote failed"); + gst_element_error (ogg, LIBRARY, TOO_LAZY, NULL, ("ogg_sync_wrote failed")); return; } gst_data_unref (buffer); @@ -394,13 +394,13 @@ br: /* FIXME: monitor if we are still in creation stage? */ cur = gst_ogg_pad_new (ogg, ogg_page_serialno (page)); if (!cur) { - gst_element_error (GST_ELEMENT (ogg), "Creating ogg_stream struct failed."); + gst_element_error (ogg, LIBRARY, TOO_LAZY, NULL, ("Creating ogg_stream struct failed.")); } ogg->srcpads = g_slist_prepend (ogg->srcpads, cur); } } if (cur == NULL) { - gst_element_error (GST_ELEMENT (ogg), "invalid ogg stream serial no"); + gst_element_error (ogg, LIBRARY, TOO_LAZY, NULL, ("invalid ogg stream serial no")); return; } if (ogg_stream_pagein (&cur->stream, page) != 0) { @@ -438,8 +438,7 @@ gst_ogg_pad_push (GstOggDemux *ogg, GstOggPad *pad) gchar *name = g_strdup_printf ("serial %d", pad->serial); if (caps == NULL) { - gst_element_error (GST_ELEMENT (ogg), - "couldn't determine stream type from media"); + gst_element_error (ogg, STREAM, TYPE_NOT_FOUND, NULL, NULL); return; } pad->pad = gst_pad_new_from_template ( diff --git a/ext/vorbis/vorbisenc.c b/ext/vorbis/vorbisenc.c index 6ff6026cb..97c417358 100644 --- a/ext/vorbis/vorbisenc.c +++ b/ext/vorbis/vorbisenc.c @@ -783,7 +783,7 @@ gst_vorbisenc_chain (GstPad * pad, GstData *_data) if (!vorbisenc->setup) { gst_buffer_unref (buf); - gst_element_error (GST_ELEMENT (vorbisenc), "encoder not initialized (input is not audio?)"); + gst_element_error (vorbisenc, CORE, NEGOTIATION, NULL, ("encoder not initialized (input is not audio?)")); return; } diff --git a/ext/vorbis/vorbisfile.c b/ext/vorbis/vorbisfile.c index 5e3907ba2..97b6b8d48 100644 --- a/ext/vorbis/vorbisfile.c +++ b/ext/vorbis/vorbisfile.c @@ -550,7 +550,7 @@ gst_vorbisfile_loop (GstElement *element) /* open our custom vorbisfile data object with the callbacks we provide */ if (ov_open_callbacks (vorbisfile, &vorbisfile->vf, NULL, 0, vorbisfile_ov_callbacks) < 0) { - gst_element_error (element, "this is not a vorbis file"); + gst_element_error (element, STREAM, WRONG_TYPE, NULL, NULL); return; } vorbisfile->need_discont = TRUE; |