+ if (component->class->type != BT_COMPONENT_CLASS_TYPE_FILTER) {
+ BT_LOGW("Invalid parameter: component's class is not a filter component class: "
+ "comp-addr=%p, comp-name=\"%s\", comp-class-type=%s",
+ component, bt_component_get_name(component),
+ bt_component_class_type_string(component->class->type));
+ status = BT_COMPONENT_STATUS_INVALID;
+ goto end;
+ }
+
+ graph = bt_component_borrow_graph(component);
+
+ if (graph && bt_graph_is_canceled(graph)) {
+ BT_LOGW("Cannot add output port to filter component: graph is canceled: "
+ "comp-addr=%p, comp-name=\"%s\", graph-addr=%p",
+ component, bt_component_get_name(component),
+ bt_component_borrow_graph(component));
+ status = BT_COMPONENT_STATUS_GRAPH_IS_CANCELED;
+ goto end;
+ }
+
+ /* bt_component_add_output_port() logs details/errors */