summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/audiofile/gstafsink.c29
-rw-r--r--ext/audiofile/gstafsrc.c21
-rw-r--r--ext/divx/gstdivxdec.c20
-rw-r--r--ext/faac/gstfaac.c12
-rw-r--r--ext/faad/gstfaad.c12
-rw-r--r--ext/ivorbis/vorbisfile.c8
-rw-r--r--ext/lcs/gstcolorspace.c2
-rw-r--r--ext/mpeg2enc/gstmpeg2enc.cc7
-rw-r--r--ext/mpeg2enc/gstmpeg2encpicturereader.cc3
-rw-r--r--ext/mplex/gstmplex.cc4
-rw-r--r--ext/mplex/gstmplexibitstream.cc6
-rw-r--r--ext/sdl/sdlvideosink.c29
-rw-r--r--ext/sndfile/gstsf.c35
-rw-r--r--ext/tarkin/gsttarkindec.c4
-rw-r--r--ext/tarkin/gsttarkinenc.c2
-rw-r--r--ext/xvid/gstxviddec.c16
-rw-r--r--ext/xvid/gstxvidenc.c12
17 files changed, 110 insertions, 112 deletions
diff --git a/ext/audiofile/gstafsink.c b/ext/audiofile/gstafsink.c
index 02e28f8b..4b4704cb 100644
--- a/ext/audiofile/gstafsink.c
+++ b/ext/audiofile/gstafsink.c
@@ -24,7 +24,13 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
+#include "gst-libs/gst/gst-i18n-plugin.h"
+
#include <gst/gst.h>
+#include <string.h>
+#include <errno.h>
+
#include "gstafsink.h"
/* elementfactory information */
@@ -32,7 +38,7 @@ static GstElementDetails afsink_details = {
"Audiofile Sink",
"Sink/Audio",
"Write audio streams to disk using libaudiofile",
- "Thomas <thomas@apestaart.org>",
+ "Thomas Vander Stichele <thomas@apestaart.org>",
};
@@ -288,16 +294,6 @@ gst_afsink_open_file (GstAFSink *sink)
g_return_val_if_fail (!GST_FLAG_IS_SET (sink, GST_AFSINK_OPEN), FALSE);
- /* open the file */
-/* we use audiofile now
- sink->file = fopen (sink->filename, "w");
- if (sink->file == NULL) {
- perror ("open");
- gst_element_error (GST_ELEMENT (sink), g_strconcat("opening file \"", sink->filename, "\"", NULL));
- return FALSE;
- }
-*/
-
/* get the audio parameters */
g_return_val_if_fail (GST_IS_PAD (sink->sinkpad), FALSE);
caps = GST_PAD_CAPS (sink->sinkpad);
@@ -345,8 +341,9 @@ gst_afsink_open_file (GstAFSink *sink)
sink->file = afOpenFile (sink->filename, "w", outfilesetup);
if (sink->file == AF_NULL_FILEHANDLE)
{
- perror ("open");
- gst_element_error (GST_ELEMENT (sink), g_strconcat("opening file \"", sink->filename, "\"", NULL));
+ gst_element_error (sink, RESOURCE, OPEN_WRITE,
+ (_("Could not open file \"%s\" for writing"), sink->filename),
+ ("system error: %s", strerror (errno)));
return FALSE;
}
@@ -367,9 +364,9 @@ gst_afsink_close_file (GstAFSink *sink)
/* if (fclose (sink->file) != 0) */
if (afCloseFile (sink->file) != 0)
{
- g_print ("WARNING: afsink: oops, error closing !\n");
- perror ("close");
- gst_element_error (GST_ELEMENT (sink), g_strconcat("closing file \"", sink->filename, "\"", NULL));
+ gst_element_error (sink, RESOURCE, CLOSE,
+ (_("Error closing file \"%s\""), sink->filename),
+ GST_ERROR_SYSTEM);
}
else {
GST_FLAG_UNSET (sink, GST_AFSINK_OPEN);
diff --git a/ext/audiofile/gstafsrc.c b/ext/audiofile/gstafsrc.c
index 7d477ab2..965021c0 100644
--- a/ext/audiofile/gstafsrc.c
+++ b/ext/audiofile/gstafsrc.c
@@ -24,8 +24,13 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
+#include "gst-libs/gst/gst-i18n-plugin.h"
#include <gst/gst.h>
#include <gst/audio/audio.h>
+#include <string.h>
+#include <errno.h>
+
#include "gstafsrc.h"
/* elementfactory information */
@@ -305,10 +310,9 @@ gst_afsrc_open_file (GstAFSrc *src)
src->file = afOpenFile (src->filename, "r", AF_NULL_FILESETUP);
if (src->file == AF_NULL_FILEHANDLE)
{
- g_print ("ERROR: gstafsrc: Could not open file %s for reading\n",
- src->filename);
- gst_element_error (GST_ELEMENT (src), g_strconcat ("opening file \"",
- src->filename, "\"", NULL));
+ gst_element_error (src, RESOURCE, OPEN_READ,
+ (_("Could not open file \"%s\" for reading"), src->filename),
+ ("system error: %s", strerror (errno)));
return FALSE;
}
@@ -364,11 +368,10 @@ gst_afsrc_close_file (GstAFSrc *src)
/* if (fclose (src->file) != 0) */
if (afCloseFile (src->file) != 0)
{
- g_print ("WARNING: afsrc: oops, error closing !\n");
- perror ("close");
- gst_element_error (GST_ELEMENT (src), g_strconcat("closing file \"", src->filename, "\"", NULL));
- }
- else {
+ gst_element_error (src, RESOURCE, CLOSE,
+ (_("Error closing file \"%s\""), src->filename),
+ GST_ERROR_SYSTEM);
+ } else {
GST_FLAG_UNSET (src, GST_AFSRC_OPEN);
}
}
diff --git a/ext/divx/gstdivxdec.c b/ext/divx/gstdivxdec.c
index 44134ecd..06b3dc33 100644
--- a/ext/divx/gstdivxdec.c
+++ b/ext/divx/gstdivxdec.c
@@ -215,9 +215,8 @@ gst_divxdec_setup (GstDivxDec *divxdec)
xinit.smooth_playback = 0;
xinit.codec_version = 500;
if ((ret = decore(&handle, DEC_OPT_INIT, &xinit, NULL)) != 0) {
- gst_element_error(GST_ELEMENT(divxdec),
- "Error initializing divx decoding library: %s (%d)",
- gst_divxdec_error(ret), ret);
+ gst_element_error (divxdec, LIBRARY, INIT, NULL,
+ ("divx library error: %s (%d)", gst_divxdec_error (ret), ret));
return FALSE;
}
@@ -234,9 +233,8 @@ gst_divxdec_setup (GstDivxDec *divxdec)
if ((ret = decore(divxdec->handle, DEC_OPT_SETOUT,
&output, NULL)) != 0) {
- gst_element_error(GST_ELEMENT(divxdec),
- "Error setting output format: %s (%d)",
- gst_divxdec_error(ret), ret);
+ gst_element_error (divxdec, LIBRARY, SETTINGS, NULL,
+ ("error setting output: %s (%d)", gst_divxdec_error (ret)), ret);
gst_divxdec_unset(divxdec);
return FALSE;
}
@@ -272,8 +270,8 @@ gst_divxdec_chain (GstPad *pad,
if (!divxdec->handle) {
if (gst_divxdec_negotiate(divxdec) <= 0) {
- gst_element_error(GST_ELEMENT(divxdec),
- "No format set - aborting");
+ gst_element_error (divxdec, CORE, TOO_LAZY,
+ ("No format set - aborting"));
gst_buffer_unref(buf);
return;
}
@@ -296,9 +294,9 @@ gst_divxdec_chain (GstPad *pad,
if ((ret = decore(divxdec->handle, DEC_OPT_FRAME,
&xframe, NULL))) {
- gst_element_error(GST_ELEMENT(divxdec),
- "Error decoding divx frame: %s (%d)",
- gst_divxdec_error(ret), ret);
+ gst_element_error (divxdec, STREAM, DECODE, NULL,
+ ("Error decoding divx frame: %s (%d)",
+ gst_divxdec_error(ret), ret));
gst_buffer_unref(buf);
return;
}
diff --git a/ext/faac/gstfaac.c b/ext/faac/gstfaac.c
index 182d094e..f84acb6f 100644
--- a/ext/faac/gstfaac.c
+++ b/ext/faac/gstfaac.c
@@ -417,7 +417,7 @@ gst_faac_chain (GstPad *pad,
NULL, 0,
GST_BUFFER_DATA (outbuf),
faac->bytes)) < 0) {
- gst_element_error (GST_ELEMENT (faac), "Error during AAC encoding");
+ gst_element_error (faac, LIBRARY, ENCODE, NULL, NULL);
gst_event_unref (event);
gst_buffer_unref (outbuf);
return;
@@ -445,8 +445,8 @@ gst_faac_chain (GstPad *pad,
inbuf = GST_BUFFER (data);
if (!faac->handle) {
- gst_element_error (GST_ELEMENT (faac),
- "No input format negotiated");
+ gst_element_error (faac, CORE, NEGOTIATION, NULL,
+ ("format wasn't negotiated before chain function"));
gst_buffer_unref (inbuf);
return;
}
@@ -454,8 +454,8 @@ gst_faac_chain (GstPad *pad,
if (!GST_PAD_CAPS (faac->srcpad)) {
if (gst_faac_srcconnect (faac->srcpad,
gst_pad_get_allowed_caps (faac->srcpad)) <= 0) {
- gst_element_error (GST_ELEMENT (faac),
- "Failed to negotiate MPEG/AAC format with next element");
+ gst_element_error (faac, CORE, NEGOTIATION, NULL,
+ ("failed to negotiate MPEG/AAC format with next element"));
gst_buffer_unref (inbuf);
return;
}
@@ -516,7 +516,7 @@ gst_faac_chain (GstPad *pad,
GST_BUFFER_SIZE (subbuf) / faac->bps,
GST_BUFFER_DATA (outbuf),
faac->bytes)) < 0) {
- gst_element_error (GST_ELEMENT (faac), "Error during AAC encoding");
+ gst_element_error (faac, LIBRARY, ENCODE, NULL, NULL);
gst_buffer_unref (inbuf);
gst_buffer_unref (subbuf);
return;
diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c
index 8db89aaf..67bcdddb 100644
--- a/ext/faad/gstfaad.c
+++ b/ext/faad/gstfaad.c
@@ -359,8 +359,7 @@ gst_faad_chain (GstPad *pad,
faad->channels = channels;
if (gst_faad_srcconnect (faad->srcpad,
gst_pad_get_allowed_caps (faad->srcpad)) <= 0) {
- gst_element_error (GST_ELEMENT (faad),
- "Failed to negotiate output format with next element");
+ gst_element_error (faad, CORE, NEGOTIATION, NULL, NULL);
gst_buffer_unref (buf);
return;
}
@@ -369,9 +368,9 @@ gst_faad_chain (GstPad *pad,
out = faacDecDecode (faad->handle, &info,
GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
if (info.error) {
- gst_element_error (GST_ELEMENT (faad),
- "Failed to decode buffer: %s",
- faacDecGetErrorMessage (info.error));
+ gst_element_error (faad, STREAM, DECODE, NULL,
+ ("Failed to decode buffer: %s",
+ faacDecGetErrorMessage (info.error)));
gst_buffer_unref (buf);
return;
}
@@ -382,8 +381,7 @@ gst_faad_chain (GstPad *pad,
faad->channels = info.channels;
if (gst_faad_srcconnect (faad->srcpad,
gst_pad_get_allowed_caps (faad->srcpad)) <= 0) {
- gst_element_error (GST_ELEMENT (faad),
- "Failed to re-negotiate format with next element");
+ gst_element_error (faad, CORE, NEGOTIATION, NULL, NULL);
gst_buffer_unref (buf);
return;
}
diff --git a/ext/ivorbis/vorbisfile.c b/ext/ivorbis/vorbisfile.c
index 548405a4..4f708aa0 100644
--- a/ext/ivorbis/vorbisfile.c
+++ b/ext/ivorbis/vorbisfile.c
@@ -561,15 +561,15 @@ gst_ivorbisfile_loop (GstElement *element)
ivorbisfile->offset = 0;
ivorbisfile->total_bytes = 0;
ivorbisfile->may_eos = FALSE;
- ivorbisfile->vf.seekable = gst_bytestream_seek (ivorbisfile->bs, 0,
+ ivorbisfile->vf.seekable = gst_bytestream_seek (ivorbisfile->bs, 0,
GST_SEEK_METHOD_SET);
GST_DEBUG ("ivorbisfile: seekable: %s\n",
ivorbisfile->vf.seekable ? "yes" : "no");
/* open our custom ivorbisfile data object with the callbacks we provide */
- if (ov_open_callbacks (ivorbisfile, &ivorbisfile->vf, NULL, 0,
+ if (ov_open_callbacks (ivorbisfile, &ivorbisfile->vf, NULL, 0,
ivorbisfile_ov_callbacks) < 0) {
- gst_element_error (element, "this is not a vorbis file");
+ gst_element_error (element, STREAM, DECODE, NULL, NULL);
return;
}
ivorbisfile->need_discont = TRUE;
@@ -633,7 +633,7 @@ gst_ivorbisfile_loop (GstElement *element)
/* we update the caps for each logical stream */
if (ivorbisfile->vf.current_link != ivorbisfile->current_link) {
if (!gst_ivorbisfile_new_link (ivorbisfile, ivorbisfile->vf.current_link)) {
- gst_element_error (GST_ELEMENT (ivorbisfile), "could not negotiate format");
+ gst_element_error (ivorbisfile, CORE, NEGOTIATION, NULL, NULL);
}
return;
}
diff --git a/ext/lcs/gstcolorspace.c b/ext/lcs/gstcolorspace.c
index bc153ac3..20edef6f 100644
--- a/ext/lcs/gstcolorspace.c
+++ b/ext/lcs/gstcolorspace.c
@@ -316,7 +316,7 @@ gst_colorspace_srcconnect_func (GstPad *pad, GstCaps *caps, gboolean newcaps)
peercaps = peercaps->next;
}
- //gst_element_error (GST_ELEMENT (space), "could not agree on caps with peer pads");
+ gst_element_error (space, CORE, NEGOTIATION, NULL, NULL);
/* we disable ourself here */
space->disabled = TRUE;
diff --git a/ext/mpeg2enc/gstmpeg2enc.cc b/ext/mpeg2enc/gstmpeg2enc.cc
index e3af35bb..039fa227 100644
--- a/ext/mpeg2enc/gstmpeg2enc.cc
+++ b/ext/mpeg2enc/gstmpeg2enc.cc
@@ -239,8 +239,8 @@ gst_mpeg2enc_loop (GstElement *element)
gst_pad_set_element_private (enc->sinkpad, data);
if (!(caps = GST_PAD_CAPS (enc->sinkpad))) {
- gst_element_error (element,
- "No format given by previous element");
+ gst_element_error (element, CORE, NEGOTIATION, NULL,
+ ("format wasn't negotiated before loop function"));
return;
}
@@ -251,8 +251,7 @@ gst_mpeg2enc_loop (GstElement *element)
/* and set caps on other side */
othercaps = enc->encoder->getFormat ();
if (gst_pad_set_explicit_caps (enc->srcpad, othercaps) <= 0) {
- gst_element_error (element,
- "Failed to set up encoder properly");
+ gst_element_error (element, CORE, NEGOTIATION, NULL, NULL);
delete enc->encoder;
enc->encoder = NULL;
return;
diff --git a/ext/mpeg2enc/gstmpeg2encpicturereader.cc b/ext/mpeg2enc/gstmpeg2encpicturereader.cc
index 57e4110b..10c1f4bc 100644
--- a/ext/mpeg2enc/gstmpeg2encpicturereader.cc
+++ b/ext/mpeg2enc/gstmpeg2encpicturereader.cc
@@ -98,8 +98,7 @@ GstMpeg2EncPictureReader::LoadFrame ()
if ((data = (GstData *) gst_pad_get_element_private (pad))) {
gst_pad_set_element_private (pad, NULL);
} else if (!(data = gst_pad_pull (pad))) {
- gst_element_error (gst_pad_get_parent (pad),
- "Failed to read data");
+ gst_element_error (gst_pad_get_parent (pad), RESOURCE, READ, NULL, NULL);
return true;
}
diff --git a/ext/mplex/gstmplex.cc b/ext/mplex/gstmplex.cc
index 66638b84..0eb87779 100644
--- a/ext/mplex/gstmplex.cc
+++ b/ext/mplex/gstmplex.cc
@@ -279,8 +279,8 @@ gst_mplex_loop (GstElement *element)
}
if (!mplex->job->video_tracks && !mplex->job->audio_tracks) {
- gst_element_error (element,
- "No input stream set-up");
+ gst_element_error (element, CORE, NEGOTIATION, NULL,
+ ("no input video or audio tracks set up before loop function"));
return;
}
diff --git a/ext/mplex/gstmplexibitstream.cc b/ext/mplex/gstmplexibitstream.cc
index 59f913a6..21e1892e 100644
--- a/ext/mplex/gstmplexibitstream.cc
+++ b/ext/mplex/gstmplexibitstream.cc
@@ -53,9 +53,9 @@ GstMplexIBitStream::GstMplexIBitStream (GstPad *_pad,
gst_bytestream_peek_bytes (bs, &data, 1);
if (!ReadIntoBuffer () && buffered == 0) {
- gst_element_error (gst_pad_get_parent (_pad),
- "Failed to read from input stream %s",
- gst_pad_get_name (pad));
+ gst_element_error (gst_pad_get_parent (_pad), RESOURCE, READ, NULL,
+ ("Failed to read from input pad %s",
+ gst_pad_get_name (pad)));
}
}
diff --git a/ext/sdl/sdlvideosink.c b/ext/sdl/sdlvideosink.c
index a5fa4704..040d9ed1 100644
--- a/ext/sdl/sdlvideosink.c
+++ b/ext/sdl/sdlvideosink.c
@@ -366,8 +366,8 @@ gst_sdlvideosink_lock (GstSDLVideoSink *sdlvideosink)
{
/* assure that we've got a screen */
if (!sdlvideosink->screen || !sdlvideosink->overlay) {
- gst_element_error (GST_ELEMENT (sdlvideosink),
- "Tried to lock screen without being set-up");
+ gst_element_error (sdlvideosink, LIBRARY, TOO_LAZY, NULL,
+ ("Tried to lock screen without being set-up"));
return FALSE;
}
@@ -376,15 +376,15 @@ gst_sdlvideosink_lock (GstSDLVideoSink *sdlvideosink)
{
if (SDL_LockSurface(sdlvideosink->screen) < 0)
{
- gst_element_error(GST_ELEMENT(sdlvideosink),
- "SDL: couldn\'t lock the SDL video window: %s", SDL_GetError());
+ gst_element_error (sdlvideosink, LIBRARY, TOO_LAZY, NULL,
+ ("SDL: couldn't lock the SDL video window: %s", SDL_GetError()));
return FALSE;
}
}
if (SDL_LockYUVOverlay(sdlvideosink->overlay) < 0)
{
- gst_element_error(GST_ELEMENT(sdlvideosink),
- "SDL: couldn\'t lock the SDL YUV overlay: %s", SDL_GetError());
+ gst_element_error (sdlvideosink, LIBRARY, TOO_LAZY, NULL,
+ ("SDL: couldn\'t lock the SDL YUV overlay: %s", SDL_GetError()));
return FALSE;
}
@@ -427,9 +427,8 @@ gst_sdlvideosink_initsdl (GstSDLVideoSink *sdlvideosink)
/* Initialize the SDL library */
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0 ) {
- gst_element_error(GST_ELEMENT (sdlvideosink),
- "Couldn't initialize SDL: %s",
- SDL_GetError());
+ gst_element_error (sdlvideosink, LIBRARY, INIT, NULL,
+ ("Couldn't initialize SDL: %s", SDL_GetError()));
return FALSE;
}
@@ -465,9 +464,9 @@ gst_sdlvideosink_create (GstSDLVideoSink *sdlvideosink)
GST_VIDEOSINK_HEIGHT (sdlvideosink), 0, SDL_HWSURFACE | SDL_RESIZABLE);
if (sdlvideosink->screen == NULL)
{
- gst_element_error(GST_ELEMENT(sdlvideosink),
- "SDL: Couldn't set %dx%d: %s", GST_VIDEOSINK_WIDTH (sdlvideosink),
- GST_VIDEOSINK_HEIGHT (sdlvideosink), SDL_GetError());
+ gst_element_error (sdlvideosink, LIBRARY, TOO_LAZY, NULL,
+ ("SDL: Couldn't set %dx%d: %s", GST_VIDEOSINK_WIDTH (sdlvideosink),
+ GST_VIDEOSINK_HEIGHT (sdlvideosink), SDL_GetError()));
return FALSE;
}
@@ -476,10 +475,10 @@ gst_sdlvideosink_create (GstSDLVideoSink *sdlvideosink)
sdlvideosink->height, sdlvideosink->format, sdlvideosink->screen);
if ( sdlvideosink->overlay == NULL )
{
- gst_element_error(GST_ELEMENT(sdlvideosink),
- "SDL: Couldn't create SDL YUV overlay (%dx%d \'" GST_FOURCC_FORMAT "\'): %s",
+ gst_element_error (sdlvideosink, LIBRARY, TOO_LAZY, NULL,
+ ("SDL: Couldn't create SDL YUV overlay (%dx%d \'" GST_FOURCC_FORMAT "\'): %s",
sdlvideosink->width, sdlvideosink->height,
- GST_FOURCC_ARGS(sdlvideosink->format), SDL_GetError());
+ GST_FOURCC_ARGS(sdlvideosink->format), SDL_GetError()));
return FALSE;
}
else
diff --git a/ext/sndfile/gstsf.c b/ext/sndfile/gstsf.c
index 6b185b8b..f276cfd2 100644
--- a/ext/sndfile/gstsf.c
+++ b/ext/sndfile/gstsf.c
@@ -22,6 +22,7 @@
#include "config.h"
#endif
+#include "gst-libs/gst/gst-i18n-plugin.h"
#include <string.h>
#include <gst/gst.h>
@@ -558,7 +559,9 @@ gst_sf_open_file (GstSF *this)
this->time = 0;
if (!this->filename) {
- gst_element_error (GST_ELEMENT (this), "sndfile: 'location' was not set");
+ gst_element_error (this, RESOURCE, NOT_FOUND,
+ (_("No filename specified")),
+ NULL);
return FALSE;
}
@@ -584,8 +587,8 @@ gst_sf_open_file (GstSF *this)
this->filename, info.samplerate, info.channels, info.format);
if (!sf_format_check (&info)) {
- gst_element_error (GST_ELEMENT (this),
- g_strdup_printf ("Input parameters (rate:%d, channels:%d, format:0x%x) invalid",
+ gst_element_error (this, STREAM, ENCODE, NULL,
+ ("Input parameters (rate:%d, channels:%d, format:0x%x) invalid",
info.samplerate, info.channels, info.format));
return FALSE;
}
@@ -594,9 +597,9 @@ gst_sf_open_file (GstSF *this)
this->file = sf_open (this->filename, mode, &info);
if (!this->file) {
- gst_element_error (GST_ELEMENT (this),
- g_strdup_printf ("could not open file \"%s\": %s",
- this->filename, sf_strerror (NULL)));
+ gst_element_error (this, RESOURCE, OPEN_WRITE,
+ (_("Could not open file \"%s\" for writing"), this->filename),
+ ("soundfile error: %s", sf_strerror (NULL)));
return FALSE;
}
@@ -633,9 +636,9 @@ gst_sf_close_file (GstSF *this)
INFO_OBJ (this, "Closing file %s", this->filename);
if ((err = sf_close (this->file)))
- gst_element_error (GST_ELEMENT (this),
- g_strdup_printf ("sndfile: could not close file \"%s\": %s",
- this->filename, sf_error_number (err)));
+ gst_element_error (this, RESOURCE, CLOSE,
+ ("Could not close file file \"%s\"", this->filename),
+ ("soundfile error: %s", strerror (err)));
else
GST_FLAG_UNSET (this, GST_SF_OPEN);
@@ -654,7 +657,7 @@ gst_sf_loop (GstElement *element)
this = (GstSF*)element;
if (this->channels == NULL) {
- gst_element_error (element, "You must connect at least one pad to sndfile elements.");
+ gst_element_error (element, CORE, PAD, NULL, ("You must connect at least one pad to sndfile elements."));
return;
}
@@ -704,9 +707,8 @@ gst_sf_loop (GstElement *element)
"buffer-frames", G_TYPE_INT, this->buffer_frames,
NULL);
if (!gst_pad_try_set_caps (GST_SF_CHANNEL (l)->pad, caps)) {
- gst_element_error (GST_ELEMENT (this),
- g_strdup_printf ("Opened file with sample rate %d, but could not set caps",
- this->rate));
+ gst_element_error (this, CORE, NEGOTIATION, NULL,
+ ("Opened file with sample rate %d, but could not set caps", this->rate));
gst_sf_close_file (this);
return;
}
@@ -761,7 +763,8 @@ gst_sf_loop (GstElement *element)
which then would set this->buffer_frames to a new value */
buffer_frames = this->buffer_frames;
if (buffer_frames == 0) {
- gst_element_error (element, "Caps were never set, bailing...");
+ gst_element_error (element, CORE, NEGOTIATION, NULL,
+ ("format wasn't negotiated before chain function"));
return;
}
buf = this->buffer;
@@ -786,7 +789,9 @@ gst_sf_loop (GstElement *element)
if (num_to_write) {
written = sf_writef_float (this->file, buf, num_to_write);
if (written != num_to_write)
- gst_element_error (element, "Error writing file: %s", sf_strerror (this->file));
+ gst_element_error (element, RESOURCE, WRITE,
+ (_("Error while writing to file \"%s\""), this->filename),
+ ("soundfile error: %s", sf_strerror (this->file)));
}
this->time += num_to_write * (GST_SECOND / this->rate);
diff --git a/ext/tarkin/gsttarkindec.c b/ext/tarkin/gsttarkindec.c
index a87bb9a3..a2c27e9f 100644
--- a/ext/tarkin/gsttarkindec.c
+++ b/ext/tarkin/gsttarkindec.c
@@ -209,7 +209,7 @@ gst_tarkindec_chain (GstPad *pad, GstData *_data)
tarkindec = GST_TARKINDEC (gst_pad_get_parent (pad));
if (!tarkindec->setup) {
- gst_element_error (GST_ELEMENT (tarkindec), "decoder not initialized (input is not audio?)");
+ gst_element_error (tarkindec, CORE, NEGOTATION, NULL, ("decoder not initialized (input is not tarkin?)"));
if (GST_IS_BUFFER (buf))
gst_buffer_unref (buf);
else
@@ -278,7 +278,7 @@ gst_tarkindec_chain (GstPad *pad, GstData *_data)
"framerate", GST_PROPS_FLOAT (0.) /* FIXME!!! */
)) <= 0)
{
- gst_element_error (GST_ELEMENT (tarkindec), "could not output format");
+ gst_element_error (tarkindec, CORE, NEGOTATION, NULL, ("could not output format"));
gst_buffer_unref (buf);
return;
}
diff --git a/ext/tarkin/gsttarkinenc.c b/ext/tarkin/gsttarkinenc.c
index 5c918a4e..b58e1ab6 100644
--- a/ext/tarkin/gsttarkinenc.c
+++ b/ext/tarkin/gsttarkinenc.c
@@ -319,7 +319,7 @@ gst_tarkinenc_chain (GstPad *pad, GstData *_data)
tarkinenc = GST_TARKINENC (gst_pad_get_parent (pad));
if (!tarkinenc->setup) {
- gst_element_error (GST_ELEMENT (tarkinenc), "encoder not initialized (input is not audio?)");
+ gst_element_error (tarkinenc, CORE, NEGOTIATION, NULL, ("encoder not initialized (input is not tarkin?)"));
if (GST_IS_BUFFER (buf))
gst_buffer_unref (buf);
else
diff --git a/ext/xvid/gstxviddec.c b/ext/xvid/gstxviddec.c
index e57489a6..68b21d7d 100644
--- a/ext/xvid/gstxviddec.c
+++ b/ext/xvid/gstxviddec.c
@@ -201,10 +201,10 @@ gst_xviddec_setup (GstXvidDec *xviddec)
if ((ret = xvid_decore(NULL, XVID_DEC_CREATE,
&xdec, NULL)) < 0) {
- gst_element_error(GST_ELEMENT(xviddec),
- "Setting parameters %dx%d@%d failed: %s (%d)",
+ gst_element_error (xviddec, LIBRARY, SETTINGS, NULL,
+ ("Setting parameters %dx%d@%d failed: %s (%d)",
xviddec->width, xviddec->height, xviddec->csp,
- gst_xvid_error(ret), ret);
+ gst_xvid_error(ret), ret));
return FALSE;
}
@@ -228,8 +228,8 @@ gst_xviddec_chain (GstPad *pad,
g_return_if_fail(GST_IS_PAD(pad));
if (!xviddec->handle) {
- gst_element_error(GST_ELEMENT(xviddec),
- "No format set - aborting");
+ gst_element_error (xviddec, CORE, NEGOTIATION, NULL,
+ ("format wasn't negotiated before chain function"));
gst_buffer_unref(buf);
return;
}
@@ -263,9 +263,9 @@ gst_xviddec_chain (GstPad *pad,
if ((ret = xvid_decore(xviddec->handle, XVID_DEC_DECODE,
&xframe, NULL)) < 0) {
- gst_element_error(GST_ELEMENT(xviddec),
- "Error decoding xvid frame: %s (%d)\n",
- gst_xvid_error(ret), ret);
+ gst_element_error (xviddec, STREAM, DECODE, NULL,
+ ("Error decoding xvid frame: %s (%d)\n",
+ gst_xvid_error(ret), ret));
gst_buffer_unref(buf);
gst_buffer_unref(outbuf);
return;
diff --git a/ext/xvid/gstxvidenc.c b/ext/xvid/gstxvidenc.c
index 9945f125..1b9de2f5 100644
--- a/ext/xvid/gstxvidenc.c
+++ b/ext/xvid/gstxvidenc.c
@@ -299,9 +299,9 @@ gst_xvidenc_setup (GstXvidEnc *xvidenc)
if ((ret = xvid_encore(NULL, XVID_ENC_CREATE,
&xenc, NULL)) < 0) {
- gst_element_error(GST_ELEMENT(xvidenc),
- "Error setting up xvid encoder: %s (%d)",
- gst_xvid_error(ret), ret);
+ gst_element_error (xvidenc, LIBRARY, INIT, NULL,
+ ("Error setting up xvid encoder: %s (%d)",
+ gst_xvid_error(ret), ret));
return FALSE;
}
@@ -355,9 +355,9 @@ gst_xvidenc_chain (GstPad *pad,
if ((ret = xvid_encore(xvidenc->handle, XVID_ENC_ENCODE,
&xframe, &xstats)) < 0) {
- gst_element_error(GST_ELEMENT(xvidenc),
- "Error encoding xvid frame: %s (%d)",
- gst_xvid_error(ret), ret);
+ gst_element_error (xvidenc, LIBRARY, ENCODE, NULL,
+ ("Error encoding xvid frame: %s (%d)",
+ gst_xvid_error(ret), ret));
gst_buffer_unref(buf);
gst_buffer_unref(outbuf);
return;