mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
converted gst_element_error to new format in sys/oss - gettext pending
Original commit message from CVS: converted gst_element_error to new format in sys/oss - gettext pending
This commit is contained in:
parent
2cefb50429
commit
77a4320a04
4 changed files with 43 additions and 25 deletions
|
@ -429,37 +429,43 @@ gst_osselement_open_audio (GstOssElement *oss)
|
|||
if (oss->fd < 0) {
|
||||
switch (errno) {
|
||||
case EBUSY:
|
||||
gst_element_error (GST_ELEMENT (oss),
|
||||
"osselement: Unable to open %s (in use ?)",
|
||||
oss->device);
|
||||
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));
|
||||
break;
|
||||
case EISDIR:
|
||||
gst_element_error (GST_ELEMENT (oss),
|
||||
"osselement: Device %s is a directory",
|
||||
oss->device);
|
||||
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));
|
||||
break;
|
||||
case EACCES:
|
||||
case ETXTBSY:
|
||||
gst_element_error (GST_ELEMENT (oss),
|
||||
"osselement: Cannot access %s, check permissions",
|
||||
oss->device);
|
||||
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));
|
||||
break;
|
||||
case ENXIO:
|
||||
case ENODEV:
|
||||
case ENOENT:
|
||||
gst_element_error (GST_ELEMENT (oss),
|
||||
"osselement: Cannot access %s, does it exist ?",
|
||||
oss->device);
|
||||
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));
|
||||
break;
|
||||
case EROFS:
|
||||
gst_element_error (GST_ELEMENT (oss),
|
||||
"osselement: Cannot access %s, read-only filesystem ?",
|
||||
oss->device);
|
||||
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));
|
||||
default:
|
||||
/* FIXME: strerror is not threadsafe */
|
||||
gst_element_error (GST_ELEMENT (oss),
|
||||
"osselement: Cannot open %s, generic error: %s",
|
||||
oss->device, strerror (errno));
|
||||
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)));
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
|
|
|
@ -382,7 +382,9 @@ gst_ossgst_spawn_process (GstOssGst *ossgst)
|
|||
if((ossgst->childpid = fork()) == -1)
|
||||
{
|
||||
perror("fork");
|
||||
gst_element_error(GST_ELEMENT(ossgst),"forking");
|
||||
gst_element_gerror(GST_ELEMENT(ossgst), GST_ERROR_UNKNOWN,
|
||||
g_strdup ("unconverted error, file a bug"),
|
||||
g_strdup_printf("forking"));
|
||||
return FALSE;
|
||||
}
|
||||
GST_DEBUG ("forked %d", ossgst->childpid);
|
||||
|
@ -415,7 +417,9 @@ gst_ossgst_spawn_process (GstOssGst *ossgst)
|
|||
|
||||
/* will only reach if error */
|
||||
perror("exec");
|
||||
gst_element_error(GST_ELEMENT(ossgst),"starting child process");
|
||||
gst_element_gerror(GST_ELEMENT(ossgst), GST_ERROR_UNKNOWN,
|
||||
g_strdup ("unconverted error, file a bug"),
|
||||
g_strdup_printf("starting child process"));
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
|
|
@ -356,7 +356,9 @@ gst_osssink_chain (GstPad *pad, GstBuffer *buf)
|
|||
|
||||
if (!GST_OSSELEMENT (osssink)->bps) {
|
||||
gst_buffer_unref (buf);
|
||||
gst_element_error (GST_ELEMENT (osssink), "capsnego was never performed, unknown data type");
|
||||
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"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -315,13 +315,17 @@ gst_osssrc_get (GstPad *pad)
|
|||
/* nothing was negotiated, we can decide on a format */
|
||||
if (!gst_osssrc_negotiate (pad)) {
|
||||
gst_buffer_unref (buf);
|
||||
gst_element_error (GST_ELEMENT (src), "could not negotiate format");
|
||||
gst_element_gerror(GST_ELEMENT (src), GST_ERROR_UNKNOWN,
|
||||
g_strdup ("unconverted error, file a bug"),
|
||||
g_strdup_printf("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_error (GST_ELEMENT (src), "no format negotiated");
|
||||
gst_element_gerror(GST_ELEMENT (src), GST_ERROR_UNKNOWN,
|
||||
g_strdup ("unconverted error, file a bug"),
|
||||
g_strdup_printf("no format negotiated"));
|
||||
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
|
||||
}
|
||||
|
||||
|
@ -329,8 +333,10 @@ gst_osssrc_get (GstPad *pad)
|
|||
src->buffersize);
|
||||
if (readbytes < 0) {
|
||||
gst_buffer_unref (buf);
|
||||
gst_element_error (GST_ELEMENT (src), "error reading data (%s)",
|
||||
strerror (errno));
|
||||
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)));
|
||||
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue