From: <tp...@ke...> - 2006-07-19 16:29:30
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: tpm Date: Tue Jul 18 2006 18:05:27 UTC Log message: * ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_chain): Fix caps after previous change to byte order endianness. * ext/wavpack/gstwavpackparse.c: (gst_wavpack_parse_reset), (gst_wavpack_parse_sink_event), (gst_wavpack_parse_init), (gst_wavpack_parse_loop): * ext/wavpack/gstwavpackparse.h: Queue incoming events if there's no source pad yet and send them downstream later when the pad is there. Modified files: . : ChangeLog ext/wavpack : gstwavpackdec.c gstwavpackparse.c gstwavpackparse.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.2183&r2=1.2184 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/wavpack/gstwavpackdec.c.diff?r1=1.12&r2=1.13 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/wavpack/gstwavpackparse.c.diff?r1=1.8&r2=1.9 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/wavpack/gstwavpackparse.h.diff?r1=1.4&r2=1.5 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.2183 retrieving revision 1.2184 diff -u -d -r1.2183 -r1.2184 --- ChangeLog 18 Jul 2006 16:47:25 -0000 1.2183 +++ ChangeLog 18 Jul 2006 18:05:15 -0000 1.2184 @@ -1,5 +1,17 @@ 2006-07-18 Tim-Philipp Müller <tim at centricular dot net> + * ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_chain): + Fix caps after previous change to byte order endianness. + + * ext/wavpack/gstwavpackparse.c: (gst_wavpack_parse_reset), + (gst_wavpack_parse_sink_event), (gst_wavpack_parse_init), + (gst_wavpack_parse_loop): + * ext/wavpack/gstwavpackparse.h: + Queue incoming events if there's no source pad yet and + send them downstream later when the pad is there. +2006-07-18 Tim-Philipp Müller <tim at centricular dot net> * ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_init), (gst_wavpack_dec_format_samples), (gst_wavpack_dec_clip_outgoing_buffer), (gst_wavpack_dec_chain), Index: gstwavpackdec.c RCS file: /cvs/gstreamer/gst-plugins-bad/ext/wavpack/gstwavpackdec.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- gstwavpackdec.c 18 Jul 2006 16:47:25 -0000 1.12 +++ gstwavpackdec.c 18 Jul 2006 18:05:15 -0000 1.13 @@ -287,7 +287,7 @@ "channels", G_TYPE_INT, dec->channels, "depth", G_TYPE_INT, dec->depth, "width", G_TYPE_INT, dec->width, - "endianness", G_TYPE_INT, G_LITTLE_ENDIAN, + "endianness", G_TYPE_INT, G_BYTE_ORDER, "signed", G_TYPE_BOOLEAN, TRUE, NULL); GST_DEBUG_OBJECT (dec, "setting caps %" GST_PTR_FORMAT, caps); Index: gstwavpackparse.c RCS file: /cvs/gstreamer/gst-plugins-bad/ext/wavpack/gstwavpackparse.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gstwavpackparse.c 18 Jul 2006 14:08:06 -0000 1.8 +++ gstwavpackparse.c 18 Jul 2006 18:05:15 -0000 1.9 @@ -213,6 +213,11 @@ gst_object_unref (wavpackparse->srcpad); wavpackparse->srcpad = NULL; } + g_list_foreach (wavpackparse->queued_events, (GFunc) gst_mini_object_unref, + NULL); + g_list_free (wavpackparse->queued_events); + wavpackparse->queued_events = NULL; } static gboolean @@ -532,6 +537,27 @@ +gst_wavpack_parse_sink_event (GstPad * pad, GstEvent * event) +{ + GstWavpackParse *parse; + gboolean ret = TRUE; + parse = GST_WAVPACK_PARSE (gst_pad_get_parent (pad)); + /* stream lock is recursive, should be fine for all events */ + GST_PAD_STREAM_LOCK (pad); + if (parse->srcpad == NULL) { + parse->queued_events = g_list_append (parse->queued_events, event); + } else { + ret = gst_pad_push_event (parse->srcpad, event); + } + GST_PAD_STREAM_UNLOCK (pad); + gst_object_unref (parse); + return ret; +} +static gboolean gst_wavpack_parse_src_event (GstPad * pad, GstEvent * event) { GstWavpackParse *wavpackparse; @@ -564,9 +590,10 @@ gst_pad_set_activate_function (wavpackparse->sinkpad, GST_DEBUG_FUNCPTR (gst_wavepack_parse_sink_activate)); - gst_pad_set_activatepull_function (wavpackparse->sinkpad, GST_DEBUG_FUNCPTR (gst_wavepack_parse_sink_activate_pull)); + gst_pad_set_event_function (wavpackparse->sinkpad, + GST_DEBUG_FUNCPTR (gst_wavpack_parse_sink_event)); gst_element_add_pad (GST_ELEMENT (wavpackparse), wavpackparse->sinkpad); @@ -779,6 +806,17 @@ wavpackparse->need_newsegment = FALSE; + /* send any queued events */ + if (wavpackparse->queued_events) { + GList *l; + for (l = wavpackparse->queued_events; l != NULL; l = l->next) { + gst_pad_push_event (wavpackparse->srcpad, GST_EVENT (l->data)); + } + g_list_free (wavpackparse->queued_events); + wavpackparse->queued_events = NULL; GST_BUFFER_TIMESTAMP (buf) = gst_util_uint64_scale_int (header.block_index, GST_SECOND, wavpackparse->samplerate); GST_BUFFER_DURATION (buf) = gst_util_uint64_scale_int (header.block_samples, Index: gstwavpackparse.h RCS file: /cvs/gstreamer/gst-plugins-bad/ext/wavpack/gstwavpackparse.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gstwavpackparse.h 1 Jun 2006 22:00:23 -0000 1.4 +++ gstwavpackparse.h 18 Jul 2006 18:05:15 -0000 1.5 @@ -72,6 +72,9 @@ * gaps (ie. append only and consecutive entries must always * map to consecutive chunks in the file). */ GArray *entries; + /* Queued events (e.g. tag events we receive before we create the src pad) */ + GList *queued_events; /* STREAM_LOCK */ }; struct _GstWavpackParseClass |