GST_ELEMENT_ERROR

Original commit message from CVS:
GST_ELEMENT_ERROR
parent 1e9f5c82
2004-01-30 Thomas Vander Stichele <thomas at apestaart dot org>
* just about every source file:
gst_element_error -> GST_ELEMENT_ERROR
2004-01-29 Julien MOUTTE <julien@moutte.net>
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get): Fixing seeking
......
......@@ -658,7 +658,7 @@ gst_alsa_link (GstPad *pad, const GstCaps *caps)
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], old) == GST_PAD_LINK_REFUSED) {
gst_element_error (this, CORE, NEGOTIATION, NULL,
GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, NULL,
("could not reset caps to a sane value"));
gst_caps_free (old);
break;
......@@ -680,7 +680,7 @@ gst_alsa_link (GstPad *pad, const GstCaps *caps)
g_free (this->format);
this->format = format;
if (! gst_alsa_start_audio (this)) {
gst_element_error (this, RESOURCE, SETTINGS, NULL, NULL);
GST_ELEMENT_ERROR (this, RESOURCE, SETTINGS, NULL, NULL);
return GST_PAD_LINK_REFUSED;
}
......@@ -873,7 +873,7 @@ gst_alsa_xrun_recovery (GstAlsa *this)
}
if (!(gst_alsa_stop_audio (this) && gst_alsa_start_audio (this))) {
gst_element_error (this, RESOURCE, FAILED, NULL,
GST_ELEMENT_ERROR (this, RESOURCE, FAILED, NULL,
("Error restarting audio after xrun"));
}
}
......
......@@ -342,7 +342,7 @@ sink_restart:
}
/* caps nego failed somewhere */
if (this->format == NULL) {
gst_element_error (this, CORE, NEGOTIATION, NULL,
GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, NULL,
("ALSA format not negotiated"));
}
samplestamp = gst_alsa_timestamp_to_samples (this, GST_BUFFER_TIMESTAMP (sink->buf[i]));
......
......@@ -311,7 +311,7 @@ gst_alsa_src_loop (GstElement *element)
/* set the caps on all pads */
if (!this->format) {
if (!gst_alsa_src_set_caps (src, FALSE)) {
gst_element_error (element, CORE, NEGOTIATION, NULL,
GST_ELEMENT_ERROR (element, CORE, NEGOTIATION, NULL,
("ALSA format not negotiated"));
return;
}
......
......@@ -282,7 +282,7 @@ gst_gnomevfssink_open_file (GstGnomeVFSSink *sink)
gst_gnomevfssink_signals[SIGNAL_ERASE_ASK], 0,
sink->erase);
}
gst_element_error (sink, RESOURCE, OPEN_WRITE,
GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE,
(_("Could not open vfs file \"%s\" for writing"), sink->filename),
GST_ERROR_SYSTEM);
return FALSE;
......@@ -307,7 +307,7 @@ gst_gnomevfssink_close_file (GstGnomeVFSSink *sink)
result = gnome_vfs_close(sink->handle);
if (result != GNOME_VFS_OK)
gst_element_error (sink, RESOURCE, CLOSE,
GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE,
(_("Could not close vfs file \"%s\""), sink->filename),
GST_ERROR_SYSTEM);
}
......
......@@ -525,7 +525,7 @@ static int audiocast_init(GstGnomeVFSSrc *src)
return TRUE;
GST_DEBUG ("audiocast: registering listener");
if (audiocast_register_listener(&src->audiocast_port, &src->audiocast_fd) < 0) {
gst_element_error (src, RESOURCE, OPEN_READ, NULL,
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, NULL,
("Unable to listen on UDP port %d", src->audiocast_port));
close(src->audiocast_fd);
return FALSE;
......@@ -542,7 +542,7 @@ static int audiocast_init(GstGnomeVFSSrc *src)
GST_DEBUG ("audiocast: creating audiocast thread");
src->audiocast_thread = g_thread_create((GThreadFunc) audiocast_thread_run, src, TRUE, &error);
if (error != NULL) {
gst_element_error (src, RESOURCE, TOO_LAZY, NULL,
GST_ELEMENT_ERROR (src, RESOURCE, TOO_LAZY, NULL,
("Unable to create thread: %s", error->message));
close(src->audiocast_fd);
return FALSE;
......@@ -1043,7 +1043,7 @@ static gboolean gst_gnomevfssrc_open_file(GstGnomeVFSSrc *src)
/* create the uri */
src->uri = gnome_vfs_uri_new(src->filename);
if (!src->uri) {
gst_element_error (src, RESOURCE, OPEN_READ,
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
(_("Could not open vfs file \"%s\" for reading"), src->filename), GST_ERROR_SYSTEM);
return FALSE;
}
......@@ -1066,7 +1066,7 @@ static gboolean gst_gnomevfssrc_open_file(GstGnomeVFSSrc *src)
audiocast_thread_kill(src);
escaped = gnome_vfs_unescape_string_for_display (src->filename);
gst_element_error (src, RESOURCE, OPEN_READ,
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
(_("Could not open vfs file \"%s\" for reading"), escaped),
(gnome_vfs_result_to_string (result)));
g_free (escaped);
......
......@@ -356,7 +356,7 @@ gst_ogg_start_playing (GstOggDemux *ogg)
GST_DEBUG_OBJECT (ogg, "got EOS in setup, changing to playback now");
if (!gst_pad_send_event (GST_PAD_PEER (ogg->sinkpad),
gst_event_new_seek (GST_FORMAT_BYTES | GST_SEEK_METHOD_SET, 0))) {
gst_element_error (ogg, CORE, SEEK, (NULL),
GST_ELEMENT_ERROR (ogg, CORE, SEEK, (NULL),
("cannot seek to start after EOS"));
}
ogg->current_chain = 0;
......@@ -458,7 +458,7 @@ gst_ogg_demux_chain (GstPad *pad, GstData *buffer)
memcpy (data, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer));
if (ogg_sync_wrote (&ogg->sync, GST_BUFFER_SIZE (buffer)) != 0) {
gst_data_unref (buffer);
gst_element_error (ogg, LIBRARY, FAILED /* MEMORY */, NULL, ("ogg_sync_wrote failed"));
GST_ELEMENT_ERROR (ogg, LIBRARY, TOO_LAZY, NULL, ("ogg_sync_wrote failed"));
return;
}
offset_end = GST_BUFFER_OFFSET_IS_VALID (buffer) ?
......@@ -524,7 +524,7 @@ gst_ogg_demux_chain (GstPad *pad, GstData *buffer)
GST_DEBUG_OBJECT (ogg, "stream can seek, try setup now");
if (!gst_pad_send_event (GST_PAD_PEER (ogg->sinkpad),
gst_event_new_seek (GST_FORMAT_BYTES | GST_SEEK_METHOD_SET, 0))) {
gst_element_error (ogg, CORE, SEEK, NULL,
GST_ELEMENT_ERROR (ogg, CORE, SEEK, NULL,
("stream can seek to end, but not to start. Can't handle that."));
}
gst_ogg_add_chain (ogg);
......@@ -609,7 +609,7 @@ br:
/* FIXME: monitor if we are still in creation stage? */
cur = gst_ogg_pad_new (ogg, ogg_page_serialno (page));
if (!cur) {
gst_element_error (ogg, LIBRARY, FAILED, NULL, ("Creating ogg_stream struct failed."));
GST_ELEMENT_ERROR (ogg, LIBRARY, TOO_LAZY, NULL, ("Creating ogg_stream struct failed."));
return;
}
if (ogg->current_chain == -1) {
......@@ -620,7 +620,7 @@ br:
}
}
if (cur == NULL) {
gst_element_error (ogg, STREAM, DECODE, NULL, ("invalid ogg stream serial no"));
GST_ELEMENT_ERROR (ogg, STREAM, DECODE, NULL, ("invalid ogg stream serial no"));
return;
}
if (ogg_stream_pagein (&cur->stream, page) != 0) {
......
......@@ -246,13 +246,13 @@ vorbis_dec_chain (GstPad *pad, GstData *data)
/* header packet */
if (packet.packet[0] / 2 != packet.packetno) {
/* FIXME: just skip? */
gst_element_error (GST_ELEMENT (vd), STREAM, DECODE,
GST_ELEMENT_ERROR (GST_ELEMENT (vd), STREAM, DECODE,
(NULL), ("unexpected packet type %d", (gint) packet.packet[0]));
gst_data_unref (data);
return;
}
if (vorbis_synthesis_headerin (&vd->vi, &vd->vc, &packet)) {
gst_element_error (GST_ELEMENT (vd), STREAM, DECODE,
GST_ELEMENT_ERROR (GST_ELEMENT (vd), STREAM, DECODE,
(NULL), ("couldn't read header packet"));
gst_data_unref (data);
return;
......@@ -284,13 +284,13 @@ vorbis_dec_chain (GstPad *pad, GstData *data)
/* normal data packet */
if (vorbis_synthesis (&vd->vb, &packet)) {
gst_element_error (GST_ELEMENT (vd), STREAM, DECODE,
GST_ELEMENT_ERROR (GST_ELEMENT (vd), STREAM, DECODE,
(NULL), ("couldn't read data packet"));
gst_data_unref (data);
return;
}
if (vorbis_synthesis_blockin (&vd->vd, &vd->vb) < 0) {
gst_element_error (GST_ELEMENT (vd), STREAM, DECODE,
GST_ELEMENT_ERROR (GST_ELEMENT (vd), STREAM, DECODE,
(NULL), ("vorbis decoder did not accept data packet"));
gst_data_unref (data);
return;
......
......@@ -783,7 +783,7 @@ gst_vorbisenc_chain (GstPad * pad, GstData *_data)
if (!vorbisenc->setup) {
gst_buffer_unref (buf);
gst_element_error (vorbisenc, CORE, NEGOTIATION, NULL, ("encoder not initialized (input is not audio?)"));
GST_ELEMENT_ERROR (vorbisenc, CORE, NEGOTIATION, NULL, ("encoder not initialized (input is not audio?)"));
return;
}
......
......@@ -500,7 +500,7 @@ gst_vorbisfile_loop (GstElement *element)
/* 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_error (element, STREAM, WRONG_TYPE, NULL, NULL);
GST_ELEMENT_ERROR (element, STREAM, WRONG_TYPE, NULL, NULL);
return;
}
vorbisfile->need_discont = TRUE;
......
......@@ -168,7 +168,7 @@ gst_riff_peek_head (GstRiffRead *riff,
gst_pad_event_default (riff->sinkpad, event);
} else {
gst_event_unref (event);
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
}
return FALSE;
}
......@@ -197,7 +197,7 @@ gst_riff_read_element_data (GstRiffRead *riff,
GstBuffer *buf = NULL;
if (gst_bytestream_peek (riff->bs, &buf, length) != length) {
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
if (buf)
gst_buffer_unref (buf);
return NULL;
......@@ -240,7 +240,7 @@ gst_riff_read_seek (GstRiffRead *riff,
/* now seek */
if (!gst_bytestream_seek (riff->bs, offset, GST_SEEK_METHOD_SET)) {
gst_element_error (riff, RESOURCE, SEEK, NULL, NULL);
GST_ELEMENT_ERROR (riff, RESOURCE, SEEK, NULL, NULL);
return NULL;
}
......@@ -252,7 +252,7 @@ gst_riff_read_seek (GstRiffRead *riff,
/* get the discont event and return */
gst_bytestream_get_status (riff->bs, &remaining, &event);
if (!event || GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
gst_element_error (riff, CORE, EVENT, NULL,
GST_ELEMENT_ERROR (riff, CORE, EVENT, NULL,
("No discontinuity event after seek"));
if (event)
gst_event_unref (event);
......@@ -296,7 +296,7 @@ gst_riff_peek_list (GstRiffRead *riff)
}
if (gst_bytestream_peek_bytes (riff->bs, &data, 12) != 12) {
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
return 0;
}
......@@ -656,7 +656,7 @@ gst_riff_read_list (GstRiffRead *riff,
}
gst_bytestream_flush_fast (riff->bs, 8);
if (gst_bytestream_peek_bytes (riff->bs, &data, 4) != 4) {
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
return FALSE;
}
gst_bytestream_flush_fast (riff->bs, 4);
......@@ -844,14 +844,14 @@ gst_riff_read_header (GstRiffRead *riff,
if (!gst_riff_peek_head (riff, &tag, &length, NULL))
return FALSE;
if (tag != GST_RIFF_TAG_RIFF) {
gst_element_error (riff, STREAM, WRONG_TYPE, NULL, NULL);
GST_ELEMENT_ERROR (riff, STREAM, WRONG_TYPE, NULL, NULL);
return FALSE;
}
gst_bytestream_flush_fast (riff->bs, 8);
/* doctype */
if (gst_bytestream_peek_bytes (riff->bs, &data, 4) != 4) {
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
return FALSE;
}
gst_bytestream_flush_fast (riff->bs, 4);
......
......@@ -312,7 +312,7 @@ gst_adder_loop (GstElement *element)
buf_out = gst_buffer_new_and_alloc (1024);
if (buf_out == NULL) {
gst_element_error (adder, CORE, TOO_LAZY, NULL, ("could not get new output buffer"));
GST_ELEMENT_ERROR (adder, CORE, TOO_LAZY, NULL, ("could not get new output buffer"));
return;
}
......@@ -400,7 +400,7 @@ gst_adder_loop (GstElement *element)
for (i = 0; i < GST_BUFFER_SIZE (buf_out); i++)
out[i] = CLAMP(out[i] + in[i], 0x80, 0x7f);
} else {
gst_element_error (adder, STREAM, FORMAT, NULL,
GST_ELEMENT_ERROR (adder, STREAM, FORMAT, NULL,
("invalid width (%u) for integer audio in gstadder",
adder->width));
return;
......@@ -417,13 +417,13 @@ gst_adder_loop (GstElement *element)
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 (adder, STREAM, FORMAT, NULL,
GST_ELEMENT_ERROR (adder, STREAM, FORMAT, NULL,
("invalid width (%u) for float audio in gstadder",
adder->width));
return;
}
} else {
gst_element_error (adder, STREAM, FORMAT, NULL,
GST_ELEMENT_ERROR (adder, STREAM, FORMAT, NULL,
("invalid audio format (%d) in gstadder",
adder->format));
return;
......
......@@ -383,7 +383,7 @@ gst_sinesrc_get (GstPad *pad)
if (!GST_PAD_CAPS (src->srcpad)) {
if (gst_sinesrc_link (src->srcpad,
gst_pad_get_allowed_caps (src->srcpad)) <= 0) {
gst_element_error (src, CORE, NEGOTIATION, NULL, NULL);
GST_ELEMENT_ERROR (src, CORE, NEGOTIATION, NULL, NULL);
return NULL;
}
}
......
......@@ -526,7 +526,7 @@ gst_vorbis_tag_chain (GstPad *pad, GstData *data)
}
if (GST_BUFFER_SIZE (buffer) == 0)
gst_element_error (tag, CORE, TAG, NULL, ("empty buffers are not allowed in vorbis data"));
GST_ELEMENT_ERROR (tag, CORE, TAG, NULL, ("empty buffers are not allowed in vorbis data"));
if (GST_BUFFER_DATA (buffer)[0] == 3) {
gchar *vendor;
......@@ -534,7 +534,7 @@ gst_vorbis_tag_chain (GstPad *pad, GstData *data)
gst_data_unref (data);
if (list == NULL) {
gst_element_error (tag, CORE, TAG, NULL, ("invalid data in vorbis comments"));
GST_ELEMENT_ERROR (tag, CORE, TAG, NULL, ("invalid data in vorbis comments"));
return;
}
gst_element_found_tags_for_pad (GST_ELEMENT (tag), tag->srcpad, 0,
......
......@@ -406,7 +406,7 @@ gst_videotestsrc_get (GstPad * pad)
videotestsrc = GST_VIDEOTESTSRC (gst_pad_get_parent (pad));
if (videotestsrc->fourcc == NULL) {
gst_element_error (videotestsrc, CORE, NEGOTIATION, NULL,
GST_ELEMENT_ERROR (videotestsrc, CORE, NEGOTIATION, NULL,
("format wasn't negotiated before get function"));
return NULL;
}
......
......@@ -269,7 +269,7 @@ gst_v4lmjpegsink_chain (GstPad *pad,
/* check size */
if (GST_BUFFER_SIZE(buf) > v4lmjpegsink->breq.size)
{
gst_element_error (v4lmjpegsink, RESOURCE, WRITE, NULL,
GST_ELEMENT_ERROR (v4lmjpegsink, RESOURCE, WRITE, NULL,
("Buffer too big (%d KB), max. buffersize is %ld KB",
GST_BUFFER_SIZE(buf)/1024, v4lmjpegsink->breq.size/1024));
return;
......
......@@ -811,6 +811,6 @@ gst_v4lmjpegsrc_buffer_free (GstBuffer *buf)
}
if (n == v4lmjpegsrc->breq.count)
gst_element_error(v4lmjpegsrc, RESOURCE, TOO_LAZY, NULL,
GST_ELEMENT_ERROR (v4lmjpegsrc, RESOURCE, TOO_LAZY, NULL,
("Couldn't find the buffer"));
}
......@@ -874,7 +874,7 @@ gst_v4lsrc_buffer_free (GstBuffer *buf)
}
if (n == v4lsrc->mbuf.frames)
gst_element_error (v4lsrc, RESOURCE, TOO_LAZY, NULL,
GST_ELEMENT_ERROR (v4lsrc, RESOURCE, TOO_LAZY, NULL,
("Couldn\'t find the buffer"));
}
......
......@@ -65,14 +65,14 @@ gst_v4l_set_overlay (GstV4lElement *v4lelement)
switch (system(buff))
{
case -1:
gst_element_error (v4lelement, RESOURCE, FAILED,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, FAILED,
(_("Could not start v4l-conf")), GST_ERROR_SYSTEM);
g_free(buff);
return FALSE;
case 0:
break;
default:
gst_element_error (v4lelement, RESOURCE, FAILED,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, FAILED,
(_("Executing v4l-conf failed")), GST_ERROR_SYSTEM);
g_free(buff);
return FALSE;
......@@ -126,7 +126,7 @@ gst_v4l_set_window (GstElement *element,
if (ioctl(v4lelement->video_fd, VIDIOCSWIN, &vwin) < 0)
{
gst_element_error (v4lelement, RESOURCE, TOO_LAZY, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, TOO_LAZY, NULL,
("Failed to set the video window: %s", g_strerror (errno)));
return FALSE;
}
......@@ -153,7 +153,7 @@ gst_v4l_enable_overlay (GstV4lElement *v4lelement,
if (ioctl(v4lelement->video_fd, VIDIOCCAPTURE, &doit) < 0)
{
gst_element_error (v4lelement, RESOURCE, TOO_LAZY, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, TOO_LAZY, NULL,
("Failed to %s overlay display: %s",
enable?"enable":"disable", g_strerror (errno)));
return FALSE;
......
......@@ -84,7 +84,7 @@ gst_v4l_get_capabilities (GstV4lElement *v4lelement)
if (ioctl(v4lelement->video_fd, VIDIOCGCAP, &(v4lelement->vcap)) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("error getting capabilities %s of from device %s",
g_strerror (errno), v4lelement->videodev));
return FALSE;
......@@ -111,7 +111,7 @@ gst_v4l_open (GstV4lElement *v4lelement)
/* be sure we have a device */
if (!v4lelement->videodev) {
gst_element_error (v4lelement, RESOURCE, NOT_FOUND,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, NOT_FOUND,
(_("No device specified")), NULL);
return FALSE;
}
......@@ -120,7 +120,7 @@ gst_v4l_open (GstV4lElement *v4lelement)
v4lelement->video_fd = open(v4lelement->videodev, O_RDWR);
if (!GST_V4L_IS_OPEN(v4lelement))
{
gst_element_error (v4lelement, RESOURCE, OPEN_READ_WRITE,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, OPEN_READ_WRITE,
(_("Could not open device \"%s\" for reading and writing"), v4lelement->videodev),
GST_ERROR_SYSTEM);
return FALSE;
......@@ -141,7 +141,7 @@ gst_v4l_open (GstV4lElement *v4lelement)
!(v4lelement->vcap.type & VID_TYPE_MJPEG_ENCODER)) ||
(GST_IS_V4LMJPEGSINK(v4lelement) &&
!(v4lelement->vcap.type & VID_TYPE_MJPEG_DECODER))) {
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Device opened, but wrong type (0x%x)",
v4lelement->vcap.type));
close(v4lelement->video_fd);
......@@ -354,7 +354,7 @@ gst_v4l_set_chan_norm (GstV4lElement *v4lelement,
if (ioctl(v4lelement->video_fd, VIDIOCSCHAN, &(v4lelement->vchan)) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error setting the channel/norm settings: %s",
g_strerror(errno)));
return FALSE;
......@@ -362,7 +362,7 @@ gst_v4l_set_chan_norm (GstV4lElement *v4lelement,
if (ioctl(v4lelement->video_fd, VIDIOCGCHAN, &(v4lelement->vchan)) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting the channel/norm settings: %s",
g_strerror(errno)));
return FALSE;
......@@ -391,7 +391,7 @@ gst_v4l_get_signal (GstV4lElement *v4lelement,
tuner.tuner = tunernum;
if (ioctl(v4lelement->video_fd, VIDIOCGTUNER, &tuner) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting tuner signal: %s", g_strerror (errno)));
return FALSE;
}
......@@ -427,7 +427,7 @@ gst_v4l_get_frequency (GstV4lElement *v4lelement,
if (ioctl(v4lelement->video_fd, VIDIOCGFREQ, frequency) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting tuner frequency: %s", g_strerror (errno)));
return FALSE;
}
......@@ -461,7 +461,7 @@ gst_v4l_set_frequency (GstV4lElement *v4lelement,
if (ioctl(v4lelement->video_fd, VIDIOCSFREQ, &frequency) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error setting tuner frequency: %s", g_strerror (errno)));
return FALSE;
}
......@@ -489,7 +489,7 @@ gst_v4l_get_picture (GstV4lElement *v4lelement,
if (ioctl(v4lelement->video_fd, VIDIOCGPICT, &vpic) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting picture parameters: %s", g_strerror (errno)));
return FALSE;
}
......@@ -509,7 +509,7 @@ gst_v4l_get_picture (GstV4lElement *v4lelement,
*value = vpic.colour;
break;
default:
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting picture parameters: unknown type %d", type));
return FALSE;
}
......@@ -537,7 +537,7 @@ gst_v4l_set_picture (GstV4lElement *v4lelement,
if (ioctl(v4lelement->video_fd, VIDIOCGPICT, &vpic) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting picture parameters: %s", g_strerror (errno)));
return FALSE;
}
......@@ -557,14 +557,14 @@ gst_v4l_set_picture (GstV4lElement *v4lelement,
vpic.colour = value;
break;
default:
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error setting picture parameters: unknown type %d", type));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCSPICT, &vpic) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error setting picture parameters: %s", g_strerror (errno)));
return FALSE;
}
......@@ -594,7 +594,7 @@ gst_v4l_get_audio (GstV4lElement *v4lelement,
vau.audio = audionum;
if (ioctl(v4lelement->video_fd, VIDIOCGAUDIO, &vau) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting audio parameters: %s", g_strerror (errno)));
return FALSE;
}
......@@ -611,7 +611,7 @@ gst_v4l_get_audio (GstV4lElement *v4lelement,
*value = vau.mode;
break;
default:
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting audio parameters: unknown type %d", type));
return FALSE;
}
......@@ -641,7 +641,7 @@ gst_v4l_set_audio (GstV4lElement *v4lelement,
vau.audio = audionum;
if (ioctl(v4lelement->video_fd, VIDIOCGAUDIO, &vau) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error getting audio parameters: %s", g_strerror (errno)));
return FALSE;
}
......@@ -651,7 +651,7 @@ gst_v4l_set_audio (GstV4lElement *v4lelement,
case V4L_AUDIO_MUTE:
if (!(vau.flags & VIDEO_AUDIO_MUTABLE))
{
gst_element_error (v4lelement, CORE, NOT_IMPLEMENTED, NULL,
GST_ELEMENT_ERROR (v4lelement, CORE, NOT_IMPLEMENTED, NULL,
("Error setting audio mute: (un)setting mute is not supported"));
return FALSE;
}
......@@ -663,7 +663,7 @@ gst_v4l_set_audio (GstV4lElement *v4lelement,
case V4L_AUDIO_VOLUME:
if (!(vau.flags & VIDEO_AUDIO_VOLUME))
{
gst_element_error (v4lelement, CORE, NOT_IMPLEMENTED, NULL,
GST_ELEMENT_ERROR (v4lelement, CORE, NOT_IMPLEMENTED, NULL,
("Error setting audio volume: setting volume is not supported"));
return FALSE;
}
......@@ -673,14 +673,14 @@ gst_v4l_set_audio (GstV4lElement *v4lelement,
vau.mode = value;
break;
default:
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error setting audio parameters: unknown type %d", type));
return FALSE;
}
if (ioctl(v4lelement->video_fd, VIDIOCSAUDIO, &vau) < 0)
{
gst_element_error (v4lelement, RESOURCE, SETTINGS, NULL,
GST_ELEMENT_ERROR (v4lelement, RESOURCE, SETTINGS, NULL,
("Error setting audio parameters: %s", g_strerror (errno)));
return FALSE;
}
......
......@@ -43,7 +43,7 @@ extern "C" {
#define GST_V4L_CHECK_OPEN(element) \
if (element->video_fd <= 0) \
{ \
gst_element_error (element, RESOURCE, TOO_LAZY, \
GST_ELEMENT_ERROR (element, RESOURCE, TOO_LAZY, \
(_("Device is not open")), NULL); \
return FALSE; \
}
......@@ -52,7 +52,7 @@ extern "C" {
#define GST_V4L_CHECK_NOT_OPEN(element) \
if (element->video_fd != -1) \
{ \
gst_element_error (element, RESOURCE, TOO_LAZY, \
GST_ELEMENT_ERROR (element, RESOURCE, TOO_LAZY, \
(_("Device is open")), NULL); \
return FALSE; \
}
......@@ -61,7 +61,7 @@ extern "C" {
#define GST_V4L_CHECK_OVERLAY(element) \
if (!(element->vcap.type & VID_TYPE_OVERLAY)) \
{ \
gst_element_error (element, RESOURCE, TOO_LAZY, \
GST_ELEMENT_ERROR (element, RESOURCE, TOO_LAZY, \
NULL, ("Device cannot handle overlay")); \
return FALSE; \
}
......@@ -70,7 +70,7 @@ extern "C" {
#define GST_V4L_CHECK_ACTIVE(element) \
if (element->buffer == NULL) \
{ \
gst_element_error (element, RESOURCE, SETTINGS, \
GST_ELEMENT_ERROR (element, RESOURCE, SETTINGS, \
NULL, ("Device is not in streaming mode")); \
return FALSE; \
}
......@@ -79,7 +79,7 @@ extern "C" {
#define GST_V4L_CHECK_NOT_ACTIVE(element) \
if (element->buffer != NULL) \
{ \
gst_element_error (element, RESOURCE, SETTINGS, \
GST_ELEMENT_ERROR (element, RESOURCE, SETTINGS, \
NULL, ("Device is in streaming mode")); \
return FALSE; \
}
......
......@@ -80,7 +80,7 @@ gst_v4lmjpegsink_sync_thread (void *arg)
if (ioctl(GST_V4LELEMENT(v4lmjpegsink)->video_fd, MJPIOC_SYNC,
&(v4lmjpegsink->bsync)) < 0)
{
gst_element_error (v4lmjpegsink, RESOURCE, SYNC, NULL,
GST_ELEMENT_ERROR (v4lmjpegsink, RESOURCE, SYNC, NULL,
("Failed to sync on frame %d: %s",
frame, g_strerror (errno)));
g_mutex_lock(v4lmjpegsink->mutex_queued_frames);
......@@ -94,7 +94,7 @@ gst_v4lmjpegsink_sync_thread (void *arg)