+2005-11-21 Tim-Philipp Müller <tim at centricular dot net>
+
+ * ext/dv/gstdvdemux.c: (gst_dvdemux_handle_sink_event):
+ * ext/flac/gstflacdec.c: (gst_flacdec_loop),
+ (gst_flacdec_src_event):
+ * ext/flac/gstflacenc.c: (gst_flacenc_sink_event):
+ * ext/ladspa/gstsignalprocessor.c: (gst_signal_processor_event),
+ (gst_signal_processor_getrange), (gst_signal_processor_chain):
+ * gst/avi/gstavidemux.c: (gst_avi_demux_handle_seek):
+ * gst/flx/gstflxdec.c: (gst_flxdec_src_event_handler),
+ (gst_flxdec_sink_event_handler):
+ * gst/matroska/matroska-demux.c:
+ (gst_matroska_demux_handle_seek_event):
+ * gst/wavparse/gstwavparse.c: (gst_wavparse_handle_seek):
+ Update for stream lock API changes: don't take stream log
+ in sink event handlers any longer and change GST_STREAM_LOCK
+ to GST_PAD_STREAM_LOCK. Don't leak references in flxdec event
+ functions.
+
2005-11-21 Michael Smith <msmith@fluendo.com>
* gst/auparse/gstauparse.c: (gst_auparse_dispose):
* to the peer which will be unblocked by forwarding the
* event.*/
res = gst_dvdemux_send_event (dvdemux, event);
-
- /* and wait till streaming stops, not strictly needed as
- * the peer calling us will do the same. */
- GST_STREAM_LOCK (pad);
- GST_STREAM_UNLOCK (pad);
break;
case GST_EVENT_FLUSH_STOP:
- GST_STREAM_LOCK (pad);
gst_adapter_clear (dvdemux->adapter);
GST_DEBUG ("cleared adapter");
res = gst_dvdemux_send_event (dvdemux, event);
- GST_STREAM_UNLOCK (pad);
break;
case GST_EVENT_NEWSEGMENT:
{
GstFormat format;
- GST_STREAM_LOCK (pad);
-
/* parse byte start and stop positions */
gst_event_parse_newsegment (event, NULL, NULL, &format,
&dvdemux->start_byte, &dvdemux->stop_byte, NULL);
/* and queue a DISCONT before sending the next set of buffers */
dvdemux->need_discont = TRUE;
gst_event_unref (event);
- GST_STREAM_UNLOCK (pad);
break;
}
case GST_EVENT_EOS:
default:
- GST_STREAM_LOCK (pad);
/* flush any pending data */
gst_dvdemux_flush (dvdemux);
/* forward event */
res = gst_dvdemux_send_event (dvdemux, event);
/* and clear the adapter */
gst_adapter_clear (dvdemux->adapter);
- GST_STREAM_UNLOCK (pad);
break;
}
flacdec = GST_FLACDEC (GST_OBJECT_PARENT (sinkpad));
- GST_STREAM_LOCK (sinkpad);
-
GST_DEBUG ("flacdec: entering loop");
if (flacdec->init) {
GST_DEBUG ("flacdec: initializing decoder");
case FLAC__SEEKABLE_STREAM_DECODER_OK:
case FLAC__SEEKABLE_STREAM_DECODER_SEEKING:
GST_DEBUG ("flacdec: everything ok");
- GST_STREAM_UNLOCK (sinkpad);
return;
case FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM:{
GST_DEBUG ("pausing");
gst_pad_pause_task (sinkpad);
-
- GST_STREAM_UNLOCK (sinkpad);
return;
}
GST_DEBUG ("pausing");
gst_pad_pause_task (sinkpad);
-
- GST_STREAM_UNLOCK (sinkpad);
return;
}
}
GST_DEBUG ("Initializing seek");
g_print ("Grab seek lock\n");
gst_pad_push_event (flacdec->srcpad, gst_event_new_flush_start ());
- GST_STREAM_LOCK (flacdec->sinkpad);
+ GST_PAD_STREAM_LOCK (flacdec->sinkpad);
g_print ("Got seek lock\n");
gst_pad_push_event (flacdec->srcpad, gst_event_new_flush_stop ());
GST_DEBUG ("Ready");
flacdec->seek_value = pos;
gst_pad_start_task (flacdec->sinkpad,
(GstTaskFunction) gst_flacdec_loop, flacdec->sinkpad);
- GST_STREAM_UNLOCK (flacdec->sinkpad);
+ GST_PAD_STREAM_UNLOCK (flacdec->sinkpad);
} else
res = FALSE;
break;
GstFormat format;
gint64 start, stream_time;
- GST_STREAM_LOCK (pad);
if (flacenc->offset == 0) {
gst_event_parse_newsegment (event, NULL, NULL, &format, &start, NULL,
&stream_time);
}
gst_event_unref (event);
/* don't push it downstream, we'll generate our own via seek to 0 */
- GST_STREAM_UNLOCK (pad);
break;
}
case GST_EVENT_EOS:
- GST_STREAM_LOCK (pad);
FLAC__seekable_stream_encoder_finish (flacenc->encoder);
ret = gst_pad_event_default (pad, event);
- GST_STREAM_UNLOCK (pad);
break;
case GST_EVENT_TAG:
if (flacenc->tags) {
} else {
g_assert_not_reached ();
}
- GST_STREAM_LOCK (pad);
ret = gst_pad_event_default (pad, event);
- GST_STREAM_UNLOCK (pad);
break;
default:
ret = gst_pad_event_default (pad, event);
{
GstSignalProcessor *self;
GstSignalProcessorClass *bclass;
- gboolean ret = FALSE;
gboolean unlock;
self = GST_SIGNAL_PROCESSOR (GST_PAD_PARENT (pad));
if (bclass->event)
bclass->event (self, event);
- unlock = FALSE;
-
- switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_FLUSH_STOP:
- case GST_EVENT_EOS:
- GST_STREAM_LOCK (pad);
- unlock = TRUE;
- break;
- default:
- break;
- }
ret = gst_pad_event_default (pad, event);
- if (unlock)
- GST_STREAM_UNLOCK (pad);
return ret;
}
self = GST_SIGNAL_PROCESSOR (GST_PAD_PARENT (pad));
- GST_STREAM_LOCK (pad);
-
if (spad->pen) {
*buffer = spad->pen;
spad->pen = NULL;
}
}
- GST_STREAM_UNLOCK (pad);
-
return ret;
}
self = GST_SIGNAL_PROCESSOR (GST_PAD_PARENT (pad));
- GST_STREAM_LOCK (pad);
-
gst_signal_processor_pen_buffer (self, pad, buffer);
if (self->pending_in == 0) {
gst_signal_processor_do_pushes (self);
}
- GST_STREAM_UNLOCK (pad);
-
return self->state;
}
} else
gst_pad_pause_task (avi->sinkpad);
- GST_STREAM_LOCK (avi->sinkpad);
+ GST_PAD_STREAM_LOCK (avi->sinkpad);
/* fill current_entry according to flags and update */
if (update) {
gst_pad_start_task (avi->sinkpad, (GstTaskFunction) gst_avi_demux_loop,
avi->sinkpad);
- GST_STREAM_UNLOCK (avi->sinkpad);
+ GST_PAD_STREAM_UNLOCK (avi->sinkpad);
return TRUE;
gst_flxdec_src_event_handler (GstPad * pad, GstEvent * event)
{
GstFlxDec *flxdec = (GstFlxDec *) gst_pad_get_parent (pad);
-
- g_return_val_if_fail (GST_IS_EVENT (event), FALSE);
+ gboolean ret;
/* TODO: implement the seek and other event handling */
- return gst_pad_push_event (flxdec->sinkpad, event);
+ ret = gst_pad_push_event (flxdec->sinkpad, event);
+
+ gst_object_unref (flxdec);
+
+ return ret;
}
static gboolean
gst_flxdec_sink_event_handler (GstPad * pad, GstEvent * event)
{
- GstFlxDec *flxdec = (GstFlxDec *) gst_pad_get_parent (pad);
-
- g_return_val_if_fail (GST_IS_EVENT (event), FALSE);
-
- if (GST_EVENT_TYPE (event) == GST_EVENT_EOS ||
- GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT)
- GST_STREAM_LOCK (flxdec->srcpad);
+ GstFlxDec *flxdec;
+ gboolean ret;
- gst_pad_push_event (flxdec->srcpad, gst_event_ref (event));
+ flxdec = GST_FLXDEC (gst_pad_get_parent (pad));
- if (GST_EVENT_TYPE (event) == GST_EVENT_EOS ||
- GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT)
- GST_STREAM_UNLOCK (flxdec->srcpad);
+ ret = gst_pad_push_event (flxdec->srcpad, event);
- return TRUE;
+ gst_object_unref (flxdec);
+ return ret;
}
static void
/* now grab the stream lock so that streaming cannot continue, for
* non flushing seeks when the element is in PAUSED this could block
* forever. */
- GST_STREAM_LOCK (demux->sinkpad);
+ GST_PAD_STREAM_LOCK (demux->sinkpad);
GST_OBJECT_LOCK (demux);
demux->sinkpad);
/* streaming can continue now */
- GST_STREAM_UNLOCK (demux->sinkpad);
+ GST_PAD_STREAM_UNLOCK (demux->sinkpad);
return TRUE;
* function again so that things can continue from where they left off? */
GST_DEBUG ("Got a seek error");
GST_OBJECT_UNLOCK (demux);
- GST_STREAM_UNLOCK (demux->sinkpad);
+ GST_PAD_STREAM_UNLOCK (demux->sinkpad);
return FALSE;
}
else
gst_pad_pause_task (wav->sinkpad);
- GST_STREAM_LOCK (wav->sinkpad);
+ GST_PAD_STREAM_LOCK (wav->sinkpad);
if (update) {
wav->offset = wav->segment_start + wav->datastart;
gst_pad_start_task (wav->sinkpad, (GstTaskFunction) gst_wavparse_loop,
wav->sinkpad);
- GST_STREAM_UNLOCK (wav->sinkpad);
+ GST_PAD_STREAM_UNLOCK (wav->sinkpad);
return TRUE;