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) {
|
if (oss->fd < 0) {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case EBUSY:
|
case EBUSY:
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
|
||||||
"osselement: Unable to open %s (in use ?)",
|
g_strdup ("unconverted error, file a bug"),
|
||||||
oss->device);
|
g_strdup_printf("osselement: Unable to open %s (in use ?)",
|
||||||
|
oss->device));
|
||||||
break;
|
break;
|
||||||
case EISDIR:
|
case EISDIR:
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
|
||||||
"osselement: Device %s is a directory",
|
g_strdup ("unconverted error, file a bug"),
|
||||||
oss->device);
|
g_strdup_printf("osselement: Device %s is a directory",
|
||||||
|
oss->device));
|
||||||
break;
|
break;
|
||||||
case EACCES:
|
case EACCES:
|
||||||
case ETXTBSY:
|
case ETXTBSY:
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
|
||||||
"osselement: Cannot access %s, check permissions",
|
g_strdup ("unconverted error, file a bug"),
|
||||||
oss->device);
|
g_strdup_printf("osselement: Cannot access %s, check permissions",
|
||||||
|
oss->device));
|
||||||
break;
|
break;
|
||||||
case ENXIO:
|
case ENXIO:
|
||||||
case ENODEV:
|
case ENODEV:
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
|
||||||
"osselement: Cannot access %s, does it exist ?",
|
g_strdup ("unconverted error, file a bug"),
|
||||||
oss->device);
|
g_strdup_printf("osselement: Cannot access %s, does it exist ?",
|
||||||
|
oss->device));
|
||||||
break;
|
break;
|
||||||
case EROFS:
|
case EROFS:
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
|
||||||
"osselement: Cannot access %s, read-only filesystem ?",
|
g_strdup ("unconverted error, file a bug"),
|
||||||
oss->device);
|
g_strdup_printf("osselement: Cannot access %s, read-only filesystem ?",
|
||||||
|
oss->device));
|
||||||
default:
|
default:
|
||||||
/* FIXME: strerror is not threadsafe */
|
/* FIXME: strerror is not threadsafe */
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
gst_element_gerror(GST_ELEMENT (oss), GST_ERROR_UNKNOWN,
|
||||||
"osselement: Cannot open %s, generic error: %s",
|
g_strdup ("unconverted error, file a bug"),
|
||||||
oss->device, strerror (errno));
|
g_strdup_printf("osselement: Cannot open %s, generic error: %s",
|
||||||
|
oss->device, strerror (errno)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -382,7 +382,9 @@ gst_ossgst_spawn_process (GstOssGst *ossgst)
|
||||||
if((ossgst->childpid = fork()) == -1)
|
if((ossgst->childpid = fork()) == -1)
|
||||||
{
|
{
|
||||||
perror("fork");
|
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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
GST_DEBUG ("forked %d", ossgst->childpid);
|
GST_DEBUG ("forked %d", ossgst->childpid);
|
||||||
|
@ -415,7 +417,9 @@ gst_ossgst_spawn_process (GstOssGst *ossgst)
|
||||||
|
|
||||||
/* will only reach if error */
|
/* will only reach if error */
|
||||||
perror("exec");
|
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;
|
return FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,7 +356,9 @@ gst_osssink_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
if (!GST_OSSELEMENT (osssink)->bps) {
|
if (!GST_OSSELEMENT (osssink)->bps) {
|
||||||
gst_buffer_unref (buf);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -315,13 +315,17 @@ gst_osssrc_get (GstPad *pad)
|
||||||
/* nothing was negotiated, we can decide on a format */
|
/* nothing was negotiated, we can decide on a format */
|
||||||
if (!gst_osssrc_negotiate (pad)) {
|
if (!gst_osssrc_negotiate (pad)) {
|
||||||
gst_buffer_unref (buf);
|
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));
|
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GST_OSSELEMENT (src)->bps == 0) {
|
if (GST_OSSELEMENT (src)->bps == 0) {
|
||||||
gst_buffer_unref (buf);
|
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));
|
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,8 +333,10 @@ gst_osssrc_get (GstPad *pad)
|
||||||
src->buffersize);
|
src->buffersize);
|
||||||
if (readbytes < 0) {
|
if (readbytes < 0) {
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
gst_element_error (GST_ELEMENT (src), "error reading data (%s)",
|
gst_element_gerror(GST_ELEMENT (src), GST_ERROR_UNKNOWN,
|
||||||
strerror (errno));
|
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));
|
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue