static void update_av_offset (GstPlaySink * playsink);
+static gboolean gst_play_sink_do_reconfigure (GstPlaySink * playsink);
+
static GQuark _playsink_reset_segment_event_marker_id = 0;
/* static guint gst_play_sink_signals[LAST_SIGNAL] = { 0 }; */
gstbin_klass->handle_message =
GST_DEBUG_FUNCPTR (gst_play_sink_handle_message);
- klass->reconfigure = GST_DEBUG_FUNCPTR (gst_play_sink_reconfigure);
+ klass->reconfigure = GST_DEBUG_FUNCPTR (gst_play_sink_do_reconfigure);
klass->convert_sample = GST_DEBUG_FUNCPTR (gst_play_sink_convert_sample);
_playsink_reset_segment_event_marker_id =
* have to construct the final pipeline. Based on the flags we construct the
* final output pipelines.
*/
-gboolean
-gst_play_sink_reconfigure (GstPlaySink * playsink)
+static gboolean
+gst_play_sink_do_reconfigure (GstPlaySink * playsink)
{
GstPlayFlags flags;
gboolean need_audio, need_video, need_deinterlace, need_vis, need_text;
}
}
+gboolean
+gst_play_sink_reconfigure (GstPlaySink * playsink)
+{
+ GST_LOG_OBJECT (playsink, "Triggering reconfiguration");
+
+ GST_PLAY_SINK_LOCK (playsink);
+ video_set_blocked (playsink, TRUE);
+ audio_set_blocked (playsink, TRUE);
+ text_set_blocked (playsink, TRUE);
+ GST_PLAY_SINK_UNLOCK (playsink);
+
+ return TRUE;
+}
+
static GstPadProbeReturn
sinkpad_blocked_cb (GstPad * blockedpad, GstPadProbeInfo * info,
gpointer user_data)
playsink->audio_pad_raw);
}
- gst_play_sink_reconfigure (playsink);
+ gst_play_sink_do_reconfigure (playsink);
video_set_blocked (playsink, FALSE);
audio_set_blocked (playsink, FALSE);
gst_caps_unref (caps);
- if (reconfigure) {
- GST_PLAY_SINK_LOCK (playsink);
- video_set_blocked (playsink, TRUE);
- audio_set_blocked (playsink, TRUE);
- text_set_blocked (playsink, TRUE);
- GST_PLAY_SINK_UNLOCK (playsink);
- }
+ if (reconfigure)
+ gst_play_sink_reconfigure (playsink);
}
void
ret = GST_STATE_CHANGE_ASYNC;
/* block all pads here */
- GST_PLAY_SINK_LOCK (playsink);
- if (playsink->video_pad && playsink->video_block_id == 0) {
- GstPad *opad =
- GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD
- (playsink->video_pad)));
- playsink->video_block_id =
- gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
- sinkpad_blocked_cb, playsink, NULL);
- PENDING_FLAG_SET (playsink, GST_PLAY_SINK_TYPE_VIDEO);
- gst_object_unref (opad);
- }
-
- if (playsink->audio_pad && playsink->audio_block_id == 0) {
- GstPad *opad =
- GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD
- (playsink->audio_pad)));
- playsink->audio_block_id =
- gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
- sinkpad_blocked_cb, playsink, NULL);
- PENDING_FLAG_SET (playsink, GST_PLAY_SINK_TYPE_AUDIO);
- gst_object_unref (opad);
- }
-
- if (playsink->text_pad && playsink->text_block_id == 0) {
- GstPad *opad =
- GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD
- (playsink->text_pad)));
- playsink->text_block_id =
- gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
- sinkpad_blocked_cb, playsink, NULL);
- PENDING_FLAG_SET (playsink, GST_PLAY_SINK_TYPE_TEXT);
- gst_object_unref (opad);
- }
- GST_PLAY_SINK_UNLOCK (playsink);
+ if (!gst_play_sink_reconfigure (playsink))
+ ret = GST_STATE_CHANGE_FAILURE;
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
/* unblock all pads here */