/* 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) {
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;
}
}
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;
}
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) {
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;
}
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;
}