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 */
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_adder_parse_caps (GstAdder *adder, GstCaps *caps)
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 @@ gst_adder_loop (GstElement *element)
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 @@ gst_adder_loop (GstElement *element)
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 @@ gst_adder_loop (GstElement *element)
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_adder_loop (GstElement *element)
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;
}

View file

@ -334,9 +334,10 @@ gst_audio_convert_chain (GstPad *pad, GstBuffer *buf)
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;
}
}