- if (comp->class->methods.accept_port_connection) {
- BT_LOGD("Calling user's \"accept port connection\" method: "
- "comp-addr=%p, comp-name=\"%s\", "
- "self-port-addr=%p, self-port-name=\"%s\", "
- "other-port-addr=%p, other-port-name=\"%s\"",
- comp, bt_component_get_name(comp),
- self_port, bt_port_get_name(self_port),
- other_port, bt_port_get_name(other_port));
- status = comp->class->methods.accept_port_connection(
- bt_private_component_from_component(comp),
- bt_private_port_from_port(self_port),
- other_port);
- BT_LOGD("User method returned: status=%s",
- bt_component_status_string(status));
+ switch (comp->class->type) {
+ case BT_COMPONENT_CLASS_TYPE_SOURCE:
+ {
+ struct bt_component_class_source *src_cc = (void *) comp->class;
+
+ switch (self_port->type) {
+ case BT_PORT_TYPE_OUTPUT:
+ method = (method_t) src_cc->methods.output_port_connected;
+ break;
+ default:
+ abort();
+ }
+
+ break;