converted gst_element_error to new format in gst/ - gettext pending

Original commit message from CVS:
converted gst_element_error to new format in gst/ - gettext pending
This commit is contained in:
Benjamin Otte 2003-09-15 00:34:44 +00:00
parent d77838231f
commit d26698b5a1
2 changed files with 56 additions and 34 deletions

View file

@ -149,29 +149,38 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
/* provide an error message if we can't link */ /* provide an error message if we can't link */
if (adder->format != GST_ADDER_FORMAT_INT) { 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; return FALSE;
} }
if (adder->channels != channels) { if (adder->channels != channels) {
gst_element_error (el, gst_element_gerror(el, GST_ERROR_UNKNOWN,
"can't link %d-channel pad with %d-channel adder", g_strdup ("unconverted error, file a bug"),
channels, adder->channels); g_strdup_printf( "can't link %d-channel pad with %d-channel adder",
channels, adder->channels));
return FALSE; return FALSE;
} }
if (adder->rate != rate) { if (adder->rate != rate) {
gst_element_error (el, "can't link %d Hz pad with %d Hz adder", gst_element_gerror(el, GST_ERROR_UNKNOWN,
rate, adder->rate); 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; return FALSE;
} }
if (adder->width != width) { if (adder->width != width) {
gst_element_error (el, "can't link %d-bit pad with %d-bit adder", gst_element_gerror(el, GST_ERROR_UNKNOWN,
width, adder->width); 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; return FALSE;
} }
if (adder->is_signed != is_signed) { 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", adder->is_signed ? "" : "un",
is_signed ? "" : "un"); is_signed ? "" : "un"));
return FALSE; return FALSE;
} }
} else if (strcmp (mimetype, "audio/x-raw-float") == 0) { } else if (strcmp (mimetype, "audio/x-raw-float") == 0) {
@ -182,23 +191,30 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
gst_caps_get_int (caps, "rate", &rate); gst_caps_get_int (caps, "rate", &rate);
if (adder->format != GST_ADDER_FORMAT_FLOAT) { 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; return FALSE;
} }
if (adder->channels != channels) { if (adder->channels != channels) {
gst_element_error (el, gst_element_gerror(el, GST_ERROR_UNKNOWN,
"can't link %d-channel pad with %d-channel adder", g_strdup ("unconverted error, file a bug"),
channels, adder->channels); g_strdup_printf ("can't link %d-channel pad with %d-channel adder",
channels, adder->channels));
return FALSE; return FALSE;
} }
if (adder->rate != rate) { if (adder->rate != rate) {
gst_element_error (el, "can't link %d Hz pad with %d Hz adder", gst_element_gerror(el, GST_ERROR_UNKNOWN,
rate, adder->rate); 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; return FALSE;
} }
if (adder->width != width) { if (adder->width != width) {
gst_element_error (el, "can't link %d bit float pad with %d bit adder", gst_element_gerror(el, GST_ERROR_UNKNOWN,
width, adder->width); 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; return FALSE;
} }
} }
@ -407,7 +423,9 @@ gst_adder_loop (GstElement *element)
buf_out = gst_buffer_new_from_pool (adder->bufpool, 0, 0); buf_out = gst_buffer_new_from_pool (adder->bufpool, 0, 0);
if (buf_out == NULL) { 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; return;
} }
@ -495,9 +513,10 @@ gst_adder_loop (GstElement *element)
for (i = 0; i < GST_BUFFER_SIZE (buf_out); i++) for (i = 0; i < GST_BUFFER_SIZE (buf_out); i++)
out[i] = CLAMP(out[i] + in[i], 0x80, 0x7f); out[i] = CLAMP(out[i] + in[i], 0x80, 0x7f);
} else { } else {
gst_element_error (GST_ELEMENT (adder), gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN,
"invalid width (%u) for integer audio in gstadder", g_strdup ("unconverted error, file a bug"),
adder->width); g_strdup_printf ("invalid width (%u) for integer audio in gstadder",
adder->width));
return; return;
} }
} else if (adder->format == GST_ADDER_FORMAT_FLOAT) { } else if (adder->format == GST_ADDER_FORMAT_FLOAT) {
@ -512,15 +531,17 @@ gst_adder_loop (GstElement *element)
for (i = 0; i < GST_BUFFER_SIZE (buf_out) / sizeof (gfloat); i++) for (i = 0; i < GST_BUFFER_SIZE (buf_out) / sizeof (gfloat); i++)
out[i] = CLAMP(out[i] + in[i], -1.0, 1.0); out[i] = CLAMP(out[i] + in[i], -1.0, 1.0);
} else { } else {
gst_element_error (GST_ELEMENT (adder), gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN,
"invalid width (%u) for float audio in gstadder", g_strdup ("unconverted error, file a bug"),
adder->width); g_strdup_printf ("invalid width (%u) for float audio in gstadder",
adder->width));
return; return;
} }
} else { } else {
gst_element_error (GST_ELEMENT (adder), gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN,
"invalid audio format (%d) in gstadder", g_strdup ("unconverted error, file a bug"),
adder->format); g_strdup_printf("invalid audio format (%d) in gstadder",
adder->format));
return; return;
} }
@ -537,9 +558,9 @@ gst_adder_loop (GstElement *element)
GST_AUDIO_INT_PAD_TEMPLATE_PROPS); GST_AUDIO_INT_PAD_TEMPLATE_PROPS);
if (gst_pad_try_set_caps (adder->srcpad, caps) < 0) { if (gst_pad_try_set_caps (adder->srcpad, caps) < 0) {
gst_element_error (GST_ELEMENT (adder), gst_element_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN,
"Couldn't set the default caps, " g_strdup ("unconverted error, file a bug"),
"use link_filtered instead"); g_strdup ("Couldn't set the default caps, use link_filtered instead"));
return; return;
} }

View file

@ -334,9 +334,10 @@ gst_audio_convert_chain (GstPad *pad, GstBuffer *buf)
if (!this->caps_set[1]) { if (!this->caps_set[1]) {
if (!gst_audio_convert_set_caps (this->src)) { if (!gst_audio_convert_set_caps (this->src)) {
gst_element_error (GST_ELEMENT (this), gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN,
"AudioConvert: could not set caps on pad %s", g_strdup ("unconverted error, file a bug"),
GST_PAD_NAME(this->src)); g_strdup_printf("AudioConvert: could not set caps on pad %s",
GST_PAD_NAME(this->src)));
return; return;
} }
} }