aasink->context = aa_autoinit (&aasink->ascii_surf);
if (aasink->context == NULL) {
- gst_element_gerror(GST_ELEMENT (aasink), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup ("opening aalib context"));
+ gst_element_error (GST_ELEMENT (aasink),
+ g_strdup("opening aalib context"));
return FALSE;
}
aa_autoinitkbd(aasink->context, 0);
}
/* oops list exhausted an nothing was found... */
if (!trylist) {
- gst_element_gerror(element, GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not negotiate"));
+ gst_element_error (element, "could not negotiate");
return;
}
}
"channels", GST_PROPS_INT (esdmon->channels)
)) <= 0)
{
- gst_element_gerror(GST_ELEMENT (esdmon), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not set caps"));
+ gst_element_error (GST_ELEMENT (esdmon), "could not set caps");
return NULL;
}
}
esdsink = GST_ESDSINK (gst_pad_get_parent (pad));
if (!esdsink->negotiated) {
- gst_element_gerror(GST_ELEMENT (esdsink), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("not negotiated"));
+ gst_element_error (GST_ELEMENT (esdsink), "not negotiated");
goto done;
}
GST_DEBUG (error);
- gst_element_gerror(GST_ELEMENT (flacdec), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf(error));
+ gst_element_error (GST_ELEMENT (flacdec), error);
}
static FLAC__SeekableStreamDecoderSeekStatus
}
if (!flacenc->negotiated) {
- gst_element_gerror(GST_ELEMENT (flacenc), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("format not negotiated"));
+ gst_element_error (GST_ELEMENT (flacenc),
+ "format not negotiated");
return;
}
gst_flacenc_set_metadata (flacenc, flacenc->metadata);
state = FLAC__seekable_stream_encoder_init (flacenc->encoder);
if (state != FLAC__STREAM_ENCODER_OK) {
- gst_element_gerror(GST_ELEMENT (flacenc), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not initialize encoder (wrong parameters?)"));
+ gst_element_error (GST_ELEMENT (flacenc),
+ "could not initialize encoder (wrong parameters?)");
return;
}
}
flacenc->data = NULL;
if (!res) {
- gst_element_gerror(GST_ELEMENT (flacenc), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf ("encoding error"));
+ gst_element_error (GST_ELEMENT (flacenc),
+ "encoding error");
}
}
}
if (!ladspa->bufpool) {
- gst_element_gerror(element, "Caps were never set, GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf(bailing..."));
+ gst_element_error (element, "Caps were never set, bailing...");
return;
}
g_return_if_fail (GST_IS_BUFFER (buffer_in));
if (!ladspa->bufpool) {
- gst_element_gerror((GstElement*)ladspa, "Caps were never set, GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf(bailing..."));
+ gst_element_error ((GstElement*)ladspa, "Caps were never set, bailing...");
return;
}
if (!GST_PAD_CAPS (mikmod->srcpad)) {
if (gst_mikmod_negotiate (mikmod) <= 0) {
- gst_element_gerror(GST_ELEMENT (mikmod), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("Failed to negotiate with next element in mikmod"));
+ gst_element_error (GST_ELEMENT (mikmod),
+ "Failed to negotiate with next element in mikmod");
return;
}
}
"format", GST_PROPS_STRING("PAL"),
NULL)
) <= 0) {
- gst_element_gerror(GST_ELEMENT(dv1394src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("Could not set source caps for PAL"));
+ gst_element_error (GST_ELEMENT(dv1394src), "Could not set source caps for PAL");
return 0;
}
} else {
"format", GST_PROPS_STRING ("NTSC"),
NULL)
) <= 0) {
- gst_element_gerror(GST_ELEMENT(dv1394src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("Could not set source caps for NTSC"));
+ gst_element_error (GST_ELEMENT(dv1394src), "Could not set source caps for NTSC");
return 0;
}
}
dv1394src->pool = gst_buffer_pool_get_default( dv1394src->frameSize, N_BUFFERS_IN_POOL );
if (dv1394src->pool == NULL) {
- gst_element_gerror(GST_ELEMENT(dv1394src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("gst_buffer_pool_get_default returned NULL"));
+ gst_element_error (GST_ELEMENT(dv1394src), "gst_buffer_pool_get_default returned NULL");
}
}
"channels", GST_PROPS_INT (1)
)))
{
- gst_element_gerror(GST_ELEMENT (speexenc), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not negotiate"));
+ gst_element_error (GST_ELEMENT (speexenc), "could not negotiate");
return;
}
}
if (gst_pad_try_set_caps (auparse->srcpad, tempcaps) <= 0) {
gst_buffer_unref (buf);
- gst_element_gerror(GST_ELEMENT (auparse), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not set audio caps"));
+ gst_element_error (GST_ELEMENT (auparse), "could not set audio caps");
return;
}
case GST_AVI_DEMUX_START:
if (chunk.id != GST_RIFF_TAG_RIFF &&
chunk.type != GST_RIFF_RIFF_AVI) {
- 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));
+ gst_element_error (element, "This doesn't appear to be an AVI file %08x %08x", chunk.id, chunk.type);
return;
}
avi_demux->state = GST_AVI_DEMUX_HEADER;
if (avimux->audio_time) {
avimux->auds_hdr.rate = (GST_SECOND * avimux->audio_size) / avimux->audio_time;
} else {
- 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"));
+ gst_element_error (GST_ELEMENT (avimux), "Audio stream available, but 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;
if (flxh->type != FLX_MAGICHDR_FLI &&
flxh->type != FLX_MAGICHDR_FLC &&
flxh->type != FLX_MAGICHDR_FLX) {
- 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));
+ gst_element_error (element, "not a flx file (type %d)\n", flxh->type);
return;
}
}
if (goom->channels == 0) {
- gst_element_gerror(GST_ELEMENT (goom), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("sink format not negotiated"));
+ gst_element_error (GST_ELEMENT (goom), "sink format not negotiated");
goto done;
}
if (!goom->srcnegotiated) {
if (!gst_goom_negotiate_default (goom)) {
- gst_element_gerror(GST_ELEMENT (goom), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not negotiate src format"));
+ gst_element_error (GST_ELEMENT (goom), "could not negotiate src format");
goto done;
}
}
GST_DEBUG ("making new pad");
if (!GST_PAD_CAPS (monoscope->srcpad)) {
if (gst_monoscope_negotiate (monoscope) <= 0) {
- gst_element_gerror(GST_ELEMENT (monoscope), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not set caps"));
+ gst_element_error (GST_ELEMENT (monoscope), "could not set caps");
return;
}
}
"framerate", GST_PROPS_FLOAT (smpte->fps)
)))
{
- gst_element_gerror(element, GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("cannot set caps"));
+ gst_element_error (element, "cannot set caps");
return;
}
}
"framerate", GST_PROPS_FLOAT (video_crop->fps)
)) <= 0)
{
- gst_element_gerror(GST_ELEMENT (video_crop), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not negotiate pads"));
+ gst_element_error (GST_ELEMENT (video_crop), "could not negotiate pads");
return;
}
}
if (!wavenc->setup) {
gst_buffer_unref (buf);
- gst_element_gerror(GST_ELEMENT (wavenc), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("encoder not initialised (input is not audio?)"));
+ gst_element_error (GST_ELEMENT (wavenc), "encoder not initialised (input is not audio?)");
return;
}
break;
default:
- gst_element_gerror(GST_ELEMENT (wavparse), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("wavparse: format %d not handled", wavparse->format));
+ gst_element_error (GST_ELEMENT (wavparse), "wavparse: format %d not handled", wavparse->format);
return;
}
if (gst_pad_try_set_caps (wavparse->srcpad, caps) <= 0) {
- gst_element_gerror(GST_ELEMENT (wavparse), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("Could not set caps"));
+ gst_element_error (GST_ELEMENT (wavparse), "Could not set caps");
return;
}
if (oss->fd < 0) {
switch (errno) {
case EBUSY:
- gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("osselement: Unable to open %s (in use ?)",
- oss->device));
+ gst_element_error (GST_ELEMENT (oss),
+ "osselement: Unable to open %s (in use ?)",
+ oss->device);
break;
case EISDIR:
- gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("osselement: Device %s is a directory",
- oss->device));
+ gst_element_error (GST_ELEMENT (oss),
+ "osselement: Device %s is a directory",
+ oss->device);
break;
case EACCES:
case ETXTBSY:
- gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("osselement: Cannot access %s, check permissions",
- oss->device));
+ gst_element_error (GST_ELEMENT (oss),
+ "osselement: Cannot access %s, check permissions",
+ oss->device);
break;
case ENXIO:
case ENODEV:
case ENOENT:
- gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("osselement: Cannot access %s, does it exist ?",
- oss->device));
+ gst_element_error (GST_ELEMENT (oss),
+ "osselement: Cannot access %s, does it exist ?",
+ oss->device);
break;
case EROFS:
- gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("osselement: Cannot access %s, read-only filesystem ?",
- oss->device));
+ gst_element_error (GST_ELEMENT (oss),
+ "osselement: Cannot access %s, read-only filesystem ?",
+ oss->device);
default:
/* FIXME: strerror is not threadsafe */
- gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("osselement: Cannot open %s, generic error: %s",
- oss->device, strerror (errno)));
+ gst_element_error (GST_ELEMENT (oss),
+ "osselement: Cannot open %s, generic error: %s",
+ oss->device, strerror (errno));
break;
}
return FALSE;
if((ossgst->childpid = fork()) == -1)
{
perror("fork");
- gst_element_gerror(GST_ELEMENT(ossgst), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("forking"));
+ gst_element_error(GST_ELEMENT(ossgst),"forking");
return FALSE;
}
GST_DEBUG ("forked %d", ossgst->childpid);
/* will only reach if error */
perror("exec");
- gst_element_gerror(GST_ELEMENT(ossgst), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("starting child process"));
+ gst_element_error(GST_ELEMENT(ossgst),"starting child process");
return FALSE;
}
if (!GST_OSSELEMENT (osssink)->bps) {
gst_buffer_unref (buf);
- gst_element_gerror(GST_ELEMENT (osssink), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("capsnego was never performed, unknown data type"));
+ gst_element_error (GST_ELEMENT (osssink), "capsnego was never performed, unknown data type");
return;
}
/* nothing was negotiated, we can decide on a format */
if (!gst_osssrc_negotiate (pad)) {
gst_buffer_unref (buf);
- gst_element_gerror(GST_ELEMENT (src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not negotiate format"));
+ gst_element_error (GST_ELEMENT (src), "could not negotiate format");
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
}
}
if (GST_OSSELEMENT (src)->bps == 0) {
gst_buffer_unref (buf);
- gst_element_gerror(GST_ELEMENT (src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("no format negotiated"));
+ gst_element_error (GST_ELEMENT (src), "no format negotiated");
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
}
src->buffersize);
if (readbytes < 0) {
gst_buffer_unref (buf);
- gst_element_gerror(GST_ELEMENT (src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("error reading data (%s)",
- strerror (errno)));
+ gst_element_error (GST_ELEMENT (src), "error reading data (%s)",
+ strerror (errno));
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
}