}
/* caps nego failed somewhere */
if (this->format == NULL) {
- gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("alsasink: No caps available"));
+ gst_element_error (GST_ELEMENT (this), "alsasink: No caps available");
return;
}
samplestamp = gst_alsa_timestamp_to_samples (this, GST_BUFFER_TIMESTAMP (sink->buf[i]));
/* set the caps on all pads */
if (!this->format) {
if (!gst_alsa_src_set_caps (src, FALSE)) {
- gst_element_gerror(element, GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("Could not set caps"));
+ gst_element_error (element, "Could not set caps");
return;
}
/* get the bufferpool going */
GstCaps *old = gst_alsa_caps (this->format->format, this->format->rate, this->format->channels);
for (--i; i >= 0; i--) {
if (gst_pad_try_set_caps (this->pad[i], gst_caps_ref (old)) == GST_PAD_LINK_REFUSED) {
- gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("error resetting caps to sane value"));
+ gst_element_error (GST_ELEMENT (this), "error resetting caps to sane value");
gst_caps_unref (old);
break;
}
g_free (this->format);
this->format = format;
if (!gst_alsa_start_audio (this)) {
- gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("Probed format doesn't work"));
+ gst_element_error (GST_ELEMENT (this), "Probed format doesn't work");
return GST_PAD_LINK_REFUSED;
}
}
}
if (!(gst_alsa_stop_audio (this) && gst_alsa_start_audio (this))) {
- gst_element_gerror(GST_ELEMENT (this), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("alsasink: Error restarting audio after xrun"));
+ gst_element_error (GST_ELEMENT (this), "alsasink: Error restarting audio after xrun");
}
}
/* create the GnomeVFSURI from the url */
sink->uri = gnome_vfs_uri_new(sink->filename);
if (!sink->uri) {
- gst_element_gerror(GST_ELEMENT (sink), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("opening file \"%s\" (%s)", sink->filename, strerror (errno)));
+ gst_element_error (GST_ELEMENT (sink), "opening file \"%s\" (%s)", sink->filename, strerror (errno));
return FALSE;
}
gst_gnomevfssink_signals[SIGNAL_ERASE_ASK], 0,
sink->erase);
}
- gst_element_gerror(GST_ELEMENT (sink), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("opening file \"%s\" (%s)", sink->filename, strerror (errno)));
+ gst_element_error (GST_ELEMENT (sink), "opening file \"%s\" (%s)", sink->filename, strerror (errno));
return FALSE;
}
if (result != GNOME_VFS_OK)
{
- gst_element_gerror(GST_ELEMENT (sink), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("closing file \"%s\" (%s)", sink->filename, strerror (errno)));
+ gst_element_error (GST_ELEMENT (sink), "closing file \"%s\" (%s)", sink->filename, strerror (errno));
}
else {
GST_FLAG_UNSET (sink, GST_GNOMEVFSSINK_OPEN);
char *escaped;
escaped = gnome_vfs_unescape_string_for_display (src->filename);
- gst_element_gerror(GST_ELEMENT(src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("opening vfs file \"%s\" (%s)",
+ gst_element_error(GST_ELEMENT(src),
+ "opening vfs file \"%s\" (%s)",
escaped,
- "unable to register UDP port"));
+ "unable to register UDP port");
g_free (escaped);
close(src->audiocast_fd);
return FALSE;
if (error != NULL) {
char *escaped;
escaped = gnome_vfs_unescape_string_for_display (src->filename);
- gst_element_gerror(GST_ELEMENT(src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("opening vfs file \"%s\" (unable to create thread: %s)",
+ gst_element_error(GST_ELEMENT(src),
+ "opening vfs file \"%s\" (unable to create thread: %s)",
escaped,
- error->message));
+ error->message);
g_free (escaped);
close(src->audiocast_fd);
return FALSE;
/* create the uri */
src->uri = gnome_vfs_uri_new(src->filename);
if (!src->uri) {
- gst_element_gerror(GST_ELEMENT(src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("error crerating uri \"%s\" (%s)", src->filename, strerror (errno)));
+ gst_element_error(GST_ELEMENT(src), "creating uri \"%s\" (%s)",
+ src->filename, strerror (errno));
return FALSE;
}
audiocast_thread_kill(src);
escaped = gnome_vfs_unescape_string_for_display (src->filename);
- gst_element_gerror(GST_ELEMENT(src), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("opening vfs file \"%s\" (%s)",
+ gst_element_error(GST_ELEMENT(src),
+ "opening vfs file \"%s\" (%s)",
escaped,
- gnome_vfs_result_to_string(result)));
+ gnome_vfs_result_to_string(result));
g_free (escaped);
return FALSE;
}
if (!vorbisenc->setup) {
gst_buffer_unref (buf);
- gst_element_gerror(GST_ELEMENT (vorbisenc), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("encoder not initialized (input is not audio?)"));
+ gst_element_error (GST_ELEMENT (vorbisenc), "encoder not initialized (input is not audio?)");
return;
}
/* open our custom vorbisfile data object with the callbacks we provide */
if (ov_open_callbacks (vorbisfile, &vorbisfile->vf, NULL, 0,
vorbisfile_ov_callbacks) < 0) {
- gst_element_gerror(element, GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("this is not a vorbis file"));
+ gst_element_error (element, "this is not a vorbis file");
return;
}
vorbisfile->need_discont = TRUE;
/* provide an error message if we can't link */
if (adder->format != GST_ADDER_FORMAT_INT) {
- 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"));
+ gst_element_error (el, "can't link a non-int pad to an int adder");
return FALSE;
}
if (adder->channels != 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));
+ gst_element_error (el,
+ "can't link %d-channel pad with %d-channel adder",
+ channels, adder->channels);
return FALSE;
}
if (adder->rate != 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));
+ gst_element_error (el, "can't link %d Hz pad with %d Hz adder",
+ rate, adder->rate);
return FALSE;
}
if (adder->width != 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));
+ gst_element_error (el, "can't link %d-bit pad with %d-bit adder",
+ width, adder->width);
return FALSE;
}
if (adder->is_signed != is_signed) {
- 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",
+ gst_element_error (el, "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_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"));
+ gst_element_error (el, "can't link a non-float pad to a float adder");
return FALSE;
}
if (adder->channels != 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));
+ gst_element_error (el,
+ "can't link %d-channel pad with %d-channel adder",
+ channels, adder->channels);
return FALSE;
}
if (adder->rate != 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));
+ gst_element_error (el, "can't link %d Hz pad with %d Hz adder",
+ rate, adder->rate);
return FALSE;
}
if (adder->width != 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));
+ gst_element_error (el, "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_gerror(GST_ELEMENT (adder), GST_ERROR_UNKNOWN,
- g_strdup ("unconverted error, file a bug"),
- g_strdup_printf("could not get new output buffer"));
+ gst_element_error (GST_ELEMENT (adder), "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_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));
+ gst_element_error (GST_ELEMENT (adder),
+ "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_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));
+ gst_element_error (GST_ELEMENT (adder),
+ "invalid width (%u) for float audio in gstadder",
+ adder->width);
return;
}
} else {
- 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));
+ gst_element_error (GST_ELEMENT (adder),
+ "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_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"));
+ gst_element_error (GST_ELEMENT (adder),
+ "Couldn't set the default caps, "
+ "use link_filtered instead");
return;
}
if (!this->caps_set[1]) {
if (!gst_audio_convert_set_caps (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)));
+ gst_element_error (GST_ELEMENT (this),
+ "AudioConvert: could not set caps on pad %s",
+ GST_PAD_NAME(this->src));
return;
}
}
return gst_v4l_get_audio(v4lelement, n, value);
}
- g_warning("Unknown attribute %s", name);
+ gst_element_error(element, "Unknown attribute %s", name);
return FALSE;
}
return gst_v4l_set_audio(v4lelement, n, value);
}
- g_warning("Unknown attribute %s", name);
+ gst_element_error(element, "Unknown attribute %s", name);
return FALSE;
}
/* check size */
if (GST_BUFFER_SIZE(buf) > v4lmjpegsink->breq.size)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Buffer too big (%d KB), max. buffersize is %lu KB",
- GST_BUFFER_SIZE(buf)/1024,
- v4lmjpegsink->breq.size/1024));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Buffer too big (%d KB), max. buffersize is %d KB",
+ GST_BUFFER_SIZE(buf)/1024, v4lmjpegsink->breq.size/1024);
return;
}
buf = gst_buffer_new_from_pool(v4lmjpegsrc->bufferpool, 0, 0);
if (!buf)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup("Failed to create a new GstBuffer"));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Failed to create a new GstBuffer");
return NULL;
}
}
if (n == v4lmjpegsrc->breq.count)
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup("Couldn't find the buffer"));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Couldn't find the buffer");
/* free the buffer struct et all */
gst_buffer_default_free(buf);
buf = gst_buffer_new_from_pool(v4lsrc->bufferpool, 0, 0);
if (!buf)
{
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_INTERNAL,
- g_strdup(_("An internal error occured")),
- g_strdup("Failed to create a new GstBuffer"));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Failed to create a new GstBuffer");
return NULL;
}
}
if (n == v4lsrc->mbuf.frames)
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_INTERNAL,
- g_strdup(_("An internal error occured")),
- g_strdup("Couldn\'t find the buffer"));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Couldn\'t find the buffer");
/* free struct */
gst_buffer_default_free(buf);
switch (system(buff))
{
case -1:
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_UNKNOWN,
- g_strdup(_("Unknown error occured")),
- g_strdup_printf("Could not start v4l-conf: %s", g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Could not start v4l-conf: %s", g_strerror(errno));
g_free(buff);
return FALSE;
case 0:
break;
default:
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_UNKNOWN,
- g_strdup(_("Unknown error occured")),
- g_strdup_printf("v4l-conf failed to run correctly: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "v4l-conf failed to run correctly: %s", g_strerror(errno));
g_free(buff);
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCSWIN, &vwin) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup (_("Unable to set parameters on video device")),
- g_strdup_printf("Failed to set the video window: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Failed to set the video window: %s",
+ g_strerror(errno));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCCAPTURE, &doit) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Failed to %s overlay display: %s",
- enable?"enable":"disable", g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Failed to %s overlay display: %s",
+ enable?"enable":"disable", g_strerror(errno));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCGCAP, &(v4lelement->vcap)) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting \'%s\' capabilities: %s",
- v4lelement->videodev, g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting \'%s\' capabilities: %s",
+ v4lelement->videodev, g_strerror(errno));
return FALSE;
}
v4lelement->video_fd = open(v4lelement->videodev, O_RDWR);
if (!GST_V4L_IS_OPEN(v4lelement))
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to open video device")),
- g_strdup_printf("Failed to open device (\'%s\'): %s",
- v4lelement->videodev, g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Failed to open device (\'%s\'): %s",
+ v4lelement->videodev, g_strerror(errno));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCSCHAN, &(v4lelement->vchan)) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error setting the channel/norm settings: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error setting the channel/norm settings: %s",
+ g_strerror(errno));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCGCHAN, &(v4lelement->vchan)) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error getting the channel/norm settings: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting the channel/norm settings: %s",
+ g_strerror(errno));
return FALSE;
}
tuner.tuner = 0;
if (ioctl(v4lelement->video_fd, VIDIOCGTUNER, &tuner) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting tuner signal: %s", sys_errlist[errno]));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting tuner signal: %s",
+ sys_errlist[errno]);
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCGFREQ, frequency) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting tuner frequency: %s", g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting tuner frequency: %s",
+ g_strerror(errno));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCSFREQ, &frequency) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error setting tuner frequency: %s", g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error setting tuner frequency: %s",
+ g_strerror(errno));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCGPICT, &vpic) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting picture parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting picture parameters: %s",
+ g_strerror(errno));
return FALSE;
}
*value = vpic.colour;
break;
default:
- g_warning("Error getting picture parameters: unknown type %d", type);
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting picture parameters: unknown type %d",
+ type);
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCGPICT, &vpic) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting picture parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting picture parameters: %s",
+ g_strerror(errno));
return FALSE;
}
vpic.colour = value;
break;
default:
- g_warning("Error setting picture parameters: unknown type %d", type);
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error setting picture parameters: unknown type %d",
+ type);
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCSPICT, &vpic) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error setting picture parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error setting picture parameters: %s",
+ g_strerror(errno));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCGAUDIO, &vau) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting audio parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting audio parameters: %s",
+ g_strerror(errno));
return FALSE;
}
*value = vau.mode;
break;
default:
- g_warning("Error getting audio parameters: unknown type %d", type);
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting audio parameters: unknown type %d",
+ type);
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCGAUDIO, &vau) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting audio parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error getting audio parameters: %s",
+ g_strerror(errno));
return FALSE;
}
case V4L_AUDIO_MUTE:
if (!(vau.flags & VIDEO_AUDIO_MUTABLE))
{
- g_warning("Error setting audio mute: " \
- "(un)setting mute is not supported");
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error setting audio mute: (un)setting mute is not supported");
return FALSE;
}
if (value)
case V4L_AUDIO_VOLUME:
if (!(vau.flags & VIDEO_AUDIO_VOLUME))
{
- g_warning("Error setting audio volume: " \
- "setting volume is not supported");
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error setting audio volume: setting volume is not supported");
return FALSE;
}
vau.volume = value;
vau.mode = value;
break;
default:
- g_warning("Error setting audio parameters: unknown type %d", type);
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error setting audio parameters: unknown type %d",
+ type);
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCSAUDIO, &vau) < 0)
{
- gst_element_error(GST_ELEMENT(v4lelement), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error setting audio parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lelement),
+ "Error setting audio parameters: %s",
+ g_strerror(errno));
return FALSE;
}
extern "C" {
#endif /* __cplusplus */
-#define _(string) (string)
/* simple check whether the device is open */
#define GST_V4L_IS_OPEN(v4lelement) \
if (v4lelement->video_fd <= 0) \
{ \
gst_element_error(GST_ELEMENT(v4lelement), \
- GST_ERROR_DEVICE, \
- g_strdup("Video device is not open"), \
- g_strdup("Device is not open")); \
+ "Device is not open"); \
return FALSE; \
}
if (v4lelement->video_fd != -1) \
{ \
gst_element_error(GST_ELEMENT(v4lelement), \
- GST_ERROR_DEVICE, \
- g_strdup(_("Video device is open")), \
- g_strdup("Device is open")); \
+ "Device is open"); \
return FALSE; \
}
/* checks whether the current v4lelement does video overlay */
#define GST_V4L_CHECK_OVERLAY(v4lelement) \
- if (!(v4lelement->vcap.type & VID_TYPE_OVERLAY)) \
- { \
- gst_element_error(GST_ELEMENT(v4lelement), \
- GST_ERROR_DEVICE, \
- g_strdup(_("Video device doesn't do overlay")),\
- g_strdup("Device doesn't do overlay")); \
- return FALSE; \
+ if (!(v4lelement->vcap.type & VID_TYPE_OVERLAY)) \
+ { \
+ gst_element_error(GST_ELEMENT(v4lelement), \
+ "Device doesn't do overlay"); \
+ return FALSE; \
}
/* checks whether we're in capture mode or not */
-#define GST_V4L_CHECK_ACTIVE(v4lelement) \
- if (v4lelement->buffer == NULL) \
- { \
- gst_element_error(GST_ELEMENT(v4lelement), \
- GST_ERROR_DEVICE, \
- g_strdup(_("Video device is not in streaming mode")), \
- g_strdup("Device is not in streaming mode")); \
- return FALSE; \
+#define GST_V4L_CHECK_ACTIVE(v4lelement) \
+ if (v4lelement->buffer == NULL) \
+ { \
+ gst_element_error(GST_ELEMENT(v4lelement), \
+ "Device is not in streaming mode"); \
+ return FALSE; \
}
/* checks whether we're out of capture mode or not */
-#define GST_V4L_CHECK_NOT_ACTIVE(v4lelement) \
- if (v4lelement->buffer != NULL) \
- { \
- gst_element_error(GST_ELEMENT(v4lelement), \
- GST_ERROR_DEVICE, \
- g_strdup(_("Video device is in streaming mode")), \
- g_strdup("Device is in streaming mode")); \
- return FALSE; \
+#define GST_V4L_CHECK_NOT_ACTIVE(v4lelement) \
+ if (v4lelement->buffer != NULL) \
+ { \
+ gst_element_error(GST_ELEMENT(v4lelement), \
+ "Device is in streaming mode"); \
+ return FALSE; \
}
if (ioctl(GST_V4LELEMENT(v4lmjpegsink)->video_fd, MJPIOC_SYNC,
&(v4lmjpegsink->bsync)) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Failed to sync on frame %d: %s",
- frame, g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Failed to sync on frame %d: %s",
+ frame, g_strerror(errno));
g_mutex_lock(v4lmjpegsink->mutex_queued_frames);
v4lmjpegsink->isqueued_queued_frames[frame] = -1;
g_cond_broadcast(v4lmjpegsink->cond_queued_frames[frame]);
/* be sure that we're not confusing */
if (frame != v4lmjpegsink->bsync.frame)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_INTERNAL,
- g_strdup(_("An internal error occured")),
- g_strdup("Internal error: frame number confusion"));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Internal error: frame number confusion");
goto end;
}
g_mutex_lock(v4lmjpegsink->mutex_queued_frames);
/* queue on this frame */
if (ioctl(GST_V4LELEMENT(v4lmjpegsink)->video_fd, MJPIOC_QBUF_PLAY, &num) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Failed to queue frame %d: %s",
- num, g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Failed to queue frame %d: %s",
+ num, g_strerror(errno));
return FALSE;
}
if (ioctl(GST_V4LELEMENT(v4lmjpegsink)->video_fd, MJPIOC_G_PARAMS, &bparm) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting playback parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Error getting playback parameters: %s",
+ g_strerror(errno));
return FALSE;
}
if (width > mw || height > mh)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Video dimensions (%dx%d) are larger than device max (%dx%d)",
- width, height, mw, mh));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Video dimensions (%dx%d) are larger than device max (%dx%d)",
+ width, height, mw, mh);
return FALSE;
}
{
if (height > mh/2)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Video dimensions (%dx%d) too large for non-interlaced playback (%dx%d)",
- width, height, mw, mh/2));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Video dimensions (%dx%d) too large for non-interlaced playback (%dx%d)",
+ width, height, mw, mh/2);
return FALSE;
}
if (ioctl(GST_V4LELEMENT(v4lmjpegsink)->video_fd, MJPIOC_S_PARAMS, &bparm) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error setting playback parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Error setting playback parameters: %s",
+ g_strerror(errno));
return FALSE;
}
/* Request buffers */
if (ioctl(GST_V4LELEMENT(v4lmjpegsink)->video_fd, MJPIOC_REQBUFS, &(v4lmjpegsink->breq)) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error requesting video buffers: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Error requesting video buffers: %s",
+ g_strerror(errno));
return FALSE;
}
PROT_READ|PROT_WRITE, MAP_SHARED, GST_V4LELEMENT(v4lmjpegsink)->video_fd, 0);
if (GST_V4LELEMENT(v4lmjpegsink)->buffer == MAP_FAILED)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Error mapping video buffers: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Error mapping video buffers: %s",
+ g_strerror(errno));
GST_V4LELEMENT(v4lmjpegsink)->buffer = NULL;
return FALSE;
}
malloc(sizeof(gint8) * v4lmjpegsink->breq.count);
if (!v4lmjpegsink->isqueued_queued_frames)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Failed to create queue tracker: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Failed to create queue tracker: %s",
+ g_strerror(errno));
return FALSE;
}
v4lmjpegsink->cond_queued_frames = (GCond **)
malloc(sizeof(GCond *) * v4lmjpegsink->breq.count);
if (!v4lmjpegsink->cond_queued_frames)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Failed to create queue condition holders: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Failed to create queue condition holders: %s",
+ g_strerror(errno));
return FALSE;
}
for (n=0;n<v4lmjpegsink->breq.count;n++)
gst_v4lmjpegsink_sync_thread, (void *) v4lmjpegsink, TRUE, &error);
if(!v4lmjpegsink->thread_queued_frames)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsink), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Failed to create sync thread: %s", error->message));
+ gst_element_error(GST_ELEMENT(v4lmjpegsink),
+ "Failed to create sync thread: %s", error->message);
return FALSE;
}
if (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd, MJPIOC_QBUF_CAPT, &num) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error queueing a buffer (%d): %s",
- num, g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error queueing a buffer (%d): %s",
+ num, g_strerror(errno));
return FALSE;
}
while (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd,
MJPIOC_SYNC, &(v4lmjpegsrc->bsync)) < 0) {
if (errno != EINTR) {
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error syncing on a buffer: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error syncing on a buffer: %s",
+ g_strerror(errno));
return FALSE;
}
DEBUG("Sync got interrupted");
if (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd, MJPIOC_G_STATUS, &bstat) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting device status: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error getting device status: %s",
+ g_strerror(errno));
return FALSE;
}
/* check */
if (input == V4L_MJPEG_INPUT_AUTO || norm == VIDEO_MODE_AUTO)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup("Unable to auto-detect an input"));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Unable to auto-detect an input");
return FALSE;
}
if (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd, MJPIOC_G_STATUS, &bstat) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting device status: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error getting device status: %s",
+ g_strerror(errno));
return FALSE;
}
}
else
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("No signal found on input %s",
- input_name[input]));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "No signal found on input %s",
+ input_name[input]);
return FALSE;
}
}
/* Query params for capture */
if (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd, MJPIOC_G_PARAMS, &bparm) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting video parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error getting video parameters: %s",
+ g_strerror(errno));
return FALSE;
}
/* Set params for capture */
if (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd, MJPIOC_S_PARAMS, &bparm) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error setting video parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error setting video parameters: %s",
+ g_strerror(errno));
return FALSE;
}
/* Query params for capture */
if (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd, MJPIOC_G_PARAMS, &bparm) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting video parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error getting video parameters: %s",
+ g_strerror(errno));
return FALSE;
}
if (width + x_offset > maxwidth)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Image width+offset (%d) bigger than maximum (%d)",
- width + x_offset, maxwidth));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Image width+offset (%d) bigger than maximum (%d)",
+ width + x_offset, maxwidth);
return FALSE;
}
if ((width%(bparm.HorDcm*16))!=0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Image width (%d) not multiple of %d (required for JPEG)",
- width, bparm.HorDcm*16));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Image width (%d) not multiple of %d (required for JPEG)",
+ width, bparm.HorDcm*16);
return FALSE;
}
if (height + y_offset > (norm==VIDEO_MODE_NTSC ? 480 : 576))
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Image height+offset (%d) bigger than maximum (%d)",
- height + y_offset, (norm==VIDEO_MODE_NTSC ? 480 : 576)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Image height+offset (%d) bigger than maximum (%d)",
+ height + y_offset, (norm==VIDEO_MODE_NTSC ? 480 : 576));
return FALSE;
}
/* RJ: Image height must only be a multiple of 8, but geom_height
*/
if ((height%(bparm.VerDcm*16))!=0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Image height (%d) not multiple of %d (required for JPEG)"
- ,height, bparm.VerDcm*16));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Image height (%d) not multiple of %d (required for JPEG)",
+ height, bparm.VerDcm*16);
return FALSE;
}
/* Set params for capture */
if (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd, MJPIOC_S_PARAMS, &bparm) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error setting video parameters: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error setting video parameters: %s",
+ g_strerror(errno));
return FALSE;
}
if (ioctl(GST_V4LELEMENT(v4lmjpegsrc)->video_fd,
MJPIOC_REQBUFS, &(v4lmjpegsrc->breq)) < 0)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error requesting video buffers: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error requesting video buffers: %s",
+ g_strerror(errno));
return FALSE;
}
if (v4lmjpegsrc->breq.count < MIN_BUFFERS_QUEUED)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Too little buffers. We got %lu, we want at least %d",
- v4lmjpegsrc->breq.count, MIN_BUFFERS_QUEUED));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Too little buffers. We got %d, we want at least %d",
+ v4lmjpegsrc->breq.count, MIN_BUFFERS_QUEUED);
return FALSE;
}
PROT_READ|PROT_WRITE, MAP_SHARED, GST_V4LELEMENT(v4lmjpegsrc)->video_fd, 0);
if (GST_V4LELEMENT(v4lmjpegsrc)->buffer == MAP_FAILED)
{
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Error mapping video buffers: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Error mapping video buffers: %s",
+ g_strerror(errno));
GST_V4LELEMENT(v4lmjpegsrc)->buffer = NULL;
return FALSE;
}
g_mutex_lock(v4lmjpegsrc->mutex_queue_state);
if (v4lmjpegsrc->frame_queue_state[num] != QUEUE_STATE_SYNCED) {
- gst_element_error(GST_ELEMENT(v4lmjpegsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Invalid state %d (expected %d), can't requeue",
+ gst_element_error(GST_ELEMENT(v4lmjpegsrc),
+ "Invalid state %d (expected %d), can't requeue",
v4lmjpegsrc->frame_queue_state[num],
- QUEUE_STATE_SYNCED));
+ QUEUE_STATE_SYNCED);
return FALSE;
}
if (ioctl(GST_V4LELEMENT(v4lsrc)->video_fd,
VIDIOCMCAPTURE, &(v4lsrc->mmap)) < 0)
{
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error queueing a buffer (%d): %s",
- num, g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Error queueing a buffer (%d): %s",
+ num, g_strerror(errno));
return FALSE;
}
/* if the sync() got interrupted, we can retry */
if (errno != EINTR) {
v4lsrc->frame_queue_state[num] = QUEUE_STATE_ERROR;
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error syncing on a buffer (%d): %s",
- num, g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Error syncing on a buffer (%d): %s",
+ num, g_strerror(errno));
return FALSE;
}
DEBUG("Sync got interrupted");
/* request buffer info */
if (ioctl(GST_V4LELEMENT(v4lsrc)->video_fd, VIDIOCGMBUF, &(v4lsrc->mbuf)) < 0)
{
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting buffer information: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Error getting buffer information: %s",
+ g_strerror(errno));
return FALSE;
}
if (v4lsrc->mbuf.frames < MIN_BUFFERS_QUEUED)
{
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Too little buffers. We got %d, we want at least %d",
- v4lsrc->mbuf.frames, MIN_BUFFERS_QUEUED));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Too little buffers. We got %d, we want at least %d",
+ v4lsrc->mbuf.frames, MIN_BUFFERS_QUEUED);
return FALSE;
}
PROT_READ|PROT_WRITE, MAP_SHARED, GST_V4LELEMENT(v4lsrc)->video_fd, 0);
if (GST_V4LELEMENT(v4lsrc)->buffer == MAP_FAILED)
{
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Error mapping video buffers: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Error mapping video buffers: %s",
+ g_strerror(errno));
GST_V4LELEMENT(v4lsrc)->buffer = NULL;
return FALSE;
}
g_mutex_lock(v4lsrc->mutex_queue_state);
if (v4lsrc->frame_queue_state[num] != QUEUE_STATE_SYNCED) {
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Invalid state %d (expected %d), can't requeue",
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Invalid state %d (expected %d), can't requeue",
v4lsrc->frame_queue_state[num],
- QUEUE_STATE_SYNCED));
+ QUEUE_STATE_SYNCED);
return FALSE;
}
/* let's start by requesting a buffer and mmap()'ing it */
if (ioctl(GST_V4LELEMENT(v4lsrc)->video_fd, VIDIOCGMBUF, &vmbuf) < 0)
{
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to get informations from video device")),
- g_strdup_printf("Error getting buffer information: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Error getting buffer information: %s",
+ g_strerror(errno));
return FALSE;
}
/* Map the buffers */
MAP_SHARED, GST_V4LELEMENT(v4lsrc)->video_fd, 0);
if (buffer == MAP_FAILED)
{
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Error mapping our try-out buffer: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Error mapping our try-out buffer: %s",
+ g_strerror(errno));
return FALSE;
}
if (ioctl(GST_V4LELEMENT(v4lsrc)->video_fd, VIDIOCMCAPTURE, &vmmap) < 0)
{
if (errno != EINVAL) /* our format failed! */
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_DEVICE,
- g_strdup(_("Unable to set parameters on video device")),
- g_strdup_printf("Error queueing our try-out buffer: %s",
- g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Error queueing our try-out buffer: %s",
+ g_strerror(errno));
munmap(buffer, vmbuf.size);
return FALSE;
}
if (ioctl(GST_V4LELEMENT(v4lsrc)->video_fd, VIDIOCSYNC, &frame) < 0)
{
- gst_element_error(GST_ELEMENT(v4lsrc), GST_ERROR_UNKNOWN,
- g_strdup(_("An unknown error occured")),
- g_strdup_printf("Error syncing on a buffer (%d): %s",
- frame, g_strerror(errno)));
+ gst_element_error(GST_ELEMENT(v4lsrc),
+ "Error syncing on a buffer (%d): %s",
+ frame, g_strerror(errno));
munmap(buffer, vmbuf.size);
return FALSE;
}