mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
use new error signal and classification
Original commit message from CVS: use new error signal and classification
This commit is contained in:
parent
272db0c22e
commit
3b0cf935f6
29 changed files with 299 additions and 154 deletions
141
ChangeLog
141
ChangeLog
|
@ -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>
|
2004-01-18 Jeremy Simon <jesimon@libertysurf.fr>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -115,7 +115,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
/* Getting default audio and video plugins from GConf */
|
/* Getting default audio and video plugins from GConf */
|
||||||
audio_sink = gst_element_factory_make ("osssink", "audio_sink");
|
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");
|
vis_element = gst_element_factory_make ("goom", "vis_element");
|
||||||
data_src = gst_element_factory_make ("gnomevfssrc", "source");
|
data_src = gst_element_factory_make ("gnomevfssrc", "source");
|
||||||
|
|
||||||
|
|
|
@ -490,8 +490,8 @@ gst_aasink_open (GstAASink *aasink)
|
||||||
|
|
||||||
aasink->context = aa_autoinit (&aasink->ascii_surf);
|
aasink->context = aa_autoinit (&aasink->ascii_surf);
|
||||||
if (aasink->context == NULL) {
|
if (aasink->context == NULL) {
|
||||||
gst_element_error (GST_ELEMENT (aasink),
|
gst_element_error (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, NULL,
|
||||||
g_strdup("opening aalib context"));
|
("error opening aalib context"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
aa_autoinitkbd(aasink->context, 0);
|
aa_autoinitkbd(aasink->context, 0);
|
||||||
|
|
|
@ -783,7 +783,7 @@ gst_dvdec_loop (GstElement *element)
|
||||||
dvdec->bpp = 2;
|
dvdec->bpp = 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
gst_element_error (element, "could not negotiate");
|
gst_element_error (element, CORE, NEGOTIATION, NULL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,7 +267,7 @@ gst_esdmon_get (GstPad *pad)
|
||||||
"channels", G_TYPE_INT, esdmon->channels
|
"channels", G_TYPE_INT, esdmon->channels
|
||||||
)) <= 0)
|
)) <= 0)
|
||||||
{
|
{
|
||||||
gst_element_error (GST_ELEMENT (esdmon), "could not set caps");
|
gst_element_error (esdmon, CORE, NEGOTIATION, NULL, NULL);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,7 +265,8 @@ gst_esdsink_chain (GstPad *pad, GstData *_data)
|
||||||
esdsink = GST_ESDSINK (gst_pad_get_parent (pad));
|
esdsink = GST_ESDSINK (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
if (!esdsink->negotiated) {
|
if (!esdsink->negotiated) {
|
||||||
gst_element_error (GST_ELEMENT (esdsink), "not negotiated");
|
gst_element_error (esdsink, CORE, NEGOTIATION, NULL,
|
||||||
|
("element wasn't negotiated before chain function"));
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,9 +305,7 @@ gst_flacdec_error_callback (const FLAC__SeekableStreamDecoder *decoder,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (error);
|
gst_element_error (flacdec, STREAM, DECODE, NULL, (error));
|
||||||
|
|
||||||
gst_element_error (GST_ELEMENT (flacdec), error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static FLAC__SeekableStreamDecoderSeekStatus
|
static FLAC__SeekableStreamDecoderSeekStatus
|
||||||
|
@ -537,7 +535,8 @@ gst_flacdec_loop (GstElement *element)
|
||||||
GST_DEBUG ("flacdec: initializing decoder");
|
GST_DEBUG ("flacdec: initializing decoder");
|
||||||
res = FLAC__seekable_stream_decoder_init (flacdec->decoder);
|
res = FLAC__seekable_stream_decoder_init (flacdec->decoder);
|
||||||
if (res != FLAC__SEEKABLE_STREAM_DECODER_OK) {
|
if (res != FLAC__SEEKABLE_STREAM_DECODER_OK) {
|
||||||
gst_element_error (GST_ELEMENT (flacdec), FLAC__SeekableStreamDecoderStateString[res]);
|
gst_element_error (flacdec, LIBRARY, INIT, NULL,
|
||||||
|
(FLAC__SeekableStreamDecoderStateString[res]));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* FLAC__seekable_stream_decoder_process_metadata (flacdec->decoder);*/
|
/* FLAC__seekable_stream_decoder_process_metadata (flacdec->decoder);*/
|
||||||
|
|
|
@ -549,8 +549,8 @@ gst_flacenc_chain (GstPad *pad, GstData *_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!flacenc->negotiated) {
|
if (!flacenc->negotiated) {
|
||||||
gst_element_error (GST_ELEMENT (flacenc),
|
gst_element_error (flacenc, CORE, NEGOTIATION, NULL,
|
||||||
"format not negotiated");
|
("format wasn't negotiated before chain function"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,8 +575,8 @@ gst_flacenc_chain (GstPad *pad, GstData *_data)
|
||||||
gst_flacenc_set_metadata (flacenc);
|
gst_flacenc_set_metadata (flacenc);
|
||||||
state = FLAC__seekable_stream_encoder_init (flacenc->encoder);
|
state = FLAC__seekable_stream_encoder_init (flacenc->encoder);
|
||||||
if (state != FLAC__STREAM_ENCODER_OK) {
|
if (state != FLAC__STREAM_ENCODER_OK) {
|
||||||
gst_element_error (GST_ELEMENT (flacenc),
|
gst_element_error (flacenc, LIBRARY, INIT, NULL,
|
||||||
"could not initialize encoder (wrong parameters?)");
|
("could not initialize encoder (wrong parameters?)"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -610,8 +610,7 @@ gst_flacenc_chain (GstPad *pad, GstData *_data)
|
||||||
flacenc->data = NULL;
|
flacenc->data = NULL;
|
||||||
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
gst_element_error (GST_ELEMENT (flacenc),
|
gst_element_error (flacenc, STREAM, ENCODE, NULL, NULL);
|
||||||
"encoding error");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -295,7 +295,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data)
|
||||||
gst_buffer_unref (sub);
|
gst_buffer_unref (sub);
|
||||||
} else {
|
} else {
|
||||||
/* FIXME: does that work well with FLAC files containing ID3v2 tags ? */
|
/* FIXME: does that work well with FLAC files containing ID3v2 tags ? */
|
||||||
gst_element_error (GST_ELEMENT (tag), "Not a flac stream\n");
|
gst_element_error (tag, STREAM, WRONG_TYPE, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,8 +464,8 @@ gst_flac_tag_chain (GstPad *pad, GstData *data)
|
||||||
g_warning ("No tags found\n");
|
g_warning ("No tags found\n");
|
||||||
buffer = gst_buffer_new_and_alloc (12);
|
buffer = gst_buffer_new_and_alloc (12);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
gst_element_error (GST_ELEMENT (tag),
|
gst_element_error (tag, CORE, TOO_LAZY, NULL,
|
||||||
"Error creating padding block\n");
|
("Error creating 12-byte buffer for padding block"));
|
||||||
}
|
}
|
||||||
bzero (GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer));
|
bzero (GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer));
|
||||||
GST_BUFFER_DATA (buffer)[0] = 0x81; /* 0x80 = Last metadata block,
|
GST_BUFFER_DATA (buffer)[0] = 0x81; /* 0x80 = Last metadata block,
|
||||||
|
@ -481,7 +481,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data)
|
||||||
sizeof (header), NULL);
|
sizeof (header), NULL);
|
||||||
gst_tag_list_free (merged_tags);
|
gst_tag_list_free (merged_tags);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
gst_element_error (GST_ELEMENT (tag), "Error filling vorbis comments\n");
|
gst_element_error (tag, CORE, TAG, NULL, ("Error converting tag list to vorbiscomment buffer"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
size = GST_BUFFER_SIZE (buffer) - 4;
|
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
|
* while the vorbis specs allow more than that. Shouldn't
|
||||||
* be a real world problem though
|
* be a real world problem though
|
||||||
*/
|
*/
|
||||||
gst_element_error (GST_ELEMENT (tag), "Vorbis comment too long\n");
|
gst_element_error (tag, CORE, TAG, NULL, ("Vorbis comment of size %d too long", size));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,14 +285,13 @@ gst_gdk_pixbuf_chain (GstPad *pad, GstData *_data)
|
||||||
if (filter->pixbuf_loader != NULL) {
|
if (filter->pixbuf_loader != NULL) {
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf;
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
|
GError *error;
|
||||||
|
|
||||||
gdk_pixbuf_loader_close (filter->pixbuf_loader, NULL);
|
if (gdk_pixbuf_loader_close (filter->pixbuf_loader, &error)) {
|
||||||
#if 0
|
gst_element_error (filter, LIBRARY, SHUTDOWN, NULL, (error->message));
|
||||||
if (gdk_pixbuf_loader_close (filter->pixbuf_loader, NULL)) {
|
g_error_free (error);
|
||||||
gst_element_error (GST_ELEMENT(filter), "error");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
pixbuf = gdk_pixbuf_loader_get_pixbuf (filter->pixbuf_loader);
|
pixbuf = gdk_pixbuf_loader_get_pixbuf (filter->pixbuf_loader);
|
||||||
|
|
||||||
|
|
|
@ -294,8 +294,7 @@ gst_mikmod_loop (GstElement *element)
|
||||||
|
|
||||||
if (!GST_PAD_CAPS (mikmod->srcpad)) {
|
if (!GST_PAD_CAPS (mikmod->srcpad)) {
|
||||||
if (gst_mikmod_negotiate (mikmod) <= 0) {
|
if (gst_mikmod_negotiate (mikmod) <= 0) {
|
||||||
gst_element_error (GST_ELEMENT (mikmod),
|
gst_element_error (mikmod, CORE, NEGOTIATION, NULL, NULL);
|
||||||
"Failed to negotiate with next element in mikmod");
|
|
||||||
return;
|
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,
|
if (gst_pad_try_set_caps (dv1394src->srcpad,
|
||||||
gst_caps_new_simple ("video/dv",
|
gst_caps_new_simple ("video/dv",
|
||||||
"format", G_TYPE_STRING, "PAL", NULL)) <= 0) {
|
"format", G_TYPE_STRING, "PAL", NULL)) <= 0) {
|
||||||
gst_element_error (GST_ELEMENT(dv1394src), "Could not set source caps for PAL");
|
gst_element_error (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for PAL"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} 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,
|
if (gst_pad_try_set_caps (dv1394src->srcpad,
|
||||||
gst_caps_new_simple ("video/dv",
|
gst_caps_new_simple ("video/dv",
|
||||||
"format", G_TYPE_STRING, "NTSC", NULL)) <= 0) {
|
"format", G_TYPE_STRING, "NTSC", NULL)) <= 0) {
|
||||||
gst_element_error (GST_ELEMENT(dv1394src), "Could not set source caps for NTSC");
|
gst_element_error (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for NTSC"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,7 @@ gst_speexenc_chain (GstPad *pad, GstData *_data)
|
||||||
"channels", G_TYPE_INT, 1,
|
"channels", G_TYPE_INT, 1,
|
||||||
NULL)))
|
NULL)))
|
||||||
{
|
{
|
||||||
gst_element_error (GST_ELEMENT (speexenc), "could not negotiate");
|
gst_element_error (speexenc, CORE, NEGOTIATION, NULL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -686,7 +686,7 @@ gst_avi_demux_stream_init (GstAviDemux *avi)
|
||||||
if (!gst_riff_read_header (riff, &doctype))
|
if (!gst_riff_read_header (riff, &doctype))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (doctype != GST_RIFF_RIFF_AVI) {
|
if (doctype != GST_RIFF_RIFF_AVI) {
|
||||||
gst_element_error (GST_ELEMENT (avi), "Not an AVI file");
|
gst_element_error (avi, STREAM, WRONG_TYPE, NULL, NULL);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -804,8 +804,8 @@ gst_avi_demux_add_stream (GstAviDemux *avi)
|
||||||
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (tag != GST_RIFF_TAG_strf) {
|
if (tag != GST_RIFF_TAG_strf) {
|
||||||
gst_element_error (GST_ELEMENT (avi),
|
gst_element_error (avi, STREAM, DEMUX, NULL,
|
||||||
"Invalid AVI header (no strf as second tag)");
|
("Invalid AVI header (no strf as second tag)"));
|
||||||
goto skip_stream;
|
goto skip_stream;
|
||||||
}
|
}
|
||||||
switch (strh->type) {
|
switch (strh->type) {
|
||||||
|
@ -1162,17 +1162,17 @@ gst_avi_demux_stream_header (GstAviDemux *avi)
|
||||||
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (tag != GST_RIFF_TAG_LIST) {
|
if (tag != GST_RIFF_TAG_LIST) {
|
||||||
gst_element_error (GST_ELEMENT (avi),
|
gst_element_error (avi, STREAM, DEMUX, NULL,
|
||||||
"Invalid AVI header (no LIST at start): "
|
("Invalid AVI header (no LIST at start): "
|
||||||
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag));
|
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag)));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!gst_riff_read_list (riff, &tag))
|
if (!gst_riff_read_list (riff, &tag))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (tag != GST_RIFF_LIST_hdrl) {
|
if (tag != GST_RIFF_LIST_hdrl) {
|
||||||
gst_element_error (GST_ELEMENT (avi),
|
gst_element_error (avi, STREAM, DEMUX, NULL,
|
||||||
"Invalid AVI header (no hdrl at start): "
|
("Invalid AVI header (no hdrl at start): "
|
||||||
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag));
|
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag)));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1180,9 +1180,9 @@ gst_avi_demux_stream_header (GstAviDemux *avi)
|
||||||
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
if (!(tag = gst_riff_peek_tag (riff, NULL)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (tag != GST_RIFF_TAG_avih) {
|
if (tag != GST_RIFF_TAG_avih) {
|
||||||
gst_element_error (GST_ELEMENT (avi),
|
gst_element_error (avi, STREAM, DEMUX, NULL,
|
||||||
"Invalid AVI header (no avih at start): "
|
("Invalid AVI header (no avih at start): "
|
||||||
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag));
|
GST_FOURCC_FORMAT, GST_FOURCC_ARGS (tag)));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!gst_avi_demux_stream_avih (avi, &flags, &streams))
|
if (!gst_avi_demux_stream_avih (avi, &flags, &streams))
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gst-libs/gst/gst-i18n-plugin.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -984,7 +985,8 @@ gst_avimux_stop_file (GstAviMux *avimux)
|
||||||
if (avimux->audio_time) {
|
if (avimux->audio_time) {
|
||||||
avimux->auds_hdr.rate = (GST_SECOND * avimux->audio_size) / avimux->audio_time;
|
avimux->auds_hdr.rate = (GST_SECOND * avimux->audio_size) / avimux->audio_time;
|
||||||
} else {
|
} else {
|
||||||
gst_element_error (GST_ELEMENT (avimux), "Audio stream available, but no audio data transferred (or data with invalid timestamps). Resulting AVI will be corrupt");
|
gst_element_error (avimux, STREAM, MUX,
|
||||||
|
(_("No or invalid input audio, AVI stream will be corrupt")), NULL);
|
||||||
avimux->auds_hdr.rate = 0;
|
avimux->auds_hdr.rate = 0;
|
||||||
}
|
}
|
||||||
avimux->auds.av_bps = avimux->auds_hdr.rate * avimux->auds_hdr.scale;
|
avimux->auds.av_bps = avimux->auds_hdr.rate * avimux->auds_hdr.scale;
|
||||||
|
|
|
@ -463,7 +463,7 @@ gst_flxdec_loop (GstElement *element)
|
||||||
if (flxh->type != FLX_MAGICHDR_FLI &&
|
if (flxh->type != FLX_MAGICHDR_FLI &&
|
||||||
flxh->type != FLX_MAGICHDR_FLC &&
|
flxh->type != FLX_MAGICHDR_FLC &&
|
||||||
flxh->type != FLX_MAGICHDR_FLX) {
|
flxh->type != FLX_MAGICHDR_FLX) {
|
||||||
gst_element_error (element, "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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -270,7 +270,9 @@ gst_goom_chain (GstPad *pad, GstData *_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (goom->channels == 0) {
|
if (goom->channels == 0) {
|
||||||
gst_element_error (GST_ELEMENT (goom), "sink format not negotiated");
|
gst_element_error (goom, CORE, NEGOTIATION, NULL,
|
||||||
|
("format wasn't negotiated before chain function"));
|
||||||
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,9 +167,9 @@ gst_ebml_read_element_id (GstEbmlRead *ebml,
|
||||||
} else {
|
} else {
|
||||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||||
"Read error at position %llu (0x%llx)",
|
("Read error at position %llu (0x%llx)",
|
||||||
pos, pos);
|
pos, pos));
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -180,17 +180,16 @@ gst_ebml_read_element_id (GstEbmlRead *ebml,
|
||||||
}
|
}
|
||||||
if (read > 4) {
|
if (read > 4) {
|
||||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||||
"Invalid EBML ID size tag (0x%x) at position %llu (0x%llx)",
|
("Invalid EBML ID size tag (0x%x) at position %llu (0x%llx)",
|
||||||
data[0], pos, pos);
|
data[0], pos, pos));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gst_bytestream_peek_bytes (ebml->bs, &data, read) != read) {
|
if (gst_bytestream_peek_bytes (ebml->bs, &data, read) != read) {
|
||||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||||
"Read error at position %llu (0x%llx)",
|
("Read error at position %llu (0x%llx)", pos, pos));
|
||||||
pos, pos);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
while (n < read)
|
while (n < read)
|
||||||
|
@ -217,12 +216,11 @@ gst_ebml_read_element_length (GstEbmlRead *ebml,
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
gint len_mask = 0x80, read = 1, n = 1, num_ffs = 0;
|
gint len_mask = 0x80, read = 1, n = 1, num_ffs = 0;
|
||||||
guint64 total;
|
guint64 total;
|
||||||
|
|
||||||
if (gst_bytestream_peek_bytes (ebml->bs, &data, 1) != 1) {
|
if (gst_bytestream_peek_bytes (ebml->bs, &data, 1) != 1) {
|
||||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||||
"Read error at position %llu (0x%llx)",
|
("Read error at position %llu (0x%llx)", pos, pos));
|
||||||
pos, pos);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
total = data[0];
|
total = data[0];
|
||||||
|
@ -232,9 +230,9 @@ gst_ebml_read_element_length (GstEbmlRead *ebml,
|
||||||
}
|
}
|
||||||
if (read > 8) {
|
if (read > 8) {
|
||||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||||
"Invalid EBML length size tag (0x%x) at position %llu (0x%llx)",
|
("Invalid EBML length size tag (0x%x) at position %llu (0x%llx)",
|
||||||
data[0], pos, pos);
|
data[0], pos, pos));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,9 +240,8 @@ gst_ebml_read_element_length (GstEbmlRead *ebml,
|
||||||
num_ffs++;
|
num_ffs++;
|
||||||
if (gst_bytestream_peek_bytes (ebml->bs, &data, read) != read) {
|
if (gst_bytestream_peek_bytes (ebml->bs, &data, read) != read) {
|
||||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||||
"Read error at position %llu (0x%llx)",
|
("Read error at position %llu (0x%llx)", pos, pos));
|
||||||
pos, pos);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
while (n < read) {
|
while (n < read) {
|
||||||
|
@ -275,9 +272,8 @@ gst_ebml_read_element_data (GstEbmlRead *ebml,
|
||||||
|
|
||||||
if (gst_bytestream_peek (ebml->bs, &buf, length) != length) {
|
if (gst_bytestream_peek (ebml->bs, &buf, length) != length) {
|
||||||
guint64 pos = gst_bytestream_tell (ebml->bs);
|
guint64 pos = gst_bytestream_tell (ebml->bs);
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, RESOURCE, READ, NULL,
|
||||||
"Read error at position %llu (0x%llx)",
|
("Read error at position %llu (0x%llx)", pos, pos));
|
||||||
pos, pos);
|
|
||||||
if (buf)
|
if (buf)
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -331,9 +327,8 @@ gst_ebml_read_seek (GstEbmlRead *ebml,
|
||||||
|
|
||||||
/* now seek */
|
/* now seek */
|
||||||
if (!gst_bytestream_seek (ebml->bs, offset, GST_SEEK_METHOD_SET)) {
|
if (!gst_bytestream_seek (ebml->bs, offset, GST_SEEK_METHOD_SET)) {
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, RESOURCE, SEEK, NULL,
|
||||||
"Seek to position %llu (0x%llx) failed",
|
("Seek to position %llu (0x%llx) failed", offset, offset));
|
||||||
offset, offset);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,8 +340,8 @@ gst_ebml_read_seek (GstEbmlRead *ebml,
|
||||||
/* get the discont event and return */
|
/* get the discont event and return */
|
||||||
gst_bytestream_get_status (ebml->bs, &remaining, &event);
|
gst_bytestream_get_status (ebml->bs, &remaining, &event);
|
||||||
if (!event || GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
|
if (!event || GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) {
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, CORE, SEEK, NULL,
|
||||||
"No discontinuity event after seek");
|
("No discontinuity event after seek"));
|
||||||
if (event)
|
if (event)
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -436,9 +431,9 @@ gst_ebml_read_uint (GstEbmlRead *ebml,
|
||||||
data = GST_BUFFER_DATA (buf);
|
data = GST_BUFFER_DATA (buf);
|
||||||
size = GST_BUFFER_SIZE (buf);
|
size = GST_BUFFER_SIZE (buf);
|
||||||
if (size < 1 || size > 8) {
|
if (size < 1 || size > 8) {
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||||
"Invalid integer element size %d at position %llu (0x%llu)",
|
("Invalid integer element size %d at position %llu (0x%llu)",
|
||||||
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf));
|
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf)));
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -472,9 +467,9 @@ gst_ebml_read_sint (GstEbmlRead *ebml,
|
||||||
data = GST_BUFFER_DATA (buf);
|
data = GST_BUFFER_DATA (buf);
|
||||||
size = GST_BUFFER_SIZE (buf);
|
size = GST_BUFFER_SIZE (buf);
|
||||||
if (size < 1 || size > 8) {
|
if (size < 1 || size > 8) {
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||||
"Invalid integer element size %d at position %llu (0x%llx)",
|
("Invalid integer element size %d at position %llu (0x%llx)",
|
||||||
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf));
|
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf)));
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -517,16 +512,16 @@ gst_ebml_read_float (GstEbmlRead *ebml,
|
||||||
size = GST_BUFFER_SIZE (buf);
|
size = GST_BUFFER_SIZE (buf);
|
||||||
|
|
||||||
if (size != 4 && size != 8 && size != 10) {
|
if (size != 4 && size != 8 && size != 10) {
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, STREAM, DEMUX, NULL,
|
||||||
"Invalid float element size %d at position %llu (0x%llx)",
|
("Invalid float element size %d at position %llu (0x%llx)",
|
||||||
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf));
|
size, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET (buf)));
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size == 10) {
|
if (size == 10) {
|
||||||
gst_element_error (GST_ELEMENT (ebml),
|
gst_element_error (ebml, CORE, NOT_IMPLEMENTED, NULL,
|
||||||
"FIXME! 10-byte floats unimplemented");
|
("FIXME! 10-byte floats unimplemented"));
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -686,7 +681,7 @@ gst_ebml_read_header (GstEbmlRead *ebml,
|
||||||
if (!(id = gst_ebml_peek_id (ebml, &level_up)))
|
if (!(id = gst_ebml_peek_id (ebml, &level_up)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (level_up != 0 || id != GST_EBML_ID_HEADER) {
|
if (level_up != 0 || id != GST_EBML_ID_HEADER) {
|
||||||
gst_element_error (GST_ELEMENT (ebml), "Not a EBML file");
|
gst_element_error (ebml, STREAM, WRONG_TYPE, NULL, NULL);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!gst_ebml_read_master (ebml, &id))
|
if (!gst_ebml_read_master (ebml, &id))
|
||||||
|
|
|
@ -1130,17 +1130,17 @@ gst_matroska_demux_init_stream (GstMatroskaDemux *demux)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!doctype || strcmp (doctype, "matroska") != 0) {
|
if (!doctype || strcmp (doctype, "matroska") != 0) {
|
||||||
gst_element_error (GST_ELEMENT (demux),
|
gst_element_error (demux, STREAM, WRONG_TYPE, NULL,
|
||||||
"Input is not a matroska stream (doctype=%s)",
|
("Input is not a matroska stream (doctype=%s)",
|
||||||
doctype ? doctype : "none");
|
doctype ? doctype : "none"));
|
||||||
g_free (doctype);
|
g_free (doctype);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
g_free (doctype);
|
g_free (doctype);
|
||||||
if (version > 1) {
|
if (version > 1) {
|
||||||
gst_element_error (GST_ELEMENT (demux),
|
gst_element_error (demux, STREAM, DEMUX, NULL,
|
||||||
"Demuxer version (1) is too old to read stream version %d",
|
("Demuxer version (1) is too old to read stream version %d",
|
||||||
version);
|
version));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1634,7 +1634,7 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux *demux,
|
||||||
|
|
||||||
/* first byte(s): blocknum */
|
/* first byte(s): blocknum */
|
||||||
if ((n = gst_matroska_ebmlnum_uint (data, size, &num)) < 0) {
|
if ((n = gst_matroska_ebmlnum_uint (data, size, &num)) < 0) {
|
||||||
gst_element_error (GST_ELEMENT (demux), "Data error");
|
gst_element_error (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
break;
|
break;
|
||||||
|
@ -1705,7 +1705,7 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux *demux,
|
||||||
case 0x3: /* EBML lacing */ {
|
case 0x3: /* EBML lacing */ {
|
||||||
guint total;
|
guint total;
|
||||||
if ((n = gst_matroska_ebmlnum_uint (data, size, &num)) < 0) {
|
if ((n = gst_matroska_ebmlnum_uint (data, size, &num)) < 0) {
|
||||||
gst_element_error (GST_ELEMENT (demux), "Data error");
|
gst_element_error (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1715,7 +1715,7 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux *demux,
|
||||||
gint64 snum;
|
gint64 snum;
|
||||||
gint r;
|
gint r;
|
||||||
if ((r = gst_matroska_ebmlnum_sint (data, size, &snum)) < 0) {
|
if ((r = gst_matroska_ebmlnum_sint (data, size, &snum)) < 0) {
|
||||||
gst_element_error (GST_ELEMENT (demux), "Data error");
|
gst_element_error (demux, STREAM, DEMUX, NULL, ("Data error"));
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@ gst_monoscope_chain (GstPad *pad, GstData *_data)
|
||||||
GST_DEBUG ("making new pad");
|
GST_DEBUG ("making new pad");
|
||||||
if (!gst_pad_is_negotiated (monoscope->srcpad)) {
|
if (!gst_pad_is_negotiated (monoscope->srcpad)) {
|
||||||
if (gst_pad_renegotiate (monoscope->srcpad) <= 0) {
|
if (gst_pad_renegotiate (monoscope->srcpad) <= 0) {
|
||||||
gst_element_error (GST_ELEMENT (monoscope), "could not set caps");
|
gst_element_error (monoscope, CORE, NEGOTIATION, NULL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,7 @@ gst_smpte_loop (GstElement *element)
|
||||||
"framerate", G_TYPE_DOUBLE, smpte->fps, NULL);
|
"framerate", G_TYPE_DOUBLE, smpte->fps, NULL);
|
||||||
|
|
||||||
if (!gst_pad_try_set_caps (smpte->srcpad, caps)) {
|
if (!gst_pad_try_set_caps (smpte->srcpad, caps)) {
|
||||||
gst_element_error (element, "cannot set caps");
|
gst_element_error (smpte, CORE, NEGOTIATION, NULL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -588,7 +588,7 @@ gst_wavenc_chain (GstPad *pad,
|
||||||
|
|
||||||
if (!wavenc->setup) {
|
if (!wavenc->setup) {
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
gst_element_error (GST_ELEMENT (wavenc), "encoder not initialised (input is not audio?)");
|
gst_element_error (wavenc, CORE, NEGOTIATION, NULL, ("encoder not initialised (input is not audio?)"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -636,7 +636,7 @@ gst_wavparse_parse_fmt (GstWavParse *wavparse, guint size)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gst_element_error (GST_ELEMENT (wavparse), "wavparse: format %d not handled", wavparse->format);
|
gst_element_error (wavparse, STREAM, NOT_IMPLEMENTED, NULL, ("format %d not handled", wavparse->format));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,7 +731,7 @@ gst_wavparse_loop (GstElement *element)
|
||||||
if (event && GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
|
if (event && GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
|
||||||
gst_pad_event_default (wavparse->sinkpad, event);
|
gst_pad_event_default (wavparse->sinkpad, event);
|
||||||
} else {
|
} else {
|
||||||
gst_element_error (element, "Read failure");
|
gst_element_error (element, RESOURCE, READ, NULL, NULL);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -808,7 +808,8 @@ gst_wavparse_loop (GstElement *element)
|
||||||
case GST_WAVPARSE_START:
|
case GST_WAVPARSE_START:
|
||||||
if (chunk.id != GST_RIFF_TAG_RIFF &&
|
if (chunk.id != GST_RIFF_TAG_RIFF &&
|
||||||
chunk.type != GST_RIFF_RIFF_WAVE) {
|
chunk.type != GST_RIFF_RIFF_WAVE) {
|
||||||
gst_element_error (element, "This doesn't appear to be a WAV file %08x %08x", chunk.id, chunk.type);
|
gst_element_error (element, STREAM, WRONG_TYPE, NULL,
|
||||||
|
("chunk.id %08x chunk.type %08x", chunk.id, chunk.type));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gst-libs/gst/gst-i18n-plugin.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
@ -679,37 +680,32 @@ gst_osselement_open_audio (GstOssElement *oss)
|
||||||
if (oss->fd < 0) {
|
if (oss->fd < 0) {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case EBUSY:
|
case EBUSY:
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
gst_element_error (oss, RESOURCE, BUSY,
|
||||||
"osselement: Unable to open %s (in use ?)",
|
(_("OSS device %s is already in use by another program."), oss->device), NULL);
|
||||||
oss->device);
|
|
||||||
break;
|
|
||||||
case EISDIR:
|
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
|
||||||
"osselement: Device %s is a directory",
|
|
||||||
oss->device);
|
|
||||||
break;
|
break;
|
||||||
case EACCES:
|
case EACCES:
|
||||||
case ETXTBSY:
|
case ETXTBSY:
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
if (mode == GST_OSSELEMENT_WRITE)
|
||||||
"osselement: Cannot access %s, check permissions",
|
gst_element_error (oss, RESOURCE, OPEN_WRITE,
|
||||||
oss->device);
|
(_("Could not access device %s, check it's permissions"), oss->device), GST_ERROR_SYSTEM);
|
||||||
|
else
|
||||||
|
gst_element_error (oss, RESOURCE, OPEN_READ,
|
||||||
|
(_("Could not access device %s, check it's permissions"), oss->device), GST_ERROR_SYSTEM);
|
||||||
break;
|
break;
|
||||||
case ENXIO:
|
case ENXIO:
|
||||||
case ENODEV:
|
case ENODEV:
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
gst_element_error (oss, RESOURCE, NOT_FOUND,
|
||||||
"osselement: Cannot access %s, does it exist ?",
|
(_("Device %s does not exist"), oss->device), GST_ERROR_SYSTEM);
|
||||||
oss->device);
|
|
||||||
break;
|
break;
|
||||||
case EROFS:
|
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
|
||||||
"osselement: Cannot access %s, read-only filesystem ?",
|
|
||||||
oss->device);
|
|
||||||
default:
|
default:
|
||||||
/* FIXME: strerror is not threadsafe */
|
/* FIXME: strerror is not threadsafe */
|
||||||
gst_element_error (GST_ELEMENT (oss),
|
if (mode == GST_OSSELEMENT_WRITE)
|
||||||
"osselement: Cannot open %s, generic error: %s",
|
gst_element_error (oss, RESOURCE, OPEN_WRITE,
|
||||||
oss->device, strerror (errno));
|
(_("Could not open device \"%s\" for writing"), oss->device), GST_ERROR_SYSTEM);
|
||||||
|
else
|
||||||
|
gst_element_error (oss, RESOURCE, OPEN_READ,
|
||||||
|
(_("Could not open device \"%s\" for reading"), oss->device), GST_ERROR_SYSTEM);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -46,6 +46,11 @@ G_BEGIN_DECLS
|
||||||
typedef struct _GstOssElement GstOssElement;
|
typedef struct _GstOssElement GstOssElement;
|
||||||
typedef struct _GstOssElementClass GstOssElementClass;
|
typedef struct _GstOssElementClass GstOssElementClass;
|
||||||
|
|
||||||
|
/* debugging category */
|
||||||
|
GST_DEBUG_CATEGORY_EXTERN (oss_debug);
|
||||||
|
//#define GST_CAT_DEFAULT oss_debug
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GST_OSSELEMENT_READ,
|
GST_OSSELEMENT_READ,
|
||||||
GST_OSSELEMENT_WRITE,
|
GST_OSSELEMENT_WRITE,
|
||||||
|
|
|
@ -103,7 +103,7 @@ static GstElementClass *parent_class = NULL;
|
||||||
static guint gst_osssink_signals[LAST_SIGNAL] = { 0 };
|
static guint gst_osssink_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gst_osssink_get_type (void)
|
gst_osssink_get_type (void)
|
||||||
{
|
{
|
||||||
static GType osssink_type = 0;
|
static GType osssink_type = 0;
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ gst_osssink_get_type (void)
|
||||||
(GInstanceInitFunc)gst_osssink_init,
|
(GInstanceInitFunc)gst_osssink_init,
|
||||||
};
|
};
|
||||||
osssink_type = g_type_register_static (GST_TYPE_OSSELEMENT, "GstOssSink", &osssink_info, 0);
|
osssink_type = g_type_register_static (GST_TYPE_OSSELEMENT, "GstOssSink", &osssink_info, 0);
|
||||||
|
//GST_DEBUG_CATEGORY_INIT (oss_debug, "oss", 0, "OSS element");
|
||||||
}
|
}
|
||||||
|
|
||||||
return osssink_type;
|
return osssink_type;
|
||||||
|
@ -202,6 +203,7 @@ gst_osssink_init (GstOssSink *osssink)
|
||||||
|
|
||||||
gst_pad_set_chain_function (osssink->sinkpad, gst_osssink_chain);
|
gst_pad_set_chain_function (osssink->sinkpad, gst_osssink_chain);
|
||||||
|
|
||||||
|
GST_DEBUG ("initializing osssink");
|
||||||
osssink->bufsize = 4096;
|
osssink->bufsize = 4096;
|
||||||
osssink->chunk_size = 4096;
|
osssink->chunk_size = 4096;
|
||||||
osssink->mute = FALSE;
|
osssink->mute = FALSE;
|
||||||
|
@ -349,7 +351,7 @@ gst_osssink_chain (GstPad *pad, GstData *_data)
|
||||||
|
|
||||||
if (!GST_OSSELEMENT (osssink)->bps) {
|
if (!GST_OSSELEMENT (osssink)->bps) {
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
gst_element_error (GST_ELEMENT (osssink), "capsnego was never performed, unknown data type");
|
gst_element_error (osssink, CORE, NEGOTIATION, NULL, ("format wasn't negotiated before chain function"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,13 +305,14 @@ gst_osssrc_get (GstPad *pad)
|
||||||
/* nothing was negotiated, we can decide on a format */
|
/* nothing was negotiated, we can decide on a format */
|
||||||
if (!gst_osssrc_negotiate (pad)) {
|
if (!gst_osssrc_negotiate (pad)) {
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
gst_element_error (GST_ELEMENT (src), "could not negotiate format");
|
gst_element_error (src, CORE, NEGOTIATION, NULL, NULL);
|
||||||
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GST_OSSELEMENT (src)->bps == 0) {
|
if (GST_OSSELEMENT (src)->bps == 0) {
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
gst_element_error (GST_ELEMENT (src), "no format negotiated");
|
gst_element_error (src, CORE, NEGOTIATION, NULL,
|
||||||
|
("format wasn't negotiated before chain function"));
|
||||||
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,8 +320,7 @@ gst_osssrc_get (GstPad *pad)
|
||||||
src->buffersize);
|
src->buffersize);
|
||||||
if (readbytes < 0) {
|
if (readbytes < 0) {
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
gst_element_error (GST_ELEMENT (src), "error reading data (%s)",
|
gst_element_error (src, RESOURCE, READ, NULL, GST_ERROR_SYSTEM);
|
||||||
strerror (errno));
|
|
||||||
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -817,7 +817,7 @@ gst_v4l2src_get (GstPad *pad)
|
||||||
|
|
||||||
if (v4l2src->use_fixed_fps &&
|
if (v4l2src->use_fixed_fps &&
|
||||||
(fps = gst_v4l2src_get_fps(v4l2src)) == 0) {
|
(fps = gst_v4l2src_get_fps(v4l2src)) == 0) {
|
||||||
gst_element_error (GST_ELEMENT (v4l2src), "Could not get frame rate for element.");
|
gst_element_error (v4l2src, RESOURCE, SETTINGS, NULL, ("could not get frame rate for element"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,9 @@ gst_v4l2src_fill_format_list (GstV4l2Src *v4l2src)
|
||||||
if (errno == EINVAL) {
|
if (errno == EINVAL) {
|
||||||
break; /* end of enumeration */
|
break; /* end of enumeration */
|
||||||
} else {
|
} else {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src),
|
gst_element_error (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||||
"Failed to get no. %d in pixelformat enumeration for %s: %s",
|
("failed to get number %d in pixelformat enumeration for %s: %s",
|
||||||
n, GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno));
|
n, GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||||
g_free (format);
|
g_free (format);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -117,8 +117,9 @@ gst_v4l2src_queue_frame (GstV4l2Src *v4l2src,
|
||||||
GST_LOG_OBJECT (v4l2src, "queueing frame %u", i);
|
GST_LOG_OBJECT (v4l2src, "queueing frame %u", i);
|
||||||
|
|
||||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_QBUF, &v4l2src->pool->buffers[i].buffer) < 0) {
|
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_QBUF, &v4l2src->pool->buffers[i].buffer) < 0) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src), "Error queueing buffer %u on device %s: %s",
|
gst_element_error (v4l2src, RESOURCE, WRITE,
|
||||||
i, GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno));
|
(_("Could not write to device \"%s\""), GST_V4L2ELEMENT(v4l2src)->device),
|
||||||
|
("Error queueing buffer %u on device %s", i, g_strerror(errno)));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,8 +142,8 @@ gst_v4l2src_grab_frame (GstV4l2Src *v4l2src)
|
||||||
while (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_DQBUF, &buffer) < 0) {
|
while (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_DQBUF, &buffer) < 0) {
|
||||||
/* if the sync() got interrupted, we can retry */
|
/* if the sync() got interrupted, we can retry */
|
||||||
if (errno != EINTR) {
|
if (errno != EINTR) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src), "Error syncing 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));
|
GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
GST_DEBUG_OBJECT (v4l2src, "grab got interrupted");
|
GST_DEBUG_OBJECT (v4l2src, "grab got interrupted");
|
||||||
|
@ -169,9 +170,9 @@ gst_v4l2src_get_capture (GstV4l2Src *v4l2src)
|
||||||
|
|
||||||
v4l2src->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
v4l2src->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_G_FMT, &v4l2src->format) < 0) {
|
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_G_FMT, &v4l2src->format) < 0) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src),
|
gst_element_error (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||||
"Failed to get pixel format for device %s: %s",
|
("failed to get pixelformat for device %s: %s",
|
||||||
GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno));
|
n, GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,10 +206,9 @@ gst_v4l2src_set_capture (GstV4l2Src *v4l2src,
|
||||||
v4l2src->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
v4l2src->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
|
||||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_S_FMT, &v4l2src->format) < 0) {
|
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_S_FMT, &v4l2src->format) < 0) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src),
|
gst_element_error (v4l2src, RESOURCE, SETTINGS, NULL,
|
||||||
"Failed to set pixel format to %s @ %dx%d for device %s: %s",
|
("failed to set pixelformat to %s @ %dx%d for device %s: %s",
|
||||||
fmt->description, width, height,
|
fmt->description, width, height, GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||||
GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno));
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,14 +245,16 @@ gst_v4l2src_capture_init (GstV4l2Src *v4l2src)
|
||||||
v4l2src->breq.type = v4l2src->format.type;
|
v4l2src->breq.type = v4l2src->format.type;
|
||||||
v4l2src->breq.memory = V4L2_MEMORY_MMAP;
|
v4l2src->breq.memory = V4L2_MEMORY_MMAP;
|
||||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_REQBUFS, &v4l2src->breq) < 0) {
|
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_REQBUFS, &v4l2src->breq) < 0) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src), "Error requesting buffers (%d) for %s: %s",
|
gst_element_error (v4l2src, RESOURCE, READ,
|
||||||
v4l2src->breq.count, GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno));
|
(_("Could not get buffers from device \"%s\""), GST_V4L2ELEMENT(v4l2src)->device),
|
||||||
|
("error requesting %d buffers: %s", v4l2src->breq.count, g_strerror (errno)));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v4l2src->breq.count < GST_V4L2_MIN_BUFFERS) {
|
if (v4l2src->breq.count < GST_V4L2_MIN_BUFFERS) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src), "Too little buffers. We got %d, we want at least %d",
|
gst_element_error (v4l2src, RESOURCE, READ,
|
||||||
v4l2src->breq.count, GST_V4L2_MIN_BUFFERS);
|
(_("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;
|
v4l2src->breq.count = buffers;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -278,16 +280,16 @@ gst_v4l2src_capture_init (GstV4l2Src *v4l2src)
|
||||||
buffer->buffer.index = n;
|
buffer->buffer.index = n;
|
||||||
buffer->buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
buffer->buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_QUERYBUF, &buffer->buffer) < 0) {
|
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_QUERYBUF, &buffer->buffer) < 0) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src), "Failed to get buffer (%d) properties: %s",
|
gst_element_error (v4l2src, RESOURCE, READ, NULL,
|
||||||
n, g_strerror(errno));
|
("Could not get buffer properties of buffer %d: %s", n, g_strerror (errno)));
|
||||||
gst_v4l2src_capture_deinit(v4l2src);
|
gst_v4l2src_capture_deinit(v4l2src);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
buffer->start = mmap (0, buffer->buffer.length, PROT_READ|PROT_WRITE, MAP_SHARED,
|
buffer->start = mmap (0, buffer->buffer.length, PROT_READ|PROT_WRITE, MAP_SHARED,
|
||||||
GST_V4L2ELEMENT(v4l2src)->video_fd, buffer->buffer.m.offset);
|
GST_V4L2ELEMENT(v4l2src)->video_fd, buffer->buffer.m.offset);
|
||||||
if (buffer->start == MAP_FAILED) {
|
if (buffer->start == MAP_FAILED) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src), "Error mapping video buffer (%d) on device %s: %s",
|
gst_element_error (v4l2src, RESOURCE, READ, NULL,
|
||||||
n, GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno));
|
("Could not mmap video buffer %d: %s", n, g_strerror (errno)));
|
||||||
buffer->start = 0;
|
buffer->start = 0;
|
||||||
gst_v4l2src_capture_deinit (v4l2src);
|
gst_v4l2src_capture_deinit (v4l2src);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -326,8 +328,9 @@ gst_v4l2src_capture_start (GstV4l2Src *v4l2src)
|
||||||
v4l2src->quit = FALSE;
|
v4l2src->quit = FALSE;
|
||||||
|
|
||||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_STREAMON, &type) < 0) {
|
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_STREAMON, &type) < 0) {
|
||||||
gst_element_error(GST_ELEMENT(v4l2src), "Error starting streaming capture for %s: %s",
|
gst_element_error (v4l2src, RESOURCE, OPEN_READ, NULL,
|
||||||
GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno));
|
("Error starting streaming capture from device %s: %s",
|
||||||
|
GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno)));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,8 +356,9 @@ gst_v4l2src_capture_stop (GstV4l2Src *v4l2src)
|
||||||
/* we actually need to sync on all queued buffers but not
|
/* we actually need to sync on all queued buffers but not
|
||||||
* on the non-queued ones */
|
* on the non-queued ones */
|
||||||
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_STREAMOFF, &type) < 0) {
|
if (ioctl(GST_V4L2ELEMENT(v4l2src)->video_fd, VIDIOC_STREAMOFF, &type) < 0) {
|
||||||
gst_element_error (GST_ELEMENT(v4l2src), "Error stopping streaming capture for %s: %s",
|
gst_element_error (v4l2src, RESOURCE, CLOSE, NULL,
|
||||||
GST_V4L2ELEMENT(v4l2src)->device, g_strerror(errno));
|
("Error stopping streaming capture from device %s: %s",
|
||||||
|
GST_V4L2ELEMENT(v4l2src)->device, g_strerror (errno)));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue