GST_ELEMENT_ERROR

Original commit message from CVS:
GST_ELEMENT_ERROR
This commit is contained in:
Thomas Vander Stichele 2004-01-29 23:20:44 +00:00
parent 4ea716a6fe
commit 611d7f4dd0
10 changed files with 34 additions and 29 deletions

View file

@ -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> 2004-01-29 Julien MOUTTE <julien@moutte.net>
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get): Fixing seeking * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get): Fixing seeking

View file

@ -680,7 +680,7 @@ dvdnavsrc_user_op (DVDNavSrc *src, int op)
} }
return; return;
naverr: naverr:
gst_element_error (src, LIBRARY, TOO_LAZY, NULL, GST_ELEMENT_ERROR (src, LIBRARY, TOO_LAZY, NULL,
("user op %d failure: %s", op, dvdnav_err_to_string(src->dvdnav))); ("user op %d failure: %s", op, dvdnav_err_to_string(src->dvdnav)));
} }
@ -851,14 +851,14 @@ dvdnavsrc_get (GstPad *pad)
while (!have_buf) { while (!have_buf) {
buf = gst_buffer_new_and_alloc (DVD_VIDEO_LB_LEN); buf = gst_buffer_new_and_alloc (DVD_VIDEO_LB_LEN);
if (!buf) { if (!buf) {
gst_element_error (src, CORE, TOO_LAZY, NULL, ("Failed to create a new GstBuffer")); GST_ELEMENT_ERROR (src, CORE, TOO_LAZY, NULL, ("Failed to create a new GstBuffer"));
return NULL; return NULL;
} }
data = GST_BUFFER_DATA(buf); data = GST_BUFFER_DATA(buf);
if (dvdnav_get_next_block (src->dvdnav, data, &event, &len) != if (dvdnav_get_next_block (src->dvdnav, data, &event, &len) !=
DVDNAV_STATUS_OK) { DVDNAV_STATUS_OK) {
gst_element_error (src, STREAM, DECODE, NULL, GST_ELEMENT_ERROR (src, STREAM, DECODE, NULL,
("dvdnav_get_next_block error: %s\n", dvdnav_err_to_string(src->dvdnav))); ("dvdnav_get_next_block error: %s\n", dvdnav_err_to_string(src->dvdnav)));
return NULL; return NULL;
} }
@ -876,7 +876,7 @@ dvdnavsrc_get (GstPad *pad)
* dvdnav_still_skip */ * dvdnav_still_skip */
dvdnavsrc_print_event (src, data, event, len); dvdnavsrc_print_event (src, data, event, len);
if (dvdnav_still_skip (src->dvdnav) != DVDNAV_STATUS_OK) { if (dvdnav_still_skip (src->dvdnav) != DVDNAV_STATUS_OK) {
gst_element_error (src, STREAM, TOO_LAZY, NULL, ("dvdnav_still_skip error: %s\n", GST_ELEMENT_ERROR (src, STREAM, TOO_LAZY, NULL, ("dvdnav_still_skip error: %s\n",
dvdnav_err_to_string(src->dvdnav))); dvdnav_err_to_string(src->dvdnav)));
/* FIXME: close the stream??? */ /* FIXME: close the stream??? */
} }

View file

@ -354,7 +354,7 @@ gst_lame_sink_link (GstPad *pad, const GstCaps *caps)
gst_structure_get_int (structure, "channels", &lame->num_channels); gst_structure_get_int (structure, "channels", &lame->num_channels);
if (!gst_lame_setup (lame)) { if (!gst_lame_setup (lame)) {
gst_element_error (lame, CORE, NEGOTIATION, NULL, GST_ELEMENT_ERROR (lame, CORE, NEGOTIATION, NULL,
("could not initialize encoder (wrong parameters?)")); ("could not initialize encoder (wrong parameters?)"));
return GST_PAD_LINK_REFUSED; return GST_PAD_LINK_REFUSED;
} }
@ -785,7 +785,7 @@ gst_lame_chain (GstPad *pad, GstData *_data)
if (!lame->initialized) { if (!lame->initialized) {
gst_buffer_unref (buf); gst_buffer_unref (buf);
gst_element_error (lame, CORE, NEGOTIATION, NULL, ("encoder not initialized (input is not audio?)")); GST_ELEMENT_ERROR (lame, CORE, NEGOTIATION, NULL, ("encoder not initialized (input is not audio?)"));
return; return;
} }

View file

@ -614,7 +614,7 @@ gst_id3_tag_handle_event (GstPad *pad, GstEvent *event)
gst_event_discont_get_value (event, GST_FORMAT_BYTES, &value); gst_event_discont_get_value (event, GST_FORMAT_BYTES, &value);
if (value != (tag->buffer ? GST_BUFFER_OFFSET (tag->buffer) + GST_BUFFER_SIZE (tag->buffer) if (value != (tag->buffer ? GST_BUFFER_OFFSET (tag->buffer) + GST_BUFFER_SIZE (tag->buffer)
: 0)) : 0))
gst_element_error (tag, CORE, EVENT, NULL, ("Seek during ID3v2 tag reading")); GST_ELEMENT_ERROR (tag, CORE, EVENT, NULL, ("Seek during ID3v2 tag reading"));
gst_data_unref (GST_DATA (event)); gst_data_unref (GST_DATA (event));
break; break;
} }
@ -623,7 +623,7 @@ gst_id3_tag_handle_event (GstPad *pad, GstEvent *event)
gst_id3_tag_set_state (tag, GST_ID3_TAG_STATE_READING_V1_TAG); gst_id3_tag_set_state (tag, GST_ID3_TAG_STATE_READING_V1_TAG);
break; break;
case GST_ID3_TAG_STATE_READING_V1_TAG: case GST_ID3_TAG_STATE_READING_V1_TAG:
gst_element_error (tag, CORE, EVENT, NULL, ("Seek during ID3v1 tag reading")); GST_ELEMENT_ERROR (tag, CORE, EVENT, NULL, ("Seek during ID3v1 tag reading"));
gst_data_unref (GST_DATA (event)); gst_data_unref (GST_DATA (event));
break; break;
case GST_ID3_TAG_STATE_SEEKING_TO_NORMAL: case GST_ID3_TAG_STATE_SEEKING_TO_NORMAL:
@ -747,7 +747,7 @@ gst_id3_tag_do_typefind (GstID3Tag *tag, GstBuffer *buffer)
if (find.best_probability > 0) { if (find.best_probability > 0) {
return find.caps; return find.caps;
} else { } else {
gst_element_error (tag, CORE, CAPS, NULL, ("no caps found")); GST_ELEMENT_ERROR (tag, CORE, CAPS, NULL, ("no caps found"));
return NULL; return NULL;
} }
} }
@ -875,7 +875,7 @@ gst_id3_tag_chain (GstPad *pad, GstData *data)
GST_SEEK_FLAG_FLUSH, tag->v2tag_size))) { GST_SEEK_FLAG_FLUSH, tag->v2tag_size))) {
gst_id3_tag_set_state (tag, GST_ID3_TAG_STATE_SEEKING_TO_NORMAL); gst_id3_tag_set_state (tag, GST_ID3_TAG_STATE_SEEKING_TO_NORMAL);
} else { } else {
gst_element_error (tag, CORE, SEEK, NULL, ("can't seek back to beginning from reading ID3v1 tag")); GST_ELEMENT_ERROR (tag, CORE, SEEK, NULL, ("can't seek back to beginning from reading ID3v1 tag"));
} }
} else { } else {
gst_id3_tag_send_tag_event (tag); gst_id3_tag_send_tag_event (tag);

View file

@ -992,7 +992,7 @@ gst_mad_chain (GstPad *pad, GstData *_data)
break; break;
} }
if (!MAD_RECOVERABLE (mad->stream.error)) { if (!MAD_RECOVERABLE (mad->stream.error)) {
gst_element_error (mad, STREAM, DECODE, NULL, NULL); GST_ELEMENT_ERROR (mad, STREAM, DECODE, NULL, NULL);
return; return;
} }
else if (mad->stream.error == MAD_ERROR_LOSTSYNC) { else if (mad->stream.error == MAD_ERROR_LOSTSYNC) {

View file

@ -476,7 +476,7 @@ gst_mpeg2dec_chain (GstPad *pad, GstData *_data)
info->sequence->transfer_characteristics, info->sequence->matrix_coefficients); info->sequence->transfer_characteristics, info->sequence->matrix_coefficients);
if (!gst_mpeg2dec_negotiate_format (mpeg2dec)) { if (!gst_mpeg2dec_negotiate_format (mpeg2dec)) {
gst_element_error (mpeg2dec, CORE, NEGOTIATION, NULL, NULL); GST_ELEMENT_ERROR (mpeg2dec, CORE, NEGOTIATION, NULL, NULL);
goto exit; goto exit;
} }

