KmsParseTreeBin * kms_parse_tree_bin_new (const GstCaps * caps) { GObject *parse; parse = g_object_new (KMS_TYPE_PARSE_TREE_BIN, NULL); kms_parse_tree_bin_configure (KMS_PARSE_TREE_BIN (parse), caps); return KMS_PARSE_TREE_BIN (parse); }
static void kms_agnostic_bin2_configure_input (KmsAgnosticBin2 * self, const GstCaps * caps) { KmsParseTreeBin *parse_bin; GstElement *parser; GstPad *parser_src; GstElement *input_element; KMS_AGNOSTIC_BIN2_LOCK (self); if (self->priv->input_bin != NULL) { kms_tree_bin_unlink_input_element_from_tee (KMS_TREE_BIN (self-> priv->input_bin)); } parse_bin = kms_parse_tree_bin_new (caps); self->priv->input_bin = GST_BIN (parse_bin); parser = kms_parse_tree_bin_get_parser (KMS_PARSE_TREE_BIN (parse_bin)); parser_src = gst_element_get_static_pad (parser, "src"); gst_pad_add_probe (parser_src, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, input_bin_src_caps_probe, g_object_ref (parse_bin), g_object_unref); g_object_unref (parser_src); gst_bin_add (GST_BIN (self), GST_ELEMENT (parse_bin)); gst_element_sync_state_with_parent (GST_ELEMENT (parse_bin)); input_element = kms_tree_bin_get_input_element (KMS_TREE_BIN (parse_bin)); link_element_to_tee (self->priv->input_tee, input_element); self->priv->started = FALSE; GST_DEBUG ("Removing old treebins"); g_hash_table_foreach (self->priv->bins, remove_bin, self); g_hash_table_remove_all (self->priv->bins); KMS_AGNOSTIC_BIN2_UNLOCK (self); }