use new error signal and classification

Original commit message from CVS:
use new error signal and classification
This commit is contained in:
Thomas Vander Stichele 2004-01-18 21:46:58 +00:00
parent 17b460f838
commit 7a033494ea
12 changed files with 177 additions and 36 deletions

141
ChangeLog
View file

@ -1,3 +1,144 @@
2004-01-18 Thomas Vander Stichele <thomas at apestaart dot org>
* examples/gstplay/player.c: (main):
* ext/aalib/gstaasink.c: (gst_aasink_open):
* ext/alsa/gstalsa.c: (gst_alsa_link), (gst_alsa_xrun_recovery):
* ext/alsa/gstalsasink.c: (gst_alsa_sink_loop):
* ext/alsa/gstalsasrc.c: (gst_alsa_src_loop):
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file):
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file):
* ext/divx/gstdivxdec.c: (gst_divxdec_setup), (gst_divxdec_chain):
* ext/dv/gstdvdec.c: (gst_dvdec_loop):
* ext/dvdnav/dvdnavsrc.c: (dvdnavsrc_user_op), (dvdnavsrc_get):
* ext/esd/esdmon.c: (gst_esdmon_get):
* ext/esd/esdsink.c: (gst_esdsink_chain):
* ext/faac/gstfaac.c: (gst_faac_chain):
* ext/faad/gstfaad.c: (gst_faad_chain):
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop):
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_loop):
* ext/flac/gstflacdec.c: (gst_flacdec_error_callback),
(gst_flacdec_loop):
* ext/flac/gstflacenc.c: (gst_flacenc_chain):
* ext/flac/gstflactag.c: (gst_flac_tag_chain):
* ext/gdk_pixbuf/gstgdkpixbuf.c: (gst_gdk_pixbuf_chain):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_open_file),
(gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (audiocast_init),
(gst_gnomevfssrc_open_file):
* ext/ivorbis/vorbisfile.c: (gst_ivorbisfile_loop):
* ext/lame/gstlame.c: (gst_lame_sink_link), (gst_lame_chain):
* ext/lcs/gstcolorspace.c: (gst_colorspace_srcconnect_func):
* ext/mad/gstid3tag.c: (gst_id3_tag_handle_event),
(gst_id3_tag_do_typefind), (gst_id3_tag_chain):
* ext/mad/gstmad.c: (gst_mad_chain):
* ext/mikmod/gstmikmod.c: (gst_mikmod_loop):
* ext/mpeg2dec/gstmpeg2dec.c:
* ext/mpeg2enc/gstmpeg2enc.cc:
* ext/mpeg2enc/gstmpeg2encpicturereader.cc:
* ext/mplex/gstmplex.cc:
* ext/mplex/gstmplexibitstream.cc:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_chain),
(gst_ogg_demux_push), (gst_ogg_pad_push):
* ext/raw1394/gstdv1394src.c:
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_lock),
(gst_sdlvideosink_initsdl), (gst_sdlvideosink_create):
* ext/sidplay/gstsiddec.cc:
* ext/sndfile/gstsf.c: (gst_sf_open_file), (gst_sf_close_file),
(gst_sf_loop):
* ext/speex/gstspeexenc.c: (gst_speexenc_chain):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_chain):
* ext/tarkin/gsttarkinenc.c: (gst_tarkinenc_chain):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_chain):
* ext/vorbis/vorbisfile.c: (gst_vorbisfile_loop):
* ext/xvid/gstxviddec.c: (gst_xviddec_setup), (gst_xviddec_chain):
* ext/xvid/gstxvidenc.c: (gst_xvidenc_setup), (gst_xvidenc_chain):
* gst-libs/gst/Makefile.am:
* gst-libs/gst/riff/riff-read.c: (gst_riff_peek_head),
(gst_riff_read_element_data), (gst_riff_read_seek),
(gst_riff_peek_list), (gst_riff_read_list), (gst_riff_read_header):
* gst/adder/gstadder.c: (gst_adder_parse_caps), (gst_adder_loop):
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_process_segment),
(gst_asf_demux_process_stream), (gst_asf_demux_get_stream):
* gst/avi/gstavidemux.c: (gst_avi_demux_stream_init),
(gst_avi_demux_add_stream), (gst_avi_demux_stream_header):
* gst/avi/gstavimux.c: (gst_avimux_stop_file):
* gst/flx/gstflxdec.c: (gst_flxdec_loop):
* gst/goom/gstgoom.c: (gst_goom_chain):
* gst/id3/gstid3types.c: (gst_id3types_loop):
* gst/intfloat/gstfloat2int.c: (gst_float2int_loop):
* gst/intfloat/gstint2float.c: (gst_int2float_chain_gint16):
* gst/matroska/ebml-read.c: (gst_ebml_read_element_id),
(gst_ebml_read_element_length), (gst_ebml_read_element_data),
(gst_ebml_read_seek), (gst_ebml_read_uint), (gst_ebml_read_sint),
(gst_ebml_read_float), (gst_ebml_read_header):
* gst/matroska/matroska-demux.c: (gst_matroska_demux_init_stream),
(gst_matroska_demux_parse_blockgroup):
* gst/modplug/gstmodplug.cc:
* gst/monoscope/gstmonoscope.c: (gst_monoscope_chain):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_loop):
* gst/oneton/gstoneton.c: (gst_oneton_chain):
* gst/silence/gstsilence.c: (gst_silence_get):
* gst/sine/gstsinesrc.c: (gst_sinesrc_get):
* gst/smpte/gstsmpte.c: (gst_smpte_loop):
* gst/speed/gstspeed.c: (speed_loop):
* gst/tags/gstvorbistag.c: (gst_vorbis_tag_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
* gst/volenv/gstvolenv.c: (gst_volenv_chain):
* gst/wavenc/gstwavenc.c: (gst_wavenc_chain):
* gst/wavparse/gstwavparse.c: (gst_wavparse_parse_fmt),
(gst_wavparse_loop):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_open),
(dxr3audiosink_set_mode_pcm), (dxr3audiosink_set_mode_ac3),
(dxr3audiosink_close):
* sys/dxr3/dxr3spusink.c: (dxr3spusink_open), (dxr3spusink_close):
* sys/dxr3/dxr3videosink.c: (dxr3videosink_open),
(dxr3videosink_close), (dxr3videosink_write_data):
* sys/oss/gstosselement.c: (gst_osselement_open_audio):
* sys/oss/gstosselement.h:
* sys/oss/gstosssink.c: (gst_osssink_get_type), (gst_osssink_init),
(gst_osssink_chain):
* sys/oss/gstosssrc.c: (gst_osssrc_get):
* sys/v4l/gstv4lmjpegsink.c: (gst_v4lmjpegsink_chain):
* sys/v4l/gstv4lmjpegsrc.c: (gst_v4lmjpegsrc_buffer_free):
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_buffer_free):
* sys/v4l/v4l-overlay_calls.c: (gst_v4l_set_window),
(gst_v4l_enable_overlay):
* sys/v4l/v4l_calls.c: (gst_v4l_get_capabilities), (gst_v4l_open),
(gst_v4l_set_chan_norm), (gst_v4l_get_signal),
(gst_v4l_get_frequency), (gst_v4l_set_frequency),
(gst_v4l_get_picture), (gst_v4l_set_picture), (gst_v4l_get_audio),
(gst_v4l_set_audio):
* sys/v4l/v4l_calls.h:
* sys/v4l/v4lmjpegsink_calls.c: (gst_v4lmjpegsink_sync_thread),
(gst_v4lmjpegsink_queue_frame), (gst_v4lmjpegsink_set_playback),
(gst_v4lmjpegsink_playback_init),
(gst_v4lmjpegsink_playback_start):
* sys/v4l/v4lmjpegsrc_calls.c: (gst_v4lmjpegsrc_queue_frame),
(gst_v4lmjpegsrc_sync_next_frame), (gst_v4lmjpegsrc_set_capture),
(gst_v4lmjpegsrc_set_capture_m), (gst_v4lmjpegsrc_capture_init),
(gst_v4lmjpegsrc_requeue_frame):
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_queue_frame),
(gst_v4lsrc_sync_frame), (gst_v4lsrc_capture_init),
(gst_v4lsrc_requeue_frame), (gst_v4lsrc_try_palette):
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_get):
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_fill_format_list),
(gst_v4l2src_queue_frame), (gst_v4l2src_grab_frame),
(gst_v4l2src_get_capture), (gst_v4l2src_set_capture),
(gst_v4l2src_capture_init), (gst_v4l2src_capture_start),
(gst_v4l2src_capture_stop):
* sys/vcd/vcdsrc.c: (vcdsrc_open_file):
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_chain):
* sys/xvideo/xvideosink.c: (gst_xvideosink_buffer_new),
(gst_xvideosink_sinkconnect), (gst_xvideosink_chain),
(gst_xvideosink_xwindow_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_chain):
use new error signal, function and categories
2004-01-18 Jeremy Simon <jesimon@libertysurf.fr>
* configure.ac:

