struct bt_component_class *, struct bt_value *) = {
[BT_COMPONENT_TYPE_SOURCE] = bt_component_source_create,
[BT_COMPONENT_TYPE_SINK] = bt_component_sink_create,
+ [BT_COMPONENT_TYPE_FILTER] = bt_component_filter_create,
};
static
struct bt_component *) = {
[BT_COMPONENT_TYPE_SOURCE] = bt_component_source_validate,
[BT_COMPONENT_TYPE_SINK] = bt_component_sink_validate,
+ [BT_COMPONENT_TYPE_FILTER] = bt_component_filter_validate,
};
static
type = bt_component_class_get_type(component_class);
if (type <= BT_COMPONENT_TYPE_UNKNOWN ||
- type >= BT_COMPONENT_TYPE_FILTER) {
- /* Filter components are not supported yet. */
+ type > BT_COMPONENT_TYPE_FILTER) {
goto end;
}
}
component->initializing = true;
- component_class->init(component, params);
+ ret = component_class->init(component, params);
component->initializing = false;
+ if (ret != BT_COMPONENT_STATUS_OK) {
+ BT_PUT(component);
+ goto end;
+ }
ret = component_validation_funcs[type](component);
if (ret != BT_COMPONENT_STATUS_OK) {
BT_PUT(component);