GstDecodeChain *decode_chain; /* Top level decode chain */
gint nbpads; /* unique identifier for source pads */
+ guint32 factories_cookie; /* Cookie from last time when factories was updated */
GValueArray *factories; /* factories we can use for selecting elements */
GMutex *subtitle_lock; /* Protects changes to subtitles and encoding */
/* first filter out the interesting element factories */
decode_bin->factories =
gst_factory_list_get_elements (GST_FACTORY_LIST_DECODER);
+ decode_bin->factories_cookie =
+ gst_default_registry_get_feature_list_cookie ();
/* we create the typefind element only once */
decode_bin->typefind = gst_element_factory_make ("typefind", "typefind");
case GST_STATE_CHANGE_NULL_TO_READY:
if (dbin->typefind == NULL)
goto missing_typefind;
+ if (dbin->factories_cookie !=
+ gst_default_registry_get_feature_list_cookie ()) {
+ if (dbin->factories)
+ g_value_array_free (dbin->factories);
+ dbin->factories =
+ gst_factory_list_get_elements (GST_FACTORY_LIST_DECODER);
+ dbin->factories_cookie =
+ gst_default_registry_get_feature_list_cookie ();
+ }
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
DYN_LOCK (dbin);
/* if we are shutting down or not */
gint shutdown;
+ guint32 elements_cookie;
GValueArray *elements; /* factories we can use for selecting elements */
gboolean have_selector; /* set to FALSE when we fail to create an
/* first filter out the interesting element factories */
type = GST_FACTORY_LIST_DECODER | GST_FACTORY_LIST_SINK;
playbin->elements = gst_factory_list_get_elements (type);
+ playbin->elements_cookie = gst_default_registry_get_feature_list_cookie ();
gst_factory_list_debug (playbin->elements);
/* add sink */
playbin = GST_PLAY_BIN (element);
switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
+ if (playbin->elements_cookie !=
+ gst_default_registry_get_feature_list_cookie ()) {
+ if (playbin->elements)
+ g_value_array_free (playbin->elements);
+ playbin->elements =
+ gst_factory_list_get_elements (GST_FACTORY_LIST_DECODER);
+ playbin->elements_cookie =
+ gst_default_registry_get_feature_list_cookie ();
+ }
+ break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
GST_LOG_OBJECT (playbin, "clearing shutdown flag");
g_atomic_int_set (&playbin->shutdown, 0);
GMutex *lock; /* lock for constructing */
+ guint32 factories_cookie;
GValueArray *factories; /* factories we can use for selecting elements */
gchar *uri;
{
/* first filter out the interesting element factories */
dec->factories = gst_factory_list_get_elements (GST_FACTORY_LIST_DECODER);
+ dec->factories_cookie = gst_default_registry_get_feature_list_cookie ();
dec->lock = g_mutex_new ();
decoder = GST_URI_DECODE_BIN (element);
switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
+ if (decoder->factories_cookie !=
+ gst_default_registry_get_feature_list_cookie ()) {
+ if (decoder->factories)
+ g_value_array_free (decoder->factories);
+ decoder->factories =
+ gst_factory_list_get_elements (GST_FACTORY_LIST_DECODER);
+ decoder->factories_cookie =
+ gst_default_registry_get_feature_list_cookie ();
+ }
+ break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
if (!setup_source (decoder))
goto source_failed;