mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
GST_ELEMENT_ERROR
Original commit message from CVS: GST_ELEMENT_ERROR
This commit is contained in:
parent
9925c8d042
commit
51e5863a97
30 changed files with 115 additions and 104 deletions
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
|
@ -490,7 +490,7 @@ gst_aasink_open (GstAASink *aasink)
|
|||
|
||||
aasink->context = aa_autoinit (&aasink->ascii_surf);
|
||||
if (aasink->context == NULL) {
|
||||
gst_element_error (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, NULL,
|
||||
GST_ELEMENT_ERROR (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, NULL,
|
||||
("error opening aalib context"));
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -783,7 +783,7 @@ gst_dvdec_loop (GstElement *element)
|
|||
dvdec->bpp = 2;
|
||||
}
|
||||
} else {
|
||||
gst_element_error (element, CORE, NEGOTIATION, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (element, CORE, NEGOTIATION, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ gst_esdmon_get (GstPad *pad)
|
|||
"channels", G_TYPE_INT, esdmon->channels
|
||||
)) <= 0)
|
||||
{
|
||||
gst_element_error (esdmon, CORE, NEGOTIATION, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (esdmon, CORE, NEGOTIATION, NULL, NULL);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -252,6 +252,12 @@ gst_esdsink_chain (GstPad *pad, GstData *_data)
|
|||
|
||||
esdsink = GST_ESDSINK (gst_pad_get_parent (pad));
|
||||
|
||||
if (!esdsink->negotiated) {
|
||||
GST_ELEMENT_ERROR (esdsink, CORE, NEGOTIATION, NULL,
|
||||
("element wasn't negotiated before chain function"));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (GST_IS_EVENT(buf)){
|
||||
GstEvent *event = GST_EVENT(buf);
|
||||
|
||||
|
@ -386,7 +392,7 @@ gst_esdsink_open_audio (GstEsdsink *sink)
|
|||
if (sink->depth == 16) esdformat |= ESD_BITS16;
|
||||
else if (sink->depth == 8) esdformat |= ESD_BITS8;
|
||||
else {
|
||||
gst_element_error (sink, STREAM, FORMAT, NULL,
|
||||
GST_ELEMENT_ERROR (sink, STREAM, FORMAT, NULL,
|
||||
("invalid bit depth (%d)", sink->depth));
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -394,7 +400,7 @@ gst_esdsink_open_audio (GstEsdsink *sink)
|
|||
if (sink->channels == 2) esdformat |= ESD_STEREO;
|
||||
else if (sink->channels == 1) esdformat |= ESD_MONO;
|
||||
else {
|
||||
gst_element_error (sink, STREAM, FORMAT, NULL,
|
||||
GST_ELEMENT_ERROR (sink, STREAM, FORMAT, NULL,
|
||||
("invalid number of channels (%d)", sink->channels));
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -406,7 +412,7 @@ gst_esdsink_open_audio (GstEsdsink *sink)
|
|||
sink->fd = esd_play_stream(esdformat, sink->frequency, sink->host, connname);
|
||||
}
|
||||
if ( sink->fd < 0 ) {
|
||||
gst_element_error (sink, RESOURCE, OPEN_WRITE, NULL,
|
||||
GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, NULL,
|
||||
("can't open connection to esound server"));
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ gst_flacdec_error_callback (const FLAC__SeekableStreamDecoder *decoder,
|
|||
break;
|
||||
}
|
||||
|
||||
gst_element_error (flacdec, STREAM, DECODE, NULL, (error));
|
||||
GST_ELEMENT_ERROR (flacdec, STREAM, DECODE, NULL, (error));
|
||||
}
|
||||
|
||||
static FLAC__SeekableStreamDecoderSeekStatus
|
||||
|
@ -535,7 +535,7 @@ gst_flacdec_loop (GstElement *element)
|
|||
GST_DEBUG ("flacdec: initializing decoder");
|
||||
res = FLAC__seekable_stream_decoder_init (flacdec->decoder);
|
||||
if (res != FLAC__SEEKABLE_STREAM_DECODER_OK) {
|
||||
gst_element_error (flacdec, LIBRARY, INIT, NULL,
|
||||
GST_ELEMENT_ERROR (flacdec, LIBRARY, INIT, NULL,
|
||||
(FLAC__SeekableStreamDecoderStateString[res]));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -549,7 +549,7 @@ gst_flacenc_chain (GstPad *pad, GstData *_data)
|
|||
}
|
||||
|
||||
if (!flacenc->negotiated) {
|
||||
gst_element_error (flacenc, CORE, NEGOTIATION, NULL,
|
||||
GST_ELEMENT_ERROR (flacenc, CORE, NEGOTIATION, NULL,
|
||||
("format wasn't negotiated before chain function"));
|
||||
return;
|
||||
}
|
||||
|
@ -575,7 +575,7 @@ gst_flacenc_chain (GstPad *pad, GstData *_data)
|
|||
gst_flacenc_set_metadata (flacenc);
|
||||
state = FLAC__seekable_stream_encoder_init (flacenc->encoder);
|
||||
if (state != FLAC__STREAM_ENCODER_OK) {
|
||||
gst_element_error (flacenc, LIBRARY, INIT, NULL,
|
||||
GST_ELEMENT_ERROR (flacenc, LIBRARY, INIT, NULL,
|
||||
("could not initialize encoder (wrong parameters?)"));
|
||||
return;
|
||||
}
|
||||
|
@ -610,7 +610,7 @@ gst_flacenc_chain (GstPad *pad, GstData *_data)
|
|||
flacenc->data = NULL;
|
||||
|
||||
if (!res) {
|
||||
gst_element_error (flacenc, STREAM, ENCODE, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (flacenc, STREAM, ENCODE, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -295,7 +295,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data)
|
|||
gst_buffer_unref (sub);
|
||||
} else {
|
||||
/* FIXME: does that work well with FLAC files containing ID3v2 tags ? */
|
||||
gst_element_error (tag, STREAM, WRONG_TYPE, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (tag, STREAM, WRONG_TYPE, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -464,7 +464,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data)
|
|||
g_warning ("No tags found\n");
|
||||
buffer = gst_buffer_new_and_alloc (12);
|
||||
if (buffer == NULL) {
|
||||
gst_element_error (tag, CORE, TOO_LAZY, NULL,
|
||||
GST_ELEMENT_ERROR (tag, CORE, TOO_LAZY, NULL,
|
||||
("Error creating 12-byte buffer for padding block"));
|
||||
}
|
||||
bzero (GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer));
|
||||
|
@ -481,7 +481,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data)
|
|||
sizeof (header), NULL);
|
||||
gst_tag_list_free (merged_tags);
|
||||
if (buffer == NULL) {
|
||||
gst_element_error (tag, CORE, TAG, NULL, ("Error converting tag list to vorbiscomment buffer"));
|
||||
GST_ELEMENT_ERROR (tag, CORE, TAG, NULL, ("Error converting tag list to vorbiscomment buffer"));
|
||||
return;
|
||||
}
|
||||
size = GST_BUFFER_SIZE (buffer) - 4;
|
||||
|
@ -490,7 +490,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data)
|
|||
* while the vorbis specs allow more than that. Shouldn't
|
||||
* be a real world problem though
|
||||
*/
|
||||
gst_element_error (tag, CORE, TAG, NULL, ("Vorbis comment of size %d too long", size));
|
||||
GST_ELEMENT_ERROR (tag, CORE, TAG, NULL, ("Vorbis comment of size %d too long", size));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -288,7 +288,7 @@ gst_gdk_pixbuf_chain (GstPad *pad, GstData *_data)
|
|||
GError *error;
|
||||
|
||||
if (gdk_pixbuf_loader_close (filter->pixbuf_loader, &error)) {
|
||||
gst_element_error (filter, LIBRARY, SHUTDOWN, NULL, (error->message));
|
||||
GST_ELEMENT_ERROR (filter, LIBRARY, SHUTDOWN, NULL, (error->message));
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ gst_mikmod_loop (GstElement *element)
|
|||
|
||||
if (!GST_PAD_CAPS (mikmod->srcpad)) {
|
||||
if (gst_mikmod_negotiate (mikmod) <= 0) {
|
||||
gst_element_error (mikmod, CORE, NEGOTIATION, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (mikmod, CORE, NEGOTIATION, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ int gst_dv1394src_iso_receive(raw1394handle_t handle,int channel,size_t len,quad
|
|||
if (gst_pad_try_set_caps (dv1394src->srcpad,
|
||||
gst_caps_new_simple ("video/dv",
|
||||
"format", G_TYPE_STRING, "PAL", NULL)) <= 0) {
|
||||
gst_element_error (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for PAL"));
|
||||
GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for PAL"));
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
@ -260,7 +260,7 @@ int gst_dv1394src_iso_receive(raw1394handle_t handle,int channel,size_t len,quad
|
|||
if (gst_pad_try_set_caps (dv1394src->srcpad,
|
||||
gst_caps_new_simple ("video/dv",
|
||||
"format", G_TYPE_STRING, "NTSC", NULL)) <= 0) {
|
||||
gst_element_error (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for NTSC"));
|
||||
GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for NTSC"));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ gst_speexenc_chain (GstPad *pad, GstData *_data)
|
|||
"channels", G_TYPE_INT, 1,
|
||||
NULL)))
|
||||
{
|
||||
gst_element_error (speexenc, CORE, NEGOTIATION, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (speexenc, CORE, NEGOTIATION, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -687,7 +687,7 @@ gst_avi_demux_stream_init (GstAviDemux *avi)
|
|||
if (!gst_riff_read_header (riff, &doctype))
|
||||
return FALSE;
|
||||
if (doctype != GST_RIFF_RIFF_AVI) {
|
||||
gst_element_error (avi, STREAM, WRONG_TYPE, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (avi, STREAM, WRONG_TYPE, NULL, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -802,7 +802,7 @@ gst_avi_demux_add_stream (GstAviDemux *avi)
|
|||
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
||||
return FALSE;
|
||||
if (tag != GST_RIFF_TAG_strf) {
|
||||
gst_element_error (avi, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (avi, STREAM, DEMUX, NULL,
|
||||
("Invalid AVI header (no strf as second tag)"));
|
||||
goto skip_stream;
|
||||
}
|
||||
|
@ -1157,7 +1157,7 @@ gst_avi_demux_stream_header (GstAviDemux *avi)
|
|||
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
||||
return FALSE;
|
||||
if (tag != GST_RIFF_TAG_LIST) {
|
||||
gst_element_error (avi, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (avi, STREAM, DEMUX, NULL,
|
||||
("Invalid AVI header (no LIST at start): "
|
||||
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag)));
|
||||
return FALSE;
|
||||
|
@ -1165,7 +1165,7 @@ gst_avi_demux_stream_header (GstAviDemux *avi)
|
|||
if (!gst_riff_read_list (riff, &tag))
|
||||
return FALSE;
|
||||
if (tag != GST_RIFF_LIST_hdrl) {
|
||||
gst_element_error (avi, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (avi, STREAM, DEMUX, NULL,
|
||||
("Invalid AVI header (no hdrl at start): "
|
||||
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag)));
|
||||
return FALSE;
|
||||
|
@ -1175,7 +1175,7 @@ gst_avi_demux_stream_header (GstAviDemux *avi)
|
|||
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
||||
return FALSE;
|
||||
if (tag != GST_RIFF_TAG_avih) {
|
||||
gst_element_error (avi, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (avi, STREAM, DEMUX, NULL,
|
||||
("Invalid AVI header (no avih at start): "
|
||||
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag)));
|
||||
return FALSE;
|
||||
|
|
|
@ -985,7 +985,7 @@ gst_avimux_stop_file (GstAviMux *avimux)
|
|||
if (avimux->audio_time) {
|
||||
avimux->auds_hdr.rate = (GST_SECOND * avimux->audio_size) / avimux->audio_time;
|
||||
} else {
|
||||
gst_element_error (avimux, STREAM, MUX,
|
||||
GST_ELEMENT_ERROR (avimux, STREAM, MUX,
|
||||
(_("No or invalid input audio, AVI stream will be corrupt")), NULL);
|
||||
avimux->auds_hdr.rate = 0;
|
||||
}
|
||||
|
|
|
@ -463,7 +463,7 @@ gst_flxdec_loop (GstElement *element)
|
|||
if (flxh->type != FLX_MAGICHDR_FLI &&
|
||||
flxh->type != FLX_MAGICHDR_FLC &&
|
||||
flxh->type != FLX_MAGICHDR_FLX) {
|
||||
gst_element_error (element, STREAM, WRONG_TYPE, NULL, ("not a flx file (type %d)\n", flxh->type));
|
||||
GST_ELEMENT_ERROR (element, STREAM, WRONG_TYPE, NULL, ("not a flx file (type %d)\n", flxh->type));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ gst_goom_chain (GstPad *pad, GstData *_data)
|
|||
}
|
||||
|
||||
if (goom->channels == 0) {
|
||||
gst_element_error (goom, CORE, NEGOTIATION, NULL,
|
||||
GST_ELEMENT_ERROR (goom, CORE, NEGOTIATION, NULL,
|
||||
("format wasn't negotiated before chain function"));
|
||||
|
||||
goto done;
|
||||
|
|
|
@ -167,7 +167,7 @@ gst_ebml_read_element_id (GstEbmlRead *ebml,
|
|||
} else {
|
||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||
gst_event_unref (event);
|
||||
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, RESOURCE, READ, NULL,
|
||||
("Read error at position %llu (0x%llx)",
|
||||
pos, pos));
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ gst_ebml_read_element_id (GstEbmlRead *ebml,
|
|||
}
|
||||
if (read > 4) {
|
||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, NULL,
|
||||
("Invalid EBML ID size tag (0x%x) at position %llu (0x%llx)",
|
||||
data[0], pos, pos));
|
||||
return -1;
|
||||
|
@ -188,7 +188,7 @@ gst_ebml_read_element_id (GstEbmlRead *ebml,
|
|||
|
||||
if (gst_bytestream_peek_bytes (ebml->bs, &data, read) != read) {
|
||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, RESOURCE, READ, NULL,
|
||||
("Read error at position %llu (0x%llx)", pos, pos));
|
||||
return -1;
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ gst_ebml_read_element_length (GstEbmlRead *ebml,
|
|||
|
||||
if (gst_bytestream_peek_bytes (ebml->bs, &data, 1) != 1) {
|
||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, RESOURCE, READ, NULL,
|
||||
("Read error at position %llu (0x%llx)", pos, pos));
|
||||
return -1;
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ gst_ebml_read_element_length (GstEbmlRead *ebml,
|
|||
}
|
||||
if (read > 8) {
|
||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, NULL,
|
||||
("Invalid EBML length size tag (0x%x) at position %llu (0x%llx)",
|
||||
data[0], pos, pos));
|
||||
return -1;
|
||||
|
@ -240,7 +240,7 @@ gst_ebml_read_element_length (GstEbmlRead *ebml,
|
|||
num_ffs++;
|
||||
if (gst_bytestream_peek_bytes (ebml->bs, &data, read) != read) {
|
||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, RESOURCE, READ, NULL,
|
||||
("Read error at position %llu (0x%llx)", pos, pos));
|
||||
return -1;
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ gst_ebml_read_element_data (GstEbmlRead *ebml,
|
|||
|
||||
if (gst_bytestream_peek (ebml->bs, &buf, length) != length) {
|
||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, RESOURCE, READ, NULL,
|
||||
("Read error at position %llu (0x%llx)", pos, pos));
|
||||
if (buf)
|
||||
gst_buffer_unref (buf);
|
||||
|
@ -327,7 +327,7 @@ gst_ebml_read_seek (GstEbmlRead *ebml,
|
|||
|
||||
/* now seek */
|
||||
if (!gst_bytestream_seek (ebml->bs, offset, GST_SEEK_METHOD_SET)) {
|
||||
gst_element_error (ebml, RESOURCE, SEEK, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, RESOURCE, SEEK, NULL,
|
||||
("Seek to position %llu (0x%llx) failed", offset, offset));
|
||||
return NULL;
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ gst_ebml_read_seek (GstEbmlRead *ebml,
|
|||
/* get the discont event and return */
|
||||
gst_bytestream_get_status (ebml->bs, &remaining, &event);
|
||||
if (!event || GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
|
||||
gst_element_error (ebml, CORE, SEEK, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, CORE, SEEK, NULL,
|
||||
("No discontinuity event after seek"));
|
||||
if (event)
|
||||
gst_event_unref (event);
|
||||
|
@ -431,7 +431,7 @@ gst_ebml_read_uint (GstEbmlRead *ebml,
|
|||
data = GST_BUFFER_DATA (buf);
|
||||
size = GST_BUFFER_SIZE (buf);
|
||||
if (size < 1 || size > 8) {
|
||||
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, NULL,
|
||||
("Invalid integer element size %d at position %llu (0x%llu)",
|
||||
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf)));
|
||||
gst_buffer_unref (buf);
|
||||
|
@ -467,7 +467,7 @@ gst_ebml_read_sint (GstEbmlRead *ebml,
|
|||
data = GST_BUFFER_DATA (buf);
|
||||
size = GST_BUFFER_SIZE (buf);
|
||||
if (size < 1 || size > 8) {
|
||||
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, NULL,
|
||||
("Invalid integer element size %d at position %llu (0x%llx)",
|
||||
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf)));
|
||||
gst_buffer_unref (buf);
|
||||
|
@ -512,7 +512,7 @@ gst_ebml_read_float (GstEbmlRead *ebml,
|
|||
size = GST_BUFFER_SIZE (buf);
|
||||
|
||||
if (size != 4 && size != 8 && size != 10) {
|
||||
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, STREAM, DEMUX, NULL,
|
||||
("Invalid float element size %d at position %llu (0x%llx)",
|
||||
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf)));
|
||||
gst_buffer_unref (buf);
|
||||
|
@ -520,7 +520,7 @@ gst_ebml_read_float (GstEbmlRead *ebml,
|
|||
}
|
||||
|
||||
if (size == 10) {
|
||||
gst_element_error (ebml, CORE, NOT_IMPLEMENTED, NULL,
|
||||
GST_ELEMENT_ERROR (ebml, CORE, NOT_IMPLEMENTED, NULL,
|
||||
("FIXME! 10-byte floats unimplemented"));
|
||||
gst_buffer_unref (buf);
|
||||
return FALSE;
|
||||
|
@ -681,7 +681,7 @@ gst_ebml_read_header (GstEbmlRead *ebml,
|
|||
if (!(id = gst_ebml_peek_id (ebml, &level_up)))
|
||||
return FALSE;
|
||||
if (level_up != 0 || id != GST_EBML_ID_HEADER) {
|
||||
gst_element_error (ebml, STREAM, WRONG_TYPE, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (ebml, STREAM, WRONG_TYPE, NULL, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
if (!gst_ebml_read_master (ebml, &id))
|
||||
|
|
|
@ -1130,7 +1130,7 @@ gst_matroska_demux_init_stream (GstMatroskaDemux *demux)
|
|||
return FALSE;
|
||||
|
||||
if (!doctype || strcmp (doctype, "matroska") != 0) {
|
||||
gst_element_error (demux, STREAM, WRONG_TYPE, NULL,
|
||||
GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE, NULL,
|
||||
("Input is not a matroska stream (doctype=%s)",
|
||||
doctype ? doctype : "none"));
|
||||
g_free (doctype);
|
||||
|
@ -1138,7 +1138,7 @@ gst_matroska_demux_init_stream (GstMatroskaDemux *demux)
|
|||
}
|
||||
g_free (doctype);
|
||||
if (version > 1) {
|
||||
gst_element_error (demux, STREAM, DEMUX, NULL,
|
||||
GST_ELEMENT_ERROR (demux, STREAM, DEMUX, NULL,
|
||||
("Demuxer version (1) is too old to read stream version %d",
|
||||
version));
|
||||
return FALSE;
|
||||
|
@ -1634,7 +1634,7 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux *demux,
|
|||
|
||||
/* first byte(s): blocknum */
|
||||
if ((n = gst_matroska_ebmlnum_uint (data, size, &num)) < 0) {
|
||||
gst_element_error (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||
GST_ELEMENT_ERROR (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||
gst_buffer_unref (buf);
|
||||
res = FALSE;
|
||||
break;
|
||||
|
@ -1705,7 +1705,7 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux *demux,
|
|||
case 0x3: /* EBML lacing */ {
|
||||
guint total;
|
||||
if ((n = gst_matroska_ebmlnum_uint (data, size, &num)) < 0) {
|
||||
gst_element_error (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||
GST_ELEMENT_ERROR (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||
res = FALSE;
|
||||
break;
|
||||
}
|
||||
|
@ -1715,7 +1715,7 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux *demux,
|
|||
gint64 snum;
|
||||
gint r;
|
||||
if ((r = gst_matroska_ebmlnum_sint (data, size, &snum)) < 0) {
|
||||
gst_element_error (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||
GST_ELEMENT_ERROR (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||
res = FALSE;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ gst_monoscope_chain (GstPad *pad, GstData *_data)
|
|||
GST_DEBUG ("making new pad");
|
||||
if (!gst_pad_is_negotiated (monoscope->srcpad)) {
|
||||
if (gst_pad_renegotiate (monoscope->srcpad) <= 0) {
|
||||
gst_element_error (monoscope, CORE, NEGOTIATION, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (monoscope, CORE, NEGOTIATION, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -371,7 +371,7 @@ gst_smpte_loop (GstElement *element)
|
|||
"framerate", G_TYPE_DOUBLE, smpte->fps, NULL);
|
||||
|
||||
if (!gst_pad_try_set_caps (smpte->srcpad, caps)) {
|
||||
gst_element_error (smpte, CORE, NEGOTIATION, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -588,7 +588,7 @@ gst_wavenc_chain (GstPad *pad,
|
|||
|
||||
if (!wavenc->setup) {
|
||||
gst_buffer_unref (buf);
|
||||
gst_element_error (wavenc, CORE, NEGOTIATION, NULL, ("encoder not initialised (input is not audio?)"));
|
||||
GST_ELEMENT_ERROR (wavenc, CORE, NEGOTIATION, NULL, ("encoder not initialised (input is not audio?)"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -636,7 +636,7 @@ gst_wavparse_parse_fmt (GstWavParse *wavparse, guint size)
|
|||
break;
|
||||
|
||||
default:
|
||||
gst_element_error (wavparse, STREAM, NOT_IMPLEMENTED, NULL, ("format %d not handled", wavparse->format));
|
||||
GST_ELEMENT_ERROR (wavparse, STREAM, NOT_IMPLEMENTED, NULL, ("format %d not handled", wavparse->format));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -731,7 +731,7 @@ gst_wavparse_loop (GstElement *element)
|
|||
if (event && GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
|
||||
gst_pad_event_default (wavparse->sinkpad, event);
|
||||
} else {
|
||||
gst_element_error (element, RESOURCE, READ, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (element, RESOURCE, READ, NULL, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -808,7 +808,7 @@ gst_wavparse_loop (GstElement *element)
|
|||
case GST_WAVPARSE_START:
|
||||
if (chunk.id != GST_RIFF_TAG_RIFF &&
|
||||
chunk.type != GST_RIFF_RIFF_WAVE) {
|
||||
gst_element_error (element, STREAM, WRONG_TYPE, NULL,
|
||||
GST_ELEMENT_ERROR (element, STREAM, WRONG_TYPE, NULL,
|
||||
("chunk.id %08x chunk.type %08x", chunk.id, chunk.type));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -698,31 +698,31 @@ gst_osselement_open_audio (GstOssElement *oss)
|
|||
if (oss->fd < 0) {
|
||||
switch (errno) {
|
||||
case EBUSY:
|
||||
gst_element_error (oss, RESOURCE, BUSY,
|
||||
GST_ELEMENT_ERROR (oss, RESOURCE, BUSY,
|
||||
(_("OSS device \"%s\" is already in use by another program"), oss->device), NULL);
|
||||
break;
|
||||
case EACCES:
|
||||
case ETXTBSY:
|
||||
if (mode == GST_OSSELEMENT_WRITE)
|
||||
gst_element_error (oss, RESOURCE, OPEN_WRITE,
|
||||
GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_WRITE,
|
||||
(_("Could not access device \"%s\", check its permissions"), oss->device), GST_ERROR_SYSTEM);
|
||||
else
|
||||
gst_element_error (oss, RESOURCE, OPEN_READ,
|
||||
GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_READ,
|
||||
(_("Could not access device \"%s\", check its permissions"), oss->device), GST_ERROR_SYSTEM);
|
||||
break;
|
||||
case ENXIO:
|
||||
case ENODEV:
|
||||
case ENOENT:
|
||||
gst_element_error (oss, RESOURCE, NOT_FOUND,
|
||||
GST_ELEMENT_ERROR (oss, RESOURCE, NOT_FOUND,
|
||||
(_("Device \"%s\" does not exist"), oss->device), GST_ERROR_SYSTEM);
|
||||
break;
|
||||
default:
|
||||
/* FIXME: strerror is not threadsafe */
|
||||
if (mode == GST_OSSELEMENT_WRITE)
|
||||
gst_element_error (oss, RESOURCE, OPEN_WRITE,
|
||||
GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_WRITE,
|
||||
(_("Could not open device \"%s\" for writing"), oss->device), GST_ERROR_SYSTEM);
|
||||
else
|
||||
gst_element_error (oss, RESOURCE, OPEN_READ,
|
||||
GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_READ,
|
||||
(_("Could not open device \"%s\" for reading"), oss->device), GST_ERROR_SYSTEM);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -350,7 +350,7 @@ gst_osssink_chain (GstPad *pad, GstData *_data)
|
|||
|
||||
if (!GST_OSSELEMENT (osssink)->bps) {
|
||||
gst_buffer_unref (buf);
|
||||
gst_element_error (osssink, CORE, NEGOTIATION, NULL, ("format wasn't negotiated before chain function"));
|
||||
GST_ELEMENT_ERROR (osssink, CORE, NEGOTIATION, NULL, ("format wasn't negotiated before chain function"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -305,13 +305,13 @@ gst_osssrc_get (GstPad *pad)
|
|||
/* nothing was negotiated, we can decide on a format */
|
||||
if (!gst_osssrc_negotiate (pad)) {
|
||||
gst_buffer_unref (buf);
|
||||
gst_element_error (src, CORE, NEGOTIATION, NULL, NULL);
|
||||
GST_ELEMENT_ERROR (src, CORE, NEGOTIATION, NULL, NULL);
|
||||
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
||||
}
|
||||
}
|
||||
if (GST_OSSELEMENT (src)->bps == 0) {
|
||||
gst_buffer_unref (buf);
|
||||
gst_element_error (src, CORE, NEGOTIATION, NULL,
|
||||
GST_ELEMENT_ERROR (src, CORE, NEGOTIATION, NULL,
|
||||
("format wasn't negotiated before chain function"));
|
||||
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ gst_osssrc_get (GstPad *pad)
|
|||
src->buffersize);
|
||||
if (readbytes < 0) {
|
||||
gst_buffer_unref (buf);
|
||||
gst_element_error (src, RESOURCE, READ, NULL, GST_ERROR_SYSTEM);
|
||||
GST_ELEMENT_ERROR (src, RESOURCE, READ, NULL, GST_ERROR_SYSTEM);
|
||||
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
||||
}
|
||||
|
||||
|
|
|
@ -817,7 +817,7 @@ gst_v4l2src_get (GstPad *pad)
|
|||
|
||||
if (v4l2src->use_fixed_fps &&
|
||||
(fps = gst_v4l2src_get_fps(v4l2src)) == 0) {
|
||||
gst_element_error (v4l2src, RESOURCE, SETTINGS, NULL, ("could not get frame rate for element"));
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, NULL, ("could not get frame rate for element"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ gst_v4l2_set_display (GstV4l2Element *v4l2element)
|
|||
|
||||
switch (system(buff)) {
|
||||
case -1:
|
||||
gst_element_error (v4l2element, RESOURCE, FAILED,
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, FAILED,
|
||||
(_("Could not start v4l-conf")),
|
||||
GST_ERROR_SYSTEM);
|
||||
g_free(buff);
|
||||
|
@ -67,7 +67,7 @@ gst_v4l2_set_display (GstV4l2Element *v4l2element)
|
|||
case 0:
|
||||
break;
|
||||
default:
|
||||
gst_element_error (v4l2element, RESOURCE, FAILED,
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, FAILED,
|
||||
(_("Executing v4l-conf failed")),
|
||||
GST_ERROR_SYSTEM);
|
||||
g_free(buff);
|
||||
|
@ -112,7 +112,7 @@ gst_v4l2_set_window (GstElement *element,
|
|||
fmt.fmt.win.bitmap = NULL;
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_S_FMT, &fmt) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, TOO_LAZY, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, TOO_LAZY, NULL,
|
||||
("Failed to set the video window: %s", g_strerror (errno)));
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ gst_v4l2_enable_overlay (GstV4l2Element *v4l2element,
|
|||
GST_V4L2_CHECK_OVERLAY(v4l2element);
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_OVERLAY, &doit) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, TOO_LAZY, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, TOO_LAZY, NULL,
|
||||
("Failed to %s overlay display: %s",
|
||||
enable?"enable":"disable", g_strerror (errno)));
|
||||
return FALSE;
|
||||
|
|
|
@ -55,7 +55,7 @@ gst_v4l2_get_capabilities (GstV4l2Element *v4l2element)
|
|||
GST_V4L2_CHECK_OPEN(v4l2element);
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_QUERYCAP, &(v4l2element->vcap)) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Error getting %s capabilities: %s",
|
||||
v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -99,7 +99,7 @@ gst_v4l2_fill_lists (GstV4l2Element *v4l2element)
|
|||
if (errno == EINVAL)
|
||||
break; /* end of enumeration */
|
||||
else {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get %d in input enumeration for %s: %s",
|
||||
n, v4l2element->device,
|
||||
g_strerror (errno)));
|
||||
|
@ -122,7 +122,7 @@ gst_v4l2_fill_lists (GstV4l2Element *v4l2element)
|
|||
vtun.index = input.tuner;
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_G_TUNER,
|
||||
&vtun) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get tuner %d settings on %s: %s",
|
||||
input.tuner,
|
||||
v4l2element->device,
|
||||
|
@ -161,7 +161,7 @@ gst_v4l2_fill_lists (GstV4l2Element *v4l2element)
|
|||
if (errno == EINVAL)
|
||||
break; /* end of enumeration */
|
||||
else {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get %d in output enumeration for %s: %s",
|
||||
n, v4l2element->device,
|
||||
g_strerror (errno)));
|
||||
|
@ -200,7 +200,7 @@ gst_v4l2_fill_lists (GstV4l2Element *v4l2element)
|
|||
if (errno == EINVAL)
|
||||
break; /* end of enumeration */
|
||||
else {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get %d in norm enumeration for %s: %s",
|
||||
n, v4l2element->device,
|
||||
g_strerror (errno)));
|
||||
|
@ -237,7 +237,7 @@ gst_v4l2_fill_lists (GstV4l2Element *v4l2element)
|
|||
else
|
||||
break;
|
||||
} else {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get %d in control enumeration for %s: %s",
|
||||
n, v4l2element->device,
|
||||
g_strerror (errno)));
|
||||
|
@ -289,7 +289,7 @@ gst_v4l2_fill_lists (GstV4l2Element *v4l2element)
|
|||
if (errno == EINVAL)
|
||||
break; /* end of enumeration */
|
||||
else {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get %d in menu enumeration for %s: %s",
|
||||
n, v4l2element->device,
|
||||
g_strerror (errno)));
|
||||
|
@ -409,7 +409,7 @@ gst_v4l2_open (GstV4l2Element *v4l2element)
|
|||
/* open the device */
|
||||
v4l2element->video_fd = open(v4l2element->device, O_RDWR);
|
||||
if (!GST_V4L2_IS_OPEN(v4l2element)) {
|
||||
gst_element_error (v4l2element, RESOURCE, OPEN_READ_WRITE,
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, OPEN_READ_WRITE,
|
||||
(_("Could not open device \"%s\" for reading and writing"), v4l2element->device),
|
||||
GST_ERROR_SYSTEM);
|
||||
goto error;
|
||||
|
@ -423,7 +423,7 @@ gst_v4l2_open (GstV4l2Element *v4l2element)
|
|||
/* do we need to be a capture device? */
|
||||
if (GST_IS_V4L2SRC(v4l2element) &&
|
||||
!(v4l2element->vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
|
||||
gst_element_error (v4l2element, RESOURCE, NOT_FOUND,
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, NOT_FOUND,
|
||||
(_("Device \"%s\" is not a capture device"), v4l2element->device),
|
||||
("Capabilities: 0x%x", v4l2element->vcap.capabilities));
|
||||
goto error;
|
||||
|
@ -492,7 +492,7 @@ gst_v4l2_get_norm (GstV4l2Element *v4l2element,
|
|||
GST_V4L2_CHECK_OPEN(v4l2element);
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_G_STD, norm) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get the current norm for device %s: %s",
|
||||
v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -517,7 +517,7 @@ gst_v4l2_set_norm (GstV4l2Element *v4l2element,
|
|||
GST_V4L2_CHECK_NOT_ACTIVE(v4l2element);
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_S_STD, &norm) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to set norm 0x%llx for device %s: %s",
|
||||
norm, v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -543,7 +543,7 @@ gst_v4l2_get_input (GstV4l2Element *v4l2element,
|
|||
GST_V4L2_CHECK_OPEN(v4l2element);
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_G_INPUT, &n) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get current input on device %s: %s",
|
||||
v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -570,7 +570,7 @@ gst_v4l2_set_input (GstV4l2Element *v4l2element,
|
|||
GST_V4L2_CHECK_NOT_ACTIVE(v4l2element);
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_S_INPUT, &input) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to set input %d on device %s: %s",
|
||||
input, v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -596,7 +596,7 @@ gst_v4l2_get_output (GstV4l2Element *v4l2element,
|
|||
GST_V4L2_CHECK_OPEN(v4l2element);
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_G_OUTPUT, &n) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get current output on device %s: %s",
|
||||
v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -623,7 +623,7 @@ gst_v4l2_set_output (GstV4l2Element *v4l2element,
|
|||
GST_V4L2_CHECK_NOT_ACTIVE(v4l2element);
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_S_OUTPUT, &output) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to set output %d on device %s: %s",
|
||||
output, v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -651,7 +651,7 @@ gst_v4l2_get_frequency (GstV4l2Element *v4l2element,
|
|||
|
||||
freq.tuner = tunernum;
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_G_FREQUENCY, &freq) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get current tuner frequency for device %s: %s",
|
||||
v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -686,7 +686,7 @@ gst_v4l2_set_frequency (GstV4l2Element *v4l2element,
|
|||
freq.frequency = frequency;
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_S_FREQUENCY, &freq) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to set tuner frequency to %lu for device %s: %s",
|
||||
frequency, v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -714,7 +714,7 @@ gst_v4l2_signal_strength (GstV4l2Element *v4l2element,
|
|||
|
||||
tuner.index = tunernum;
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_G_TUNER, &tuner) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get signal strength for device %s: %s",
|
||||
v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -746,7 +746,7 @@ gst_v4l2_get_attribute (GstV4l2Element *v4l2element,
|
|||
control.id = attribute_num;
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_G_CTRL, &control) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to get value for control %d on device %s: %s",
|
||||
attribute_num, v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -779,7 +779,7 @@ gst_v4l2_set_attribute (GstV4l2Element *v4l2element,
|
|||
control.value = value;
|
||||
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_S_CTRL, &control) < 0) {
|
||||
gst_element_error (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (""),
|
||||
("Failed to set value %d for control %d on device %s: %s",
|
||||
value, attribute_num, v4l2element->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#define GST_V4L2_CHECK_OPEN(element) \
|
||||
if (!GST_V4L2_IS_OPEN(element)) \
|
||||
{ \
|
||||
gst_element_error (element, RESOURCE, TOO_LAZY, \
|
||||
GST_ELEMENT_ERROR (element, RESOURCE, TOO_LAZY, \
|
||||
(_("Device is not open")), NULL); \
|
||||
return FALSE; \
|
||||
}
|
||||
|
@ -48,7 +48,7 @@
|
|||
#define GST_V4L2_CHECK_NOT_OPEN(element) \
|
||||
if (GST_V4L2_IS_OPEN(element)) \
|
||||
{ \
|
||||
gst_element_error (element, RESOURCE, TOO_LAZY, \
|
||||
GST_ELEMENT_ERROR (element, RESOURCE, TOO_LAZY, \
|
||||
(_("Device is open")), NULL); \
|
||||
return FALSE; \
|
||||
}
|
||||
|
@ -57,7 +57,7 @@
|
|||
#define GST_V4L2_CHECK_OVERLAY(element) \
|
||||
if (!GST_V4L2_IS_OVERLAY(element)) \
|
||||
{ \
|
||||
gst_element_error (element, RESOURCE, TOO_LAZY, \
|
||||
GST_ELEMENT_ERROR (element, RESOURCE, TOO_LAZY, \
|
||||
NULL, ("Device cannot handle overlay")); \
|
||||
return FALSE; \
|
||||
}
|
||||
|
@ -66,7 +66,7 @@
|
|||
#define GST_V4L2_CHECK_ACTIVE(element) \
|
||||
if (!GST_V4L2_IS_ACTIVE(element)) \
|
||||
{ \
|
||||
gst_element_error (element, RESOURCE, SETTINGS, \
|
||||
GST_ELEMENT_ERROR (element, RESOURCE, SETTINGS, \
|
||||
NULL, ("Device is not in streaming mode")); \
|
||||
return FALSE; \
|
||||
}
|
||||
|
@ -75,7 +75,7 @@
|
|||
#define GST_V4L2_CHECK_NOT_ACTIVE(element) \
|
||||
if (GST_V4L2_IS_ACTIVE(element)) \
|
||||
{ \
|
||||
gst_element_error (element, RESOURCE, SETTINGS, \
|
||||
GST_ELEMENT_ERROR (element, RESOURCE, SETTINGS, \
|
||||
NULL, ("Device is in streaming mode")); \
|
||||
return FALSE; \
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ gst_v4l2src_fill_format_list (GstV4l2Src *v4l2src)
|
|||
if (errno == EINVAL) {
|
||||
break; /* end of enumeration */
|
||||
} else {
|
||||
gst_element_error (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||
("failed to get number %d in pixelformat enumeration for %s: %s",
|
||||
n, GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||
g_free (format);
|
||||
|
@ -117,7 +117,7 @@ gst_v4l2src_queue_frame (GstV4l2Src *v4l2src,
|
|||
GST_LOG_OBJECT (v4l2src, "queueing frame %u", i);
|
||||
|
||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_QBUF, &v4l2src->pool->buffers[i].buffer) < 0) {
|
||||
gst_element_error (v4l2src, RESOURCE, WRITE,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, WRITE,
|
||||
(_("Could not write to device \"%s\""), GST_V4L2ELEMENT(v4l2src)->device),
|
||||
("Error queueing buffer %u on device %s", i, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -142,7 +142,7 @@ gst_v4l2src_grab_frame (GstV4l2Src *v4l2src)
|
|||
while (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_DQBUF, &buffer) < 0) {
|
||||
/* if the sync() got interrupted, we can retry */
|
||||
if (errno != EINTR) {
|
||||
gst_element_error (v4l2src, RESOURCE, SYNC, NULL, ("could not sync on a buffer on device %s: %s",
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SYNC, NULL, ("could not sync on a buffer on device %s: %s",
|
||||
GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||
return -1;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ gst_v4l2src_get_capture (GstV4l2Src *v4l2src)
|
|||
|
||||
v4l2src->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_G_FMT, &v4l2src->format) < 0) {
|
||||
gst_element_error (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||
("failed to get pixelformat for device %s: %s",
|
||||
GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||
return FALSE;
|
||||
|
@ -206,7 +206,7 @@ gst_v4l2src_set_capture (GstV4l2Src *v4l2src,
|
|||
v4l2src->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
|
||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_S_FMT, &v4l2src->format) < 0) {
|
||||
gst_element_error (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||
("failed to set pixelformat to %s @ %dx%d for device %s: %s",
|
||||
fmt->description, width, height, GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||
return FALSE;
|
||||
|
@ -245,14 +245,14 @@ gst_v4l2src_capture_init (GstV4l2Src *v4l2src)
|
|||
v4l2src->breq.type = v4l2src->format.type;
|
||||
v4l2src->breq.memory = V4L2_MEMORY_MMAP;
|
||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_REQBUFS, &v4l2src->breq) < 0) {
|
||||
gst_element_error (v4l2src, RESOURCE, READ,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
|
||||
(_("Could not get buffers from device \"%s\""), GST_V4L2ELEMENT(v4l2src)->device),
|
||||
("error requesting %d buffers: %s", v4l2src->breq.count, g_strerror (errno)));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (v4l2src->breq.count < GST_V4L2_MIN_BUFFERS) {
|
||||
gst_element_error (v4l2src, RESOURCE, READ,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ,
|
||||
(_("Could not get enough buffers from device \"%s\""), GST_V4L2ELEMENT(v4l2src)->device),
|
||||
("we received %d, we want at least %d", v4l2src->breq.count, GST_V4L2_MIN_BUFFERS));
|
||||
v4l2src->breq.count = buffers;
|
||||
|
@ -280,7 +280,7 @@ gst_v4l2src_capture_init (GstV4l2Src *v4l2src)
|
|||
buffer->buffer.index = n;
|
||||
buffer->buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_QUERYBUF, &buffer->buffer) < 0) {
|
||||
gst_element_error (v4l2src, RESOURCE, READ, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, NULL,
|
||||
("Could not get buffer properties of buffer %d: %s", n, g_strerror (errno)));
|
||||
gst_v4l2src_capture_deinit(v4l2src);
|
||||
return FALSE;
|
||||
|
@ -288,7 +288,7 @@ gst_v4l2src_capture_init (GstV4l2Src *v4l2src)
|
|||
buffer->start = mmap (0, buffer->buffer.length, PROT_READ|PROT_WRITE, MAP_SHARED,
|
||||
GST_V4L2ELEMENT(v4l2src)->video_fd, buffer->buffer.m.offset);
|
||||
if (buffer->start == MAP_FAILED) {
|
||||
gst_element_error (v4l2src, RESOURCE, READ, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, NULL,
|
||||
("Could not mmap video buffer %d: %s", n, g_strerror (errno)));
|
||||
buffer->start = 0;
|
||||
gst_v4l2src_capture_deinit (v4l2src);
|
||||
|
@ -328,7 +328,7 @@ gst_v4l2src_capture_start (GstV4l2Src *v4l2src)
|
|||
v4l2src->quit = FALSE;
|
||||
|
||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_STREAMON, &type) < 0) {
|
||||
gst_element_error (v4l2src, RESOURCE, OPEN_READ, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, OPEN_READ, NULL,
|
||||
("Error starting streaming capture from device %s: %s",
|
||||
GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno)));
|
||||
return FALSE;
|
||||
|
@ -356,7 +356,7 @@ gst_v4l2src_capture_stop (GstV4l2Src *v4l2src)
|
|||
/* we actually need to sync on all queued buffers but not
|
||||
* on the non-queued ones */
|
||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_STREAMOFF, &type) < 0) {
|
||||
gst_element_error (v4l2src, RESOURCE, CLOSE, NULL,
|
||||
GST_ELEMENT_ERROR (v4l2src, RESOURCE, CLOSE, NULL,
|
||||
("Error stopping streaming capture from device %s: %s",
|
||||
GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue