/* try to reactivate the chain */
if ((playsink->video_sink
&& playsink->video_sink != playsink->videochain->sink)
+ || (playsink->video_filter
+ && playsink->video_filter != playsink->videochain->filter)
|| !setup_video_chain (playsink, raw, async)) {
if (playsink->video_sinkpad_stream_synchronizer) {
gst_element_release_request_pad (GST_ELEMENT_CAST
playsink->videochain->sink);
}
+ /* Remove the filter from the bin to keep its state
+ * and unparent it to allow reuse */
+ if (playsink->videochain->filter) {
+ if (playsink->videochain->filter != playsink->video_filter)
+ gst_element_set_state (playsink->videochain->filter,
+ GST_STATE_NULL);
+ gst_bin_remove (GST_BIN_CAST (playsink->videochain->chain.bin),
+ playsink->videochain->filter);
+ }
+
activate_chain (GST_PLAY_CHAIN (playsink->videochain), FALSE);
free_chain ((GstPlayChain *) playsink->videochain);
playsink->videochain = NULL;
if (playsink->video_sink)
gst_element_set_state (playsink->video_sink, GST_STATE_NULL);
+ if (playsink->video_filter)
+ gst_element_set_state (playsink->video_filter, GST_STATE_NULL);
}
if (need_audio) {
/* try to reactivate the chain */
if ((playsink->audio_sink
&& playsink->audio_sink != playsink->audiochain->sink)
+ || (playsink->audio_filter
+ && playsink->audio_filter != playsink->audiochain->filter)
|| !setup_audio_chain (playsink, raw)) {
GST_DEBUG_OBJECT (playsink, "removing current audio chain");
if (playsink->audio_tee_asrc) {
playsink->audiochain->sink);
}
+ /* Remove the filter from the bin to keep its state
+ * and unparent it to allow reuse */
+ if (playsink->audiochain->filter) {
+ if (playsink->audiochain->filter != playsink->audio_filter)
+ gst_element_set_state (playsink->audiochain->filter,
+ GST_STATE_NULL);
+ gst_bin_remove (GST_BIN_CAST (playsink->audiochain->chain.bin),
+ playsink->audiochain->filter);
+ }
+
activate_chain (GST_PLAY_CHAIN (playsink->audiochain), FALSE);
disconnect_audio_chain (playsink->audiochain, playsink);
if (playsink->audiochain->volume)
if (playsink->audio_sink)
gst_element_set_state (playsink->audio_sink, GST_STATE_NULL);
+ if (playsink->audio_filter)
+ gst_element_set_state (playsink->audio_filter, GST_STATE_NULL);
}
if (need_vis) {
gst_element_set_state (playsink->visualisation, GST_STATE_NULL);
if (playsink->text_sink != NULL)
gst_element_set_state (playsink->text_sink, GST_STATE_NULL);
+
+ /* Unparent the filters to allow reuse */
+ if (playsink->videochain && playsink->videochain->filter)
+ gst_bin_remove (GST_BIN_CAST (playsink->videochain->chain.bin),
+ playsink->videochain->filter);
+ if (playsink->audiochain && playsink->audiochain->filter)
+ gst_bin_remove (GST_BIN_CAST (playsink->audiochain->chain.bin),
+ playsink->audiochain->filter);
+ if (playsink->audio_filter != NULL)
+ gst_element_set_state (playsink->audio_filter, GST_STATE_NULL);
+ if (playsink->video_filter != NULL)
+ gst_element_set_state (playsink->video_filter, GST_STATE_NULL);
+
free_chain ((GstPlayChain *) playsink->videodeinterlacechain);
playsink->videodeinterlacechain = NULL;
free_chain ((GstPlayChain *) playsink->videochain);