From: Benjamin O. <co...@us...> - 2003-09-15 00:35:28
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: company Date: Sun Sep 14 2003 17:35:26 PDT Log message: converted gst_element_error to new format in gst/ - gettext pending Modified files: gst/ac3parse : gstac3parse.c gst/adder : gstadder.c gst/asfdemux : gstasfdemux.c gst/audioconvert: gstaudioconvert.c gst/auparse : gstauparse.c gst/avi : gstavidemux.c gstavimux.c gst/chart : gstchart.c gst/flx : gstflxdec.c gst/goom : gstgoom.c gst/intfloat : gstfloat2int.c gstint2float.c gst/modplug : gstmodplug.cc gst/monoscope : gstmonoscope.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/ac3parse/gstac3parse.c.diff?r1=1.12&r2=1.13 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/adder/gstadder.c.diff?r1=1.32&r2=1.33 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/asfdemux/gstasfdemux.c.diff?r1=1.19&r2=1.20 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/audioconvert/gstaudioconvert.c.diff?r1=1.10&r2=1.11 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/auparse/gstauparse.c.diff?r1=1.17&r2=1.18 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/avi/gstavidemux.c.diff?r1=1.76&r2=1.77 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/avi/gstavimux.c.diff?r1=1.44&r2=1.45 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/chart/gstchart.c.diff?r1=1.15&r2=1.16 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/flx/gstflxdec.c.diff?r1=1.24&r2=1.25 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/goom/gstgoom.c.diff?r1=1.19&r2=1.20 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/intfloat/gstfloat2int.c.diff?r1=1.40&r2=1.41 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/intfloat/gstint2float.c.diff?r1=1.30&r2=1.31 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/modplug/gstmodplug.cc.diff?r1=1.28&r2=1.29 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/monoscope/gstmonoscope.c.diff?r1=1.14&r2=1.15 ====Begin Diffs==== Index: gstac3parse.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/ac3parse/gstac3parse.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- gstac3parse.c 6 Jul 2003 20:49:29 -0000 1.12 +++ gstac3parse.c 15 Sep 2003 00:34:43 -0000 1.13 @@ -337,8 +337,9 @@ "channels", GST_PROPS_INT (channels), "rate", GST_PROPS_INT (sample_rate)); if (gst_pad_try_set_caps (ac3parse->srcpad, newcaps) <= 0) { - gst_element_error (GST_ELEMENT (ac3parse), - "Ac3parse: failed to negotiate format with next element"); + gst_element_gerror(GST_ELEMENT (ac3parse), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf ("Ac3parse: failed to negotiate format with next element")); return; } } Index: gstadder.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/adder/gstadder.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- gstadder.c 19 Jul 2003 23:16:25 -0000 1.32 +++ gstadder.c 15 Sep 2003 00:34:44 -0000 1.33 @@ -149,29 +149,38 @@ /* provide an error message if we can't link */ if (adder->format != GST_ADDER_FORMAT_INT) { - gst_element_error (el, "can't link a non-int pad to an int adder"); + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("can't link a non-int pad to an int adder")); return FALSE; } if (adder->channels != channels) { - gst_element_error (el, - "can't link %d-channel pad with %d-channel adder", - channels, adder->channels); + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf( "can't link %d-channel pad with %d-channel adder", + channels, adder->channels)); return FALSE; } if (adder->rate != rate) { - gst_element_error (el, "can't link %d Hz pad with %d Hz adder", - rate, adder->rate); + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf ("can't link %d Hz pad with %d Hz adder", + rate, adder->rate)); return FALSE; } if (adder->width != width) { - gst_element_error (el, "can't link %d-bit pad with %d-bit adder", - width, adder->width); + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf ("can't link %d-bit pad with %d-bit adder", + width, adder->width)); return FALSE; } if (adder->is_signed != is_signed) { - gst_element_error (el, "can't link %ssigned pad with %ssigned adder", + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf ("can't link %ssigned pad with %ssigned adder", adder->is_signed ? "" : "un", - is_signed ? "" : "un"); + is_signed ? "" : "un")); return FALSE; } } else if (strcmp (mimetype, "audio/x-raw-float") == 0) { @@ -182,23 +191,30 @@ gst_caps_get_int (caps, "rate", &rate); if (adder->format != GST_ADDER_FORMAT_FLOAT) { - gst_element_error (el, "can't link a non-float pad to a float adder"); + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("can't link a non-float pad to a float adder")); return FALSE; } if (adder->channels != channels) { - gst_element_error (el, - "can't link %d-channel pad with %d-channel adder", - channels, adder->channels); + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf ("can't link %d-channel pad with %d-channel adder", + channels, adder->channels)); return FALSE; } if (adder->rate != rate) { - gst_element_error (el, "can't link %d Hz pad with %d Hz adder", - rate, adder->rate); + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf( "can't link %d Hz pad with %d Hz adder", + rate, adder->rate)); return FALSE; } if (adder->width != width) { - gst_element_error (el, "can't link %d bit float pad with %d bit adder", - width, adder->width); + gst_element_gerror(el, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf( "can't link %d bit float pad with %d bit adder", + width, adder->width)); return FALSE; } } @@ -407,7 +423,9 @@ buf_out = gst_buffer_new_from_pool (adder->bufpool, 0, 0); if (buf_out == NULL) { - gst_element_error (GST_ELEMENT (adder), "could not get new output buffer"); + gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("could not get new output buffer")); return; } @@ -495,9 +513,10 @@ for (i = 0; i < GST_BUFFER_SIZE (buf_out); i++) out[i] = CLAMP(out[i] + in[i], 0x80, 0x7f); } else { - gst_element_error (GST_ELEMENT (adder), - "invalid width (%u) for integer audio in gstadder", - adder->width); + gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf ("invalid width (%u) for integer audio in gstadder", + adder->width)); return; } } else if (adder->format == GST_ADDER_FORMAT_FLOAT) { @@ -512,15 +531,17 @@ for (i = 0; i < GST_BUFFER_SIZE (buf_out) / sizeof (gfloat); i++) out[i] = CLAMP(out[i] + in[i], -1.0, 1.0); } else { - gst_element_error (GST_ELEMENT (adder), - "invalid width (%u) for float audio in gstadder", - adder->width); + gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf ("invalid width (%u) for float audio in gstadder", + adder->width)); return; } } else { - gst_element_error (GST_ELEMENT (adder), - "invalid audio format (%d) in gstadder", - adder->format); + gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("invalid audio format (%d) in gstadder", + adder->format)); return; } @@ -537,9 +558,9 @@ GST_AUDIO_INT_PAD_TEMPLATE_PROPS); if (gst_pad_try_set_caps (adder->srcpad, caps) < 0) { - gst_element_error (GST_ELEMENT (adder), - "Couldn't set the default caps, " - "use link_filtered instead"); + gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup ("Couldn't set the default caps, use link_filtered instead")); return; } Index: gstasfdemux.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/asfdemux/gstasfdemux.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- gstasfdemux.c 26 Aug 2003 19:28:20 -0000 1.19 +++ gstasfdemux.c 15 Sep 2003 00:34:44 -0000 1.20 @@ -518,7 +518,9 @@ /* It's uncompressed with replic data*/ if (replic_size < 8) { - gst_element_error (GST_ELEMENT (asf_demux), "The payload has replicated data but the size is less than 8"); + gst_element_gerror(GST_ELEMENT (asf_demux), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("The payload has replicated data but the size is less than 8")); return FALSE; } gst_asf_demux_read_object_header_rest (asf_demux, &ptr, 8); @@ -567,7 +569,9 @@ segment_info.segment_size = segment_info.chunk_size; if (segment_info.chunk_size > packet_info->size_left) { - gst_element_error (GST_ELEMENT (asf_demux), "Payload chunk overruns packet size."); + gst_element_gerror(GST_ELEMENT (asf_demux), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("Payload chunk overruns packet size.")); return FALSE; } @@ -759,7 +763,9 @@ case ASF_CORRECTION_OFF: break; default: - gst_element_error (GST_ELEMENT (asf_demux), "Audio stream using unknown error correction"); + gst_element_gerror(GST_ELEMENT (asf_demux), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("Audio stream using unknown error correction")); return FALSE; } @@ -793,7 +799,9 @@ } break; default: - gst_element_error (GST_ELEMENT (asf_demux), "Object is a stream of unrecognised type"); + gst_element_gerror(GST_ELEMENT (asf_demux), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("Object is a stream of unrecognised type")); return FALSE; } @@ -841,7 +849,9 @@ if (*obj_id == ASF_OBJ_UNDEFINED) { GST_INFO ( "Object found with unknown GUID %08x %08x %08x %08x", guid->v1, guid->v2, guid->v3, guid->v4); - gst_element_error (GST_ELEMENT (asf_demux), "Could not identify object"); + gst_element_gerror(GST_ELEMENT (asf_demux), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("Could not identify object")); return FALSE; } @@ -911,7 +921,9 @@ case ASF_OBJ_BITRATE_MUTEX: return gst_asf_demux_skip_object (asf_demux, filepos, &obj_size); default: - gst_element_error (GST_ELEMENT (asf_demux), "Unknown ASF object"); + gst_element_gerror(GST_ELEMENT (asf_demux), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("Unknown ASF object")); return FALSE; } @@ -935,7 +947,9 @@ } /* Base case if we haven't found one at all */ - gst_element_error (GST_ELEMENT (asf_demux), "Segment found for undefined stream: (%d)", id); + gst_element_gerror(GST_ELEMENT (asf_demux), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("Segment found for undefined stream: (%d)", id)); return NULL; } Index: gstaudioconvert.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/audioconvert/gstaudioconvert.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- gstaudioconvert.c 19 Jul 2003 22:58:41 -0000 1.10 +++ gstaudioconvert.c 15 Sep 2003 00:34:44 -0000 1.11 @@ -334,9 +334,10 @@ if (!this->caps_set[1]) { if (!gst_audio_convert_set_caps (this->src)) { - gst_element_error (GST_ELEMENT (this), - "AudioConvert: could not set caps on pad %s", - GST_PAD_NAME(this->src)); + gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("AudioConvert: could not set caps on pad %s", + GST_PAD_NAME(this->src))); return; } } Index: gstauparse.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/auparse/gstauparse.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- gstauparse.c 6 Aug 2003 17:37:14 -0000 1.17 +++ gstauparse.c 15 Sep 2003 00:34:44 -0000 1.18 @@ -287,7 +287,9 @@ if (gst_pad_try_set_caps (auparse->srcpad, tempcaps) <= 0) { gst_buffer_unref (buf); - gst_element_error (GST_ELEMENT (auparse), "could not set audio caps"); + gst_element_gerror(GST_ELEMENT (auparse), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("could not set audio caps")); return; } Index: gstavidemux.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/avi/gstavidemux.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- gstavidemux.c 12 Sep 2003 11:39:05 -0000 1.76 +++ gstavidemux.c 15 Sep 2003 00:34:44 -0000 1.77 @@ -1691,7 +1691,9 @@ case GST_AVI_DEMUX_START: if (chunk.id != GST_RIFF_TAG_RIFF && chunk.type != GST_RIFF_RIFF_AVI) { - gst_element_error (element, "This doesn't appear to be an AVI file %08x %08x", chunk.id, chunk.type); + gst_element_gerror(element, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("This doesn't appear to be an AVI file %08x %08x", chunk.id, chunk.type)); return; } avi_demux->state = GST_AVI_DEMUX_HEADER; Index: gstavimux.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/avi/gstavimux.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- gstavimux.c 12 Sep 2003 11:39:29 -0000 1.44 +++ gstavimux.c 15 Sep 2003 00:34:44 -0000 1.45 @@ -1062,7 +1062,9 @@ if (avimux->audio_time) { avimux->auds_hdr.rate = (GST_SECOND * avimux->audio_size) / avimux->audio_time; } else { - gst_element_error (GST_ELEMENT (avimux), "Audio stream available, but no audio data transferred (or data with invalid timestamps). Resulting AVI will be corrupt"); + gst_element_gerror(GST_ELEMENT (avimux), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup ("Audio stream availablebut no audio data transferred (or data with invalid timestamps). Resulting AVI will be corrupt")); avimux->auds_hdr.rate = 0; } avimux->auds.av_bps = avimux->auds_hdr.rate * avimux->auds_hdr.scale; Index: gstchart.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/chart/gstchart.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- gstchart.c 6 Jul 2003 20:49:35 -0000 1.15 +++ gstchart.c 15 Sep 2003 00:34:44 -0000 1.16 @@ -372,8 +372,9 @@ "height", GST_PROPS_INT (chart->height), "framerate", GST_PROPS_FLOAT (chart->framerate)); if (gst_pad_try_set_caps (chart->srcpad, newcaps) <= 0) { - gst_element_error (GST_ELEMENT (chart), - "chart: could not negotiate format"); + gst_element_gerror(GST_ELEMENT (chart), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup ("chart: could not negotiate format")); return; } } Index: gstflxdec.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/flx/gstflxdec.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- gstflxdec.c 11 Jul 2003 06:04:23 -0000 1.24 +++ gstflxdec.c 15 Sep 2003 00:34:45 -0000 1.25 @@ -499,7 +499,9 @@ if (flxh->type != FLX_MAGICHDR_FLI && flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) { - gst_element_error (element, "not a flx file (type %d)\n", flxh->type); + gst_element_gerror(element, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("not a flx file (type %d)\n", flxh->type)); return; } Index: gstgoom.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/goom/gstgoom.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- gstgoom.c 10 Jul 2003 13:19:43 -0000 1.19 +++ gstgoom.c 15 Sep 2003 00:34:45 -0000 1.20 @@ -300,7 +300,9 @@ } if (goom->channels == 0) { - gst_element_error (GST_ELEMENT (goom), "sink format not negotiated"); + gst_element_gerror(GST_ELEMENT (goom), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("sink format not negotiated")); goto done; } @@ -309,7 +311,9 @@ if (!goom->srcnegotiated) { if (!gst_goom_negotiate_default (goom)) { - gst_element_error (GST_ELEMENT (goom), "could not negotiate src format"); + gst_element_gerror(GST_ELEMENT (goom), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("could not negotiate src format")); goto done; } } Index: gstfloat2int.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/intfloat/gstfloat2int.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- gstfloat2int.c 16 Jul 2003 16:08:13 -0000 1.40 +++ gstfloat2int.c 15 Sep 2003 00:34:45 -0000 1.41 @@ -366,7 +366,9 @@ gint frames_to_write; if (!plugin->channels) { - gst_element_error (element, "float2int: at least one sink pad needs to be connected"); + gst_element_gerror(element, GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("float2int: at least one sink pad needs to be connected")); return; } Index: gstint2float.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/intfloat/gstint2float.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- gstint2float.c 16 Jul 2003 16:08:13 -0000 1.30 +++ gstint2float.c 15 Sep 2003 00:34:45 -0000 1.31 @@ -296,7 +296,9 @@ g_return_if_fail((plugin = gst_int2float_get_plugin(pad,buf_in))); if (!plugin->channels) { - gst_element_error (GST_ELEMENT (plugin), "capsnego was never performed, bailing..."); + gst_element_gerror(GST_ELEMENT (plugin), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("capsnego was never performed, bailing...")); return; } Index: gstmodplug.cc =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/modplug/gstmodplug.cc,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- gstmodplug.cc 24 Jul 2003 08:49:43 -0000 1.28 +++ gstmodplug.cc 15 Sep 2003 00:34:45 -0000 1.29 @@ -625,7 +625,9 @@ if (!GST_PAD_CAPS (modplug->srcpad) && modplug_negotiate (modplug) <= 0) { - gst_element_error (GST_ELEMENT (modplug), "could not negotiate format"); + gst_element_gerror (GST_ELEMENT (modplug), GST_ERROR_CAPS_NEGOTIATION, + g_strdup ("could not negotiate format"), + g_strdup ("could not negotiate format")); return; } Index: gstmonoscope.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/monoscope/gstmonoscope.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gstmonoscope.c 6 Jul 2003 20:49:40 -0000 1.14 +++ gstmonoscope.c 15 Sep 2003 00:34:45 -0000 1.15 @@ -285,7 +285,9 @@ GST_DEBUG ("making new pad"); if (!GST_PAD_CAPS (monoscope->srcpad)) { if (gst_monoscope_negotiate (monoscope) <= 0) { - gst_element_error (GST_ELEMENT (monoscope), "could not set caps"); + gst_element_gerror(GST_ELEMENT (monoscope), GST_ERROR_UNKNOWN, + g_strdup ("unconverted error, file a bug"), + g_strdup_printf("could not set caps")); return; } } |