+ typedef enum bt_self_notification_iterator_status (*init_method_t)(
+ void *, void *, void *);
+
+ init_method_t init_method = NULL;
+ struct bt_self_component_port_input_notification_iterator *iterator =
+ NULL;
+ struct bt_port *port = (void *) self_port;
+ struct bt_port *upstream_port;
+ struct bt_component *comp;
+ struct bt_component *upstream_comp;
+ struct bt_component_class *upstream_comp_cls;
+
+ BT_ASSERT_PRE_NON_NULL(port, "Port");
+ comp = bt_port_borrow_component(port);
+ BT_ASSERT_PRE(bt_port_is_connected(port),
+ "Port is not connected: %![port-]+p", port);
+ BT_ASSERT_PRE(comp, "Port is not part of a component: %![port-]+p",
+ port);
+ BT_ASSERT_PRE(!bt_component_graph_is_canceled(comp),
+ "Port's component's graph is canceled: "
+ "%![port-]+p, %![comp-]+c", port, comp);
+ BT_ASSERT(port->connection);
+ upstream_port = port->connection->upstream_port;
+ BT_ASSERT(upstream_port);
+ upstream_comp = bt_port_borrow_component(upstream_port);
+ BT_ASSERT(upstream_comp);
+ upstream_comp_cls = upstream_comp->class;
+ BT_ASSERT(upstream_comp->class->type ==
+ BT_COMPONENT_CLASS_TYPE_SOURCE ||
+ upstream_comp->class->type ==
+ BT_COMPONENT_CLASS_TYPE_FILTER);
+ iterator = bt_self_component_port_input_notification_iterator_create_initial(
+ upstream_comp, upstream_port);
+ if (!iterator) {
+ BT_LOGW_STR("Cannot create self component input port "
+ "notification iterator.");
+ goto end;
+ }