View file

@ -115,7 +115,7 @@ main (int argc, char *argv[])
/* Getting default audio and video plugins from GConf */
audio_sink = gst_element_factory_make ("osssink", "audio_sink");
video_sink = gst_element_factory_make ("xvimagesink", "video_sink");
video_sink = gst_element_factory_make ("ximagesink", "video_sink");
vis_element = gst_element_factory_make ("goom", "vis_element");
data_src = gst_element_factory_make ("gnomevfssrc", "source");

View file

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

View file

@ -354,8 +354,8 @@ gst_lame_sink_link (GstPad *pad, const GstCaps *caps)
gst_structure_get_int (structure, "channels", &lame->num_channels);
if (!gst_lame_setup (lame)) {
gst_element_error (GST_ELEMENT (lame),
"could not initialize encoder (wrong parameters?)");
gst_element_error (lame, CORE, NEGOTIATION, NULL,
("could not initialize encoder (wrong parameters?)"));
return GST_PAD_LINK_REFUSED;
}
@ -785,7 +785,7 @@ gst_lame_chain (GstPad *pad, GstData *_data)
if (!lame->initialized) {
gst_buffer_unref (buf);
gst_element_error (GST_ELEMENT (lame), "encoder not initialized (input is not audio?)");
gst_element_error (lame, CORE, NEGOTIATION, NULL, ("encoder not initialized (input is not audio?)"));
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);
if (value != (tag->buffer ? GST_BUFFER_OFFSET (tag->buffer) + GST_BUFFER_SIZE (tag->buffer)
: 0))
gst_element_error (GST_ELEMENT (tag), "Seek during ID3v2 tag reading");
gst_element_error (tag, CORE, EVENT, NULL, ("Seek during ID3v2 tag reading"));
gst_data_unref (GST_DATA (event));
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);
break;
case GST_ID3_TAG_STATE_READING_V1_TAG:
gst_element_error (GST_ELEMENT (tag), "Seek during ID3v1 tag reading");
gst_element_error (tag, CORE, EVENT, NULL, ("Seek during ID3v1 tag reading"));
gst_data_unref (GST_DATA (event));
break;
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) {
return find.caps;
} else {
gst_element_error (GST_ELEMENT (tag), "no caps found");
gst_element_error (tag, CORE, CAPS, NULL, ("no caps found"));
return NULL;
}
}
@ -875,7 +875,7 @@ gst_id3_tag_chain (GstPad *pad, GstData *data)
GST_SEEK_FLAG_FLUSH, tag->v2tag_size))) {
gst_id3_tag_set_state (tag, GST_ID3_TAG_STATE_SEEKING_TO_NORMAL);
} else {
gst_element_error (GST_ELEMENT (tag), "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 {
gst_id3_tag_send_tag_event (tag);

View file

@ -992,7 +992,7 @@ gst_mad_chain (GstPad *pad, GstData *_data)
break;
}
if (!MAD_RECOVERABLE (mad->stream.error)) {
gst_element_error (GST_ELEMENT (mad), "fatal error decoding stream");
gst_element_error (mad, STREAM, DECODE, NULL, NULL);
return;
}
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);
if (!gst_mpeg2dec_negotiate_format (mpeg2dec)) {
gst_element_error (GST_ELEMENT (mpeg2dec), "could not negotiate format");
gst_element_error (mpeg2dec, CORE, NEGOTIATION, NULL, NULL);
goto exit;
}