View file

@ -410,19 +410,19 @@ gst_siddec_loop (GstElement *element)
} }
if (siddec->state == SID_STATE_LOAD_TUNE) { if (siddec->state == SID_STATE_LOAD_TUNE) {
if (!siddec->tune->load (siddec->tune_buffer, siddec->tune_len)) { if (!siddec->tune->load (siddec->tune_buffer, siddec->tune_len)) {
gst_element_error (siddec, LIBRARY, TOO_LAZY, (NULL), (NULL)); GST_ELEMENT_ERROR (siddec, LIBRARY, TOO_LAZY, (NULL), (NULL));
return; return;
} }
//update_metadata (siddec); //update_metadata (siddec);
if (!siddec_negotiate (siddec)) { if (!siddec_negotiate (siddec)) {
gst_element_error (siddec, CORE, NEGOTIATION, (NULL), (NULL)); GST_ELEMENT_ERROR (siddec, CORE, NEGOTIATION, (NULL), (NULL));
return; return;
} }
if (!sidEmuInitializeSong (*siddec->engine, *siddec->tune, siddec->tune_number)) { if (!sidEmuInitializeSong (*siddec->engine, *siddec->tune, siddec->tune_number)) {
gst_element_error (siddec, LIBRARY, TOO_LAZY, (NULL), (NULL)); GST_ELEMENT_ERROR (siddec, LIBRARY, TOO_LAZY, (NULL), (NULL));
return; return;
} }

View file

@ -168,7 +168,7 @@ gst_riff_peek_head (GstRiffRead *riff,
gst_pad_event_default (riff->sinkpad, event); gst_pad_event_default (riff->sinkpad, event);
} else { } else {
gst_event_unref (event); gst_event_unref (event);
gst_element_error (riff, RESOURCE, READ, NULL, NULL); GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
} }
return FALSE; return FALSE;
} }
@ -197,7 +197,7 @@ gst_riff_read_element_data (GstRiffRead *riff,
GstBuffer *buf = NULL; GstBuffer *buf = NULL;
if (gst_bytestream_peek (riff->bs, &buf, length) != length) { if (gst_bytestream_peek (riff->bs, &buf, length) != length) {
gst_element_error (riff, RESOURCE, READ, NULL, NULL); GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
if (buf) if (buf)
gst_buffer_unref (buf); gst_buffer_unref (buf);
return NULL; return NULL;
@ -240,7 +240,7 @@ gst_riff_read_seek (GstRiffRead *riff,
/* now seek */ /* now seek */
if (!gst_bytestream_seek (riff->bs, offset, GST_SEEK_METHOD_SET)) { if (!gst_bytestream_seek (riff->bs, offset, GST_SEEK_METHOD_SET)) {
gst_element_error (riff, RESOURCE, SEEK, NULL, NULL); GST_ELEMENT_ERROR (riff, RESOURCE, SEEK, NULL, NULL);
return NULL; return NULL;
} }
@ -252,7 +252,7 @@ gst_riff_read_seek (GstRiffRead *riff,
/* get the discont event and return */ /* get the discont event and return */
gst_bytestream_get_status (riff->bs, &remaining, &event); gst_bytestream_get_status (riff->bs, &remaining, &event);
if (!event || GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) { if (!event || GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
gst_element_error (riff, CORE, EVENT, NULL, GST_ELEMENT_ERROR (riff, CORE, EVENT, NULL,
("No discontinuity event after seek")); ("No discontinuity event after seek"));
if (event) if (event)
gst_event_unref (event); gst_event_unref (event);
@ -296,7 +296,7 @@ gst_riff_peek_list (GstRiffRead *riff)
} }
if (gst_bytestream_peek_bytes (riff->bs, &data, 12) != 12) { if (gst_bytestream_peek_bytes (riff->bs, &data, 12) != 12) {
gst_element_error (riff, RESOURCE, READ, NULL, NULL); GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
return 0; return 0;
} }
@ -656,7 +656,7 @@ gst_riff_read_list (GstRiffRead *riff,
} }
gst_bytestream_flush_fast (riff->bs, 8); gst_bytestream_flush_fast (riff->bs, 8);
if (gst_bytestream_peek_bytes (riff->bs, &data, 4) != 4) { if (gst_bytestream_peek_bytes (riff->bs, &data, 4) != 4) {
gst_element_error (riff, RESOURCE, READ, NULL, NULL); GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
return FALSE; return FALSE;
} }
gst_bytestream_flush_fast (riff->bs, 4); gst_bytestream_flush_fast (riff->bs, 4);
@ -844,14 +844,14 @@ gst_riff_read_header (GstRiffRead *riff,
if (!gst_riff_peek_head (riff, &tag, &length, NULL)) if (!gst_riff_peek_head (riff, &tag, &length, NULL))
return FALSE; return FALSE;
if (tag != GST_RIFF_TAG_RIFF) { if (tag != GST_RIFF_TAG_RIFF) {
gst_element_error (riff, STREAM, WRONG_TYPE, NULL, NULL); GST_ELEMENT_ERROR (riff, STREAM, WRONG_TYPE, NULL, NULL);
return FALSE; return FALSE;
} }
gst_bytestream_flush_fast (riff->bs, 8); gst_bytestream_flush_fast (riff->bs, 8);
/* doctype */ /* doctype */
if (gst_bytestream_peek_bytes (riff->bs, &data, 4) != 4) { if (gst_bytestream_peek_bytes (riff->bs, &data, 4) != 4) {
gst_element_error (riff, RESOURCE, READ, NULL, NULL); GST_ELEMENT_ERROR (riff, RESOURCE, READ, NULL, NULL);
return FALSE; return FALSE;
} }
gst_bytestream_flush_fast (riff->bs, 4); gst_bytestream_flush_fast (riff->bs, 4);

View file

@ -597,7 +597,7 @@ gst_asf_demux_process_segment (GstASFDemux *asf_demux,
/* It's uncompressed with replic data*/ /* It's uncompressed with replic data*/
if (replic_size < 8) { if (replic_size < 8) {
gst_element_error (asf_demux, STREAM, DEMUX, NULL, ("The payload has replicated data but the size is less than 8")); GST_ELEMENT_ERROR (asf_demux, STREAM, DEMUX, NULL, ("The payload has replicated data but the size is less than 8"));
return FALSE; return FALSE;
} }
_read_replicated_data (asf_demux, &replicated_data_header); _read_replicated_data (asf_demux, &replicated_data_header);
@ -644,7 +644,7 @@ gst_asf_demux_process_segment (GstASFDemux *asf_demux,
segment_info.segment_size = segment_info.chunk_size; segment_info.segment_size = segment_info.chunk_size;
if (segment_info.chunk_size > packet_info->size_left) { if (segment_info.chunk_size > packet_info->size_left) {
gst_element_error (asf_demux, STREAM, DEMUX, NULL, ("Payload chunk overruns packet size.")); GST_ELEMENT_ERROR (asf_demux, STREAM, DEMUX, NULL, ("Payload chunk overruns packet size."));
return FALSE; return FALSE;
} }
@ -823,7 +823,7 @@ gst_asf_demux_process_stream (GstASFDemux *asf_demux, guint64 *obj_size)
gst_bytestream_flush (asf_demux->bs, object.stream_specific_size); gst_bytestream_flush (asf_demux->bs, object.stream_specific_size);
break; break;
default: default:
gst_element_error (asf_demux, STREAM, DEMUX, NULL, ("Audio stream using unknown error correction")); GST_ELEMENT_ERROR (asf_demux, STREAM, DEMUX, NULL, ("Audio stream using unknown error correction"));
return FALSE; return FALSE;
} }
@ -853,7 +853,7 @@ gst_asf_demux_process_stream (GstASFDemux *asf_demux, guint64 *obj_size)
} }
break; break;
default: default:
gst_element_error (asf_demux, STREAM, WRONG_TYPE, NULL, NULL); GST_ELEMENT_ERROR (asf_demux, STREAM, WRONG_TYPE, NULL, NULL);
return FALSE; return FALSE;
} }
@ -965,7 +965,7 @@ gst_asf_demux_get_stream (GstASFDemux *asf_demux,
} }
/* Base case if we haven't found one at all */ /* Base case if we haven't found one at all */
gst_element_error (asf_demux, STREAM, DEMUX, NULL, ("Segment found for undefined stream: (%d)", id)); GST_ELEMENT_ERROR (asf_demux, STREAM, DEMUX, NULL, ("Segment found for undefined stream: (%d)", id));
return NULL; return NULL;
} }

View file

@ -500,7 +500,7 @@ gst_mpeg_parse_loop (GstElement *element)
"systemstream", G_TYPE_BOOLEAN, TRUE, "systemstream", G_TYPE_BOOLEAN, TRUE,
"parsed", G_TYPE_BOOLEAN, TRUE, NULL)) < 0) "parsed", G_TYPE_BOOLEAN, TRUE, NULL)) < 0)
{ {
gst_element_error (mpeg_parse, CORE, NEGOTIATION, NULL, NULL); GST_ELEMENT_ERROR (mpeg_parse, CORE, NEGOTIATION, NULL, NULL);
return; return;
} }
} }