mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 01:28:34 +00:00
reverting error patch before making a branch.
Original commit message from CVS: reverting error patch before making a branch.
This commit is contained in:
parent
26a16e00a3
commit
453e9b8871
17 changed files with 269 additions and 379 deletions
|
@ -708,9 +708,7 @@ sink_restart:
|
|||
}
|
||||
/* 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]));
|
||||
|
@ -1087,9 +1085,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_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 */
|
||||
|
@ -1536,9 +1532,7 @@ gst_alsa_link (GstPad *pad, 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], 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;
|
||||
}
|
||||
|
@ -1559,9 +1553,7 @@ gst_alsa_link (GstPad *pad, GstCaps *caps)
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -1878,9 +1870,7 @@ gst_alsa_xrun_recovery (GstAlsa *this)
|
|||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -250,9 +250,7 @@ gst_gnomevfssink_open_file (GstGnomeVFSSink *sink)
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -268,9 +266,7 @@ gst_gnomevfssink_open_file (GstGnomeVFSSink *sink)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -295,9 +291,7 @@ gst_gnomevfssink_close_file (GstGnomeVFSSink *sink)
|
|||
|
||||
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);
|
||||
|
|
|
@ -510,11 +510,10 @@ static int audiocast_init(GstGnomeVFSSrc *src)
|
|||
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;
|
||||
|
@ -533,11 +532,10 @@ static int audiocast_init(GstGnomeVFSSrc *src)
|
|||
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;
|
||||
|
@ -1043,9 +1041,8 @@ static gboolean gst_gnomevfssrc_open_file(GstGnomeVFSSrc *src)
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -1064,11 +1061,10 @@ static gboolean gst_gnomevfssrc_open_file(GstGnomeVFSSrc *src)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -699,9 +699,7 @@ gst_vorbisenc_chain (GstPad * pad, GstBuffer * buf)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -508,9 +508,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_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;
|
||||
|
|
|
@ -149,38 +149,29 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
|
|||
|
||||
/* 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) {
|
||||
|
@ -191,30 +182,23 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -423,9 +407,7 @@ gst_adder_loop (GstElement *element)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -513,10 +495,9 @@ 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_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) {
|
||||
|
@ -531,17 +512,15 @@ 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_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;
|
||||
}
|
||||
|
||||
|
@ -558,9 +537,9 @@ gst_adder_loop (GstElement *element)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -334,10 +334,9 @@ gst_audio_convert_chain (GstPad *pad, GstBuffer *buf)
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ gst_v4l_get_attribute (GstElement *element,
|
|||
return gst_v4l_get_audio(v4lelement, n, value);
|
||||
}
|
||||
|
||||
g_warning("Unknown attribute %s", name);
|
||||
gst_element_error(element, "Unknown attribute %s", name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ gst_v4l_set_attribute (GstElement *element,
|
|||
return gst_v4l_set_audio(v4lelement, n, value);
|
||||
}
|
||||
|
||||
g_warning("Unknown attribute %s", name);
|
||||
gst_element_error(element, "Unknown attribute %s", name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -294,11 +294,9 @@ gst_v4lmjpegsink_chain (GstPad *pad,
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -502,9 +502,8 @@ gst_v4lmjpegsrc_get (GstPad *pad)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -841,9 +840,8 @@ gst_v4lmjpegsrc_buffer_free (GstBufferPool *pool, GstBuffer *buf, gpointer user_
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -578,9 +578,8 @@ gst_v4lsrc_get (GstPad *pad)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -812,9 +811,8 @@ gst_v4lsrc_buffer_free (GstBufferPool *pool, GstBuffer *buf, gpointer user_data)
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -59,18 +59,15 @@ gst_v4l_set_overlay (GstV4lElement *v4lelement,
|
|||
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;
|
||||
}
|
||||
|
@ -123,10 +120,9 @@ gst_v4l_set_window (GstElement *element,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -152,10 +148,9 @@ gst_v4l_enable_overlay (GstV4lElement *v4lelement,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,10 +74,9 @@ gst_v4l_get_capabilities (GstV4lElement *v4lelement)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -109,10 +108,9 @@ gst_v4l_open (GstV4lElement *v4lelement)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -273,19 +271,17 @@ gst_v4l_set_chan_norm (GstV4lElement *v4lelement,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -329,9 +325,9 @@ gst_v4l_get_signal (GstV4lElement *v4lelement,
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -359,9 +355,9 @@ gst_v4l_get_frequency (GstV4lElement *v4lelement,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -387,9 +383,9 @@ gst_v4l_set_frequency (GstV4lElement *v4lelement,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -416,10 +412,9 @@ gst_v4l_get_picture (GstV4lElement *v4lelement,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -438,7 +433,9 @@ gst_v4l_get_picture (GstV4lElement *v4lelement,
|
|||
*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;
|
||||
}
|
||||
|
||||
|
@ -465,10 +462,9 @@ gst_v4l_set_picture (GstV4lElement *v4lelement,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -487,16 +483,17 @@ gst_v4l_set_picture (GstV4lElement *v4lelement,
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -541,10 +538,9 @@ gst_v4l_get_audio (GstV4lElement *v4lelement,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -560,7 +556,9 @@ gst_v4l_get_audio (GstV4lElement *v4lelement,
|
|||
*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;
|
||||
}
|
||||
|
||||
|
@ -590,10 +588,9 @@ gst_v4l_set_audio (GstV4lElement *v4lelement,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -602,8 +599,8 @@ gst_v4l_set_audio (GstV4lElement *v4lelement,
|
|||
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)
|
||||
|
@ -614,8 +611,8 @@ gst_v4l_set_audio (GstV4lElement *v4lelement,
|
|||
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;
|
||||
|
@ -624,16 +621,17 @@ gst_v4l_set_audio (GstV4lElement *v4lelement,
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define _(string) (string)
|
||||
|
||||
/* simple check whether the device is open */
|
||||
#define GST_V4L_IS_OPEN(v4lelement) \
|
||||
|
@ -44,9 +43,7 @@ extern "C" {
|
|||
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; \
|
||||
}
|
||||
|
||||
|
@ -55,43 +52,35 @@ extern "C" {
|
|||
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; \
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -80,10 +80,9 @@ gst_v4lmjpegsink_sync_thread (void *arg)
|
|||
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]);
|
||||
|
@ -95,9 +94,8 @@ gst_v4lmjpegsink_sync_thread (void *arg)
|
|||
/* 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);
|
||||
|
@ -131,10 +129,9 @@ gst_v4lmjpegsink_queue_frame (GstV4lMjpegSink *v4lmjpegsink,
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -229,10 +226,9 @@ gst_v4lmjpegsink_set_playback (GstV4lMjpegSink *v4lmjpegsink,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -248,10 +244,9 @@ gst_v4lmjpegsink_set_playback (GstV4lMjpegSink *v4lmjpegsink,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -279,10 +274,9 @@ gst_v4lmjpegsink_set_playback (GstV4lMjpegSink *v4lmjpegsink,
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -327,10 +321,9 @@ gst_v4lmjpegsink_set_playback (GstV4lMjpegSink *v4lmjpegsink,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -356,10 +349,9 @@ gst_v4lmjpegsink_playback_init (GstV4lMjpegSink *v4lmjpegsink)
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -372,10 +364,9 @@ gst_v4lmjpegsink_playback_init (GstV4lMjpegSink *v4lmjpegsink)
|
|||
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;
|
||||
}
|
||||
|
@ -386,20 +377,18 @@ gst_v4lmjpegsink_playback_init (GstV4lMjpegSink *v4lmjpegsink)
|
|||
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++)
|
||||
|
@ -436,9 +425,8 @@ gst_v4lmjpegsink_playback_start (GstV4lMjpegSink *v4lmjpegsink)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,10 +70,9 @@ gst_v4lmjpegsrc_queue_frame (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -103,10 +102,9 @@ gst_v4lmjpegsrc_sync_next_frame (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
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");
|
||||
|
@ -153,10 +151,9 @@ gst_v4lmjpegsrc_set_input_norm (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -174,9 +171,8 @@ gst_v4lmjpegsrc_set_input_norm (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -190,10 +186,9 @@ gst_v4lmjpegsrc_set_input_norm (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -206,10 +201,9 @@ gst_v4lmjpegsrc_set_input_norm (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -265,10 +259,9 @@ gst_v4lmjpegsrc_set_capture (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -294,10 +287,9 @@ gst_v4lmjpegsrc_set_capture (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -341,10 +333,9 @@ gboolean gst_v4lmjpegsrc_set_capture_m (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -379,26 +370,23 @@ gboolean gst_v4lmjpegsrc_set_capture_m (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
|
||||
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
|
||||
|
@ -406,10 +394,9 @@ gboolean gst_v4lmjpegsrc_set_capture_m (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -430,10 +417,9 @@ gboolean gst_v4lmjpegsrc_set_capture_m (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -458,19 +444,17 @@ gst_v4lmjpegsrc_capture_init (GstV4lMjpegSrc *v4lmjpegsrc)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -495,10 +479,9 @@ gst_v4lmjpegsrc_capture_init (GstV4lMjpegSrc *v4lmjpegsrc)
|
|||
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;
|
||||
}
|
||||
|
@ -639,11 +622,10 @@ gst_v4lmjpegsrc_requeue_frame (GstV4lMjpegSrc *v4lmjpegsrc,
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,10 +95,9 @@ gst_v4lsrc_queue_frame (GstV4lSrc *v4lsrc,
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -127,10 +126,9 @@ gst_v4lsrc_sync_frame (GstV4lSrc *v4lsrc, gint num)
|
|||
/* 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");
|
||||
|
@ -192,19 +190,17 @@ gst_v4lsrc_capture_init (GstV4lSrc *v4lsrc)
|
|||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -229,10 +225,9 @@ gst_v4lsrc_capture_init (GstV4lSrc *v4lsrc)
|
|||
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;
|
||||
}
|
||||
|
@ -369,11 +364,10 @@ gst_v4lsrc_requeue_frame (GstV4lSrc *v4lsrc, gint num)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -484,10 +478,9 @@ gst_v4lsrc_try_palette (GstV4lSrc *v4lsrc,
|
|||
/* 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 */
|
||||
|
@ -495,10 +488,9 @@ gst_v4lsrc_try_palette (GstV4lSrc *v4lsrc,
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -510,20 +502,18 @@ gst_v4lsrc_try_palette (GstV4lSrc *v4lsrc,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue