fix for new pad probe types

Restore the previous behaviour by only blocking downstream items and not
upstream events.
This commit is contained in:
Wim Taymans 2011-11-07 17:10:48 +01:00
parent ef0247ae42
commit 616e9b706e
7 changed files with 34 additions and 29 deletions

View file

@ -506,7 +506,7 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
gst_object_unref (sinkpad);
/* Add an event probe */
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT,
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
(GstPadProbeCallback) _event_probe, ps, NULL);
DISCO_LOCK (dc);

View file

@ -1685,8 +1685,8 @@ setup_caps_delay:
ppad->pad = gst_object_ref (pad);
ppad->chain = chain;
ppad->event_probe_id =
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT, pad_event_cb, ppad,
NULL);
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
pad_event_cb, ppad, NULL);
chain->pending_pads = g_list_prepend (chain->pending_pads, ppad);
g_signal_connect (G_OBJECT (pad), "notify::caps",
G_CALLBACK (caps_notify_cb), chain);
@ -3794,7 +3794,8 @@ gst_decode_pad_set_blocked (GstDecodePad * dpad, gboolean blocked)
if (!blocked || !dbin->shutdown) {
if (blocked) {
if (dpad->block_id == 0)
dpad->block_id = gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK,
dpad->block_id =
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
source_pad_blocked_cb, gst_object_ref (dpad),
(GDestroyNotify) gst_object_unref);
} else {
@ -3833,7 +3834,7 @@ out:
static void
gst_decode_pad_add_drained_check (GstDecodePad * dpad)
{
gst_pad_add_probe (GST_PAD_CAST (dpad), GST_PAD_PROBE_TYPE_EVENT,
gst_pad_add_probe (GST_PAD_CAST (dpad), GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
source_pad_event_probe, dpad, NULL);
}

View file

@ -1671,8 +1671,8 @@ gst_play_bin_suburidecodebin_block (GstSourceGroup * group,
sinkpad = g_value_get_object (&item);
if (block) {
group->block_id =
gst_pad_add_probe (sinkpad, GST_PAD_PROBE_TYPE_BLOCK, NULL, NULL,
NULL);
gst_pad_add_probe (sinkpad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
NULL, NULL, NULL);
} else if (group->block_id) {
gst_pad_remove_probe (sinkpad, group->block_id);
group->block_id = 0;
@ -2589,8 +2589,8 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group)
* configured the sinks we will unblock them all. */
GST_DEBUG_OBJECT (playbin, "blocking %" GST_PTR_FORMAT, select->srcpad);
select->block_id =
gst_pad_add_probe (select->srcpad, GST_PAD_PROBE_TYPE_BLOCK, NULL, NULL,
NULL);
gst_pad_add_probe (select->srcpad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
NULL, NULL, NULL);
}
/* get sinkpad for the new stream */
@ -2899,7 +2899,8 @@ no_more_pads_cb (GstElement * decodebin, GstSourceGroup * group)
pad might not be linked yet. Additionally, sending it here
apparently would be on the wrong thread */
select->sinkpad_data_probe =
gst_pad_add_probe (select->sinkpad, GST_PAD_PROBE_TYPE_DATA,
gst_pad_add_probe (select->sinkpad,
GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM,
(GstPadProbeCallback) stream_changed_data_probe, (gpointer) select,
NULL);

View file

@ -799,7 +799,7 @@ gst_play_sink_set_vis_plugin (GstPlaySink * playsink, GstElement * vis)
* function returns FALSE but the previous pad block will do the right thing
* anyway. */
GST_DEBUG_OBJECT (playsink, "blocking vis pad");
gst_pad_add_probe (chain->blockpad, GST_PAD_PROBE_TYPE_BLOCK,
gst_pad_add_probe (chain->blockpad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
gst_play_sink_vis_blocked, playsink, NULL);
done:
GST_PLAY_SINK_UNLOCK (playsink);
@ -2940,8 +2940,9 @@ video_set_blocked (GstPlaySink * playsink, gboolean blocked)
(playsink->video_pad)));
if (blocked && playsink->video_block_id == 0) {
playsink->video_block_id =
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK, sinkpad_blocked_cb,
gst_object_ref (playsink), (GDestroyNotify) gst_object_unref);
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
sinkpad_blocked_cb, gst_object_ref (playsink),
(GDestroyNotify) gst_object_unref);
} else if (!blocked && playsink->video_block_id) {
gst_pad_remove_probe (opad, playsink->video_block_id);
PENDING_FLAG_UNSET (playsink, GST_PLAY_SINK_TYPE_VIDEO_RAW);
@ -2962,8 +2963,9 @@ audio_set_blocked (GstPlaySink * playsink, gboolean blocked)
(playsink->audio_pad)));
if (blocked && playsink->audio_block_id == 0) {
playsink->audio_block_id =
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK, sinkpad_blocked_cb,
gst_object_ref (playsink), (GDestroyNotify) gst_object_unref);
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
sinkpad_blocked_cb, gst_object_ref (playsink),
(GDestroyNotify) gst_object_unref);
} else if (!blocked && playsink->audio_block_id) {
gst_pad_remove_probe (opad, playsink->audio_block_id);
PENDING_FLAG_UNSET (playsink, GST_PLAY_SINK_TYPE_AUDIO_RAW);
@ -2984,8 +2986,9 @@ text_set_blocked (GstPlaySink * playsink, gboolean blocked)
(playsink->text_pad)));
if (blocked && playsink->text_block_id == 0) {
playsink->text_block_id =
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK, sinkpad_blocked_cb,
gst_object_ref (playsink), (GDestroyNotify) gst_object_unref);
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
sinkpad_blocked_cb, gst_object_ref (playsink),
(GDestroyNotify) gst_object_unref);
} else if (!blocked && playsink->text_block_id) {
gst_pad_remove_probe (opad, playsink->text_block_id);
PENDING_FLAG_UNSET (playsink, GST_PLAY_SINK_TYPE_TEXT);
@ -3206,7 +3209,7 @@ gst_play_sink_request_pad (GstPlaySink * playsink, GstPlaySinkType type)
GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD (res)));
*block_id =
gst_pad_add_probe (blockpad, GST_PAD_PROBE_TYPE_BLOCK,
gst_pad_add_probe (blockpad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
sinkpad_blocked_cb, gst_object_ref (playsink),
(GDestroyNotify) gst_object_unref);
PENDING_FLAG_SET (playsink, type);

View file

@ -299,9 +299,9 @@ block_proxypad (GstPlaySinkConvertBin * self)
{
if (self->sink_proxypad_block_id == 0) {
self->sink_proxypad_block_id =
gst_pad_add_probe (self->sink_proxypad, GST_PAD_PROBE_TYPE_BLOCK,
pad_blocked_cb, gst_object_ref (self),
(GDestroyNotify) gst_object_unref);
gst_pad_add_probe (self->sink_proxypad,
GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM, pad_blocked_cb,
gst_object_ref (self), (GDestroyNotify) gst_object_unref);
}
}

View file

@ -120,8 +120,8 @@ block_video (GstSubtitleOverlay * self)
if (self->video_block_pad) {
self->video_block_id =
gst_pad_add_probe (self->video_block_pad, GST_PAD_PROBE_TYPE_BLOCK,
_pad_blocked_cb, self, NULL);
gst_pad_add_probe (self->video_block_pad,
GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM, _pad_blocked_cb, self, NULL);
}
}
@ -143,8 +143,8 @@ block_subtitle (GstSubtitleOverlay * self)
if (self->subtitle_block_pad) {
self->subtitle_block_id =
gst_pad_add_probe (self->subtitle_block_pad, GST_PAD_PROBE_TYPE_BLOCK,
_pad_blocked_cb, self, NULL);
gst_pad_add_probe (self->subtitle_block_pad,
GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM, _pad_blocked_cb, self, NULL);
}
}

View file

@ -1060,8 +1060,8 @@ new_decoded_pad_added_cb (GstElement * element, GstPad * pad,
/* add event probe to monitor tags */
stream = g_slice_alloc0 (sizeof (GstURIDecodeBinStream));
stream->probe_id =
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT, decoded_pad_event_probe,
decoder, NULL);
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
decoded_pad_event_probe, decoder, NULL);
GST_URI_DECODE_BIN_LOCK (decoder);
g_hash_table_insert (decoder->streams, pad, stream);
GST_URI_DECODE_BIN_UNLOCK (decoder);
@ -1095,8 +1095,8 @@ static void
expose_decoded_pad (GstElement * element, GstPad * pad,
GstURIDecodeBin * decoder)
{
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT, source_pad_event_probe,
decoder, NULL);
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
source_pad_event_probe, decoder, NULL);
new_decoded_pad_added_cb (element, pad, decoder);
}