View file

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

View file

@ -65,3 +65,4 @@ libgstinterfaces_@GST_MAJORMINOR@_la_LIBADD = \
libgstinterfaces_@GST_MAJORMINOR@_la_LDFLAGS = @GST_PLUGINS_LT_LDFLAGS@ -version-info @GST_PLUGINS_LIBVERSION@
noinst_HEADERS = gst-i18n-plugin.h

View file

@ -199,7 +199,7 @@ gst_riff_peek_head (GstRiffRead *riff,
gst_pad_event_default (riff->sinkpad, event);
} else {
gst_event_unref (event);
gst_element_error (GST_ELEMENT (riff), "Read error");
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
}
return FALSE;
}
@ -228,7 +228,7 @@ gst_riff_read_element_data (GstRiffRead *riff,
GstBuffer *buf = NULL;
if (gst_bytestream_peek (riff->bs, &buf, length) != length) {
gst_element_error (GST_ELEMENT (riff), "Read error");
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
if (buf)
gst_buffer_unref (buf);
return NULL;
@ -271,7 +271,7 @@ gst_riff_read_seek (GstRiffRead *riff,
/* now seek */
if (!gst_bytestream_seek (riff->bs, offset, GST_SEEK_METHOD_SET)) {
gst_element_error (GST_ELEMENT (riff), "Seek failed");
gst_element_error (riff, RESOURCE, SEEK, NULL, NULL);
return NULL;
}
@ -283,8 +283,8 @@ gst_riff_read_seek (GstRiffRead *riff,
/* get the discont event and return */
gst_bytestream_get_status (riff->bs, &remaining, &event);
if (!event || GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
gst_element_error (GST_ELEMENT (riff),
"No discontinuity event after seek");
gst_element_error (riff, CORE, EVENT, NULL,
("No discontinuity event after seek"));
if (event)
gst_event_unref (event);
return NULL;
@ -327,7 +327,7 @@ gst_riff_peek_list (GstRiffRead *riff)
}
if (gst_bytestream_peek_bytes (riff->bs, &data, 12) != 12) {
gst_element_error (GST_ELEMENT (riff), "Read error");
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
return 0;
}
@ -687,7 +687,7 @@ gst_riff_read_list (GstRiffRead *riff,
}
gst_bytestream_flush_fast (riff->bs, 8);
if (gst_bytestream_peek_bytes (riff->bs, &data, 4) != 4) {
gst_element_error (GST_ELEMENT (riff), "Read error");
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
return FALSE;
}
gst_bytestream_flush_fast (riff->bs, 4);
@ -845,15 +845,14 @@ gst_riff_read_header (GstRiffRead *riff,
if (!gst_riff_peek_head (riff, &tag, &length, NULL))
return FALSE;
if (tag != GST_RIFF_TAG_RIFF) {
gst_element_error (GST_ELEMENT (riff),
"Not a RIFF file");
gst_element_error (riff, STREAM, WRONG_TYPE, NULL, NULL);
return FALSE;
}
gst_bytestream_flush_fast (riff->bs, 8);
/* doctype */
if (gst_bytestream_peek_bytes (riff->bs, &data, 4) != 4) {
gst_element_error (GST_ELEMENT (riff), "Read error");
gst_element_error (riff, RESOURCE, READ, NULL, NULL);
return FALSE;
}
gst_bytestream_flush_fast (riff->bs, 4);

View file

@ -459,7 +459,7 @@ gst_asf_demux_process_segment (GstASFDemux *asf_demux,
/* It's uncompressed with replic data*/
if (replic_size < 8) {
gst_element_error (GST_ELEMENT (asf_demux), "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;
}
gst_asf_demux_read_object_header_rest (asf_demux, &ptr, 8);
@ -508,7 +508,7 @@ gst_asf_demux_process_segment (GstASFDemux *asf_demux,
segment_info.segment_size = segment_info.chunk_size;
if (segment_info.chunk_size > packet_info->size_left) {
gst_element_error (GST_ELEMENT (asf_demux), "Payload chunk overruns packet size.");
gst_element_error (asf_demux, STREAM, DEMUX, NULL, ("Payload chunk overruns packet size."));
return FALSE;
}
@ -701,7 +701,7 @@ gst_asf_demux_process_stream (GstASFDemux *asf_demux, guint64 *obj_size)
gst_bytestream_flush (asf_demux->bs, object->stream_specific_size);
break;
default:
gst_element_error (GST_ELEMENT (asf_demux), "Audio stream using unknown error correction");
gst_element_error (asf_demux, STREAM, DEMUX, NULL, ("Audio stream using unknown error correction"));
return FALSE;
}
@ -735,7 +735,7 @@ gst_asf_demux_process_stream (GstASFDemux *asf_demux, guint64 *obj_size)
}
break;
default:
gst_element_error (GST_ELEMENT (asf_demux), "Object is a stream of unrecognised type");
gst_element_error (asf_demux, STREAM, WRONG_TYPE, NULL, NULL);
return FALSE;
}
@ -857,7 +857,7 @@ gst_asf_demux_get_stream (GstASFDemux *asf_demux,
}
/* Base case if we haven't found one at all */
gst_element_error (GST_ELEMENT (asf_demux), "Segment found for undefined stream: (%d)", id);
gst_element_error (asf_demux, STREAM, DEMUX, NULL, ("Segment found for undefined stream: (%d)", id));
return NULL;
}

View file

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