playback: Use new gst_bin_set_suppressed_flags() API instead of worrying about the flags in multiple places

This commit is contained in:
Sebastian Dröge 2016-09-12 18:37:21 +02:00
parent 657c49e83b
commit d5e8b7df6c
3 changed files with 6 additions and 13 deletions

View file

@ -677,6 +677,8 @@ gst_play_sink_init (GstPlaySink * playsink)
g_rec_mutex_init (&playsink->lock);
GST_OBJECT_FLAG_SET (playsink, GST_ELEMENT_FLAG_SINK);
gst_bin_set_suppressed_flags (GST_BIN (playsink),
GST_ELEMENT_FLAG_SOURCE | GST_ELEMENT_FLAG_SINK);
channel =
GST_COLOR_BALANCE_CHANNEL (g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL,
@ -1227,8 +1229,6 @@ add_chain (GstPlayChain * chain, gboolean add)
gst_bin_add (GST_BIN_CAST (chain->playsink), chain->bin);
else {
gst_bin_remove (GST_BIN_CAST (chain->playsink), chain->bin);
/* we don't want to lose our sink status */
GST_OBJECT_FLAG_SET (chain->playsink, GST_ELEMENT_FLAG_SINK);
}
chain->added = add;

View file

@ -740,6 +740,8 @@ gst_uri_decode_bin_init (GstURIDecodeBin * dec)
dec->ring_buffer_max_size = DEFAULT_RING_BUFFER_MAX_SIZE;
GST_OBJECT_FLAG_SET (dec, GST_ELEMENT_FLAG_SOURCE);
gst_bin_set_suppressed_flags (GST_BIN (dec),
GST_ELEMENT_FLAG_SOURCE | GST_ELEMENT_FLAG_SINK);
}
static void
@ -1680,9 +1682,6 @@ remove_decoders (GstURIDecodeBin * bin, gboolean force)
bin->pending_decodebins = NULL;
}
/* Don't loose the SOURCE flag */
GST_OBJECT_FLAG_SET (bin, GST_ELEMENT_FLAG_SOURCE);
}
static void
@ -2060,8 +2059,6 @@ could_not_link:
GST_ELEMENT_ERROR (decoder, CORE, NEGOTIATION,
(NULL), ("Can't link source to typefind element"));
gst_bin_remove (GST_BIN_CAST (decoder), typefind);
/* Don't loose the SOURCE flag */
GST_OBJECT_FLAG_SET (decoder, GST_ELEMENT_FLAG_SOURCE);
do_async_done (decoder);
return FALSE;
}
@ -2110,8 +2107,6 @@ remove_source (GstURIDecodeBin * bin)
g_hash_table_destroy (bin->streams);
bin->streams = NULL;
}
/* Don't loose the SOURCE flag */
GST_OBJECT_FLAG_SET (bin, GST_ELEMENT_FLAG_SOURCE);
}
/* is called when a dynamic source element created a new pad. */

View file

@ -741,6 +741,8 @@ gst_uri_source_bin_init (GstURISourceBin * urisrc)
urisrc->last_buffering_pct = -1;
GST_OBJECT_FLAG_SET (urisrc, GST_ELEMENT_FLAG_SOURCE);
gst_bin_set_suppressed_flags (GST_BIN (urisrc),
GST_ELEMENT_FLAG_SOURCE | GST_ELEMENT_FLAG_SINK);
}
static void
@ -1988,8 +1990,6 @@ could_not_link:
GST_ELEMENT_ERROR (urisrc, CORE, NEGOTIATION,
(NULL), ("Can't link source to typefind element"));
gst_bin_remove (GST_BIN_CAST (urisrc), typefind);
/* Don't lose the SOURCE flag */
GST_OBJECT_FLAG_SET (urisrc, GST_ELEMENT_FLAG_SOURCE);
do_async_done (urisrc);
return FALSE;
}
@ -2051,8 +2051,6 @@ remove_source (GstURISourceBin * urisrc)
gst_bin_remove (GST_BIN_CAST (urisrc), urisrc->demuxer);
urisrc->demuxer = NULL;
}
/* Don't lose the SOURCE flag */
GST_OBJECT_FLAG_SET (urisrc, GST_ELEMENT_FLAG_SOURCE);
}
/* is called when a dynamic source element created a new pad. */