From: Philippe Proulx Date: Sat, 10 Aug 2019 19:18:17 +0000 (-0400) Subject: lib: add "get supported MIP versions" method support X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=2b55df78b247562ac2b006c597a651cfb0cf9b8b lib: add "get supported MIP versions" method support This patch adds a new optional method to component classes: get supported message interchange protocol (MIP) versions. As of this patch, you can set the "get supported MIP versions" method of a component class, but it's not used. The "message interchange protocol" term is very long so I chose to use the acronym "mip" in the API. The API documentation will make this more clear. The method is considered a "class method"; no component exists yet when calling it (like the query method). The method receives the component class, the initialization parameters, the initalization method custom data, and an existing, empty unsigned integer range set. The method's purpose is to fill this integer range set with all the MIP versions it supports depending on the initialization configuration. This makes it possible to support specific MIP versions based on an input path or URI, for example. It is a postcondition that the method adds at least one MIP version to the unsigned integer range set. The "get supported MIP versions" method is optional: not implementing it corresponds to adding [0, 0] to the unsigned integer range set. This makes it possible to implement a component class of which the instance operates according to the MIP protocol of Babeltrace 2.0. The "get supported MIP versions" method can fail, but it cannot return a "try again" status. Signed-off-by: Philippe Proulx Change-Id: Ib26ec9e90b47a3d3e51cc56465a264de9d02b97c Reviewed-on: https://review.lttng.org/c/babeltrace/+/1870 Tested-by: jenkins Reviewed-by: Simon Marchi --- diff --git a/include/babeltrace2/graph/component-class-filter.h b/include/babeltrace2/graph/component-class-filter.h index 046a43bb..d0bfbcd8 100644 --- a/include/babeltrace2/graph/component-class-filter.h +++ b/include/babeltrace2/graph/component-class-filter.h @@ -37,6 +37,13 @@ extern "C" { #endif +typedef bt_component_class_get_supported_mip_versions_method_status +(*bt_component_class_filter_get_supported_mip_versions_method)( + bt_self_component_class_filter *comp_class, + const bt_value *params, void *init_method_data, + bt_logging_level log_level, + bt_integer_range_set_unsigned *supported_versions); + typedef bt_component_class_init_method_status (*bt_component_class_filter_init_method)( bt_self_component_filter *self_component, @@ -110,6 +117,11 @@ bt_component_class_filter *bt_component_class_filter_create( const char *name, bt_component_class_filter_message_iterator_next_method method); +extern bt_component_class_set_method_status +bt_component_class_filter_set_get_supported_mip_versions_method( + bt_component_class_filter *comp_class, + bt_component_class_filter_get_supported_mip_versions_method method); + extern bt_component_class_set_method_status bt_component_class_filter_set_init_method( bt_component_class_filter *comp_class, diff --git a/include/babeltrace2/graph/component-class-sink.h b/include/babeltrace2/graph/component-class-sink.h index ef3233b7..d2ebe549 100644 --- a/include/babeltrace2/graph/component-class-sink.h +++ b/include/babeltrace2/graph/component-class-sink.h @@ -37,6 +37,13 @@ extern "C" { #endif +typedef bt_component_class_get_supported_mip_versions_method_status +(*bt_component_class_sink_get_supported_mip_versions_method)( + bt_self_component_class_sink *comp_class, + const bt_value *params, void *init_method_data, + bt_logging_level log_level, + bt_integer_range_set_unsigned *supported_versions); + typedef bt_component_class_init_method_status (*bt_component_class_sink_init_method)( bt_self_component_sink *self_component, @@ -87,6 +94,11 @@ bt_component_class *bt_component_class_sink_as_component_class( return __BT_UPCAST(bt_component_class, comp_cls_sink); } +extern bt_component_class_set_method_status +bt_component_class_sink_set_get_supported_mip_versions_method( + bt_component_class_sink *comp_class, + bt_component_class_sink_get_supported_mip_versions_method method); + extern bt_component_class_sink *bt_component_class_sink_create( const char *name, diff --git a/include/babeltrace2/graph/component-class-source.h b/include/babeltrace2/graph/component-class-source.h index 8d67bcb8..b8cf57e8 100644 --- a/include/babeltrace2/graph/component-class-source.h +++ b/include/babeltrace2/graph/component-class-source.h @@ -37,6 +37,13 @@ extern "C" { #endif +typedef bt_component_class_get_supported_mip_versions_method_status +(*bt_component_class_source_get_supported_mip_versions_method)( + bt_self_component_class_source *comp_class, + const bt_value *params, void *init_method_data, + bt_logging_level log_level, + bt_integer_range_set_unsigned *supported_versions); + typedef bt_component_class_init_method_status (*bt_component_class_source_init_method)( bt_self_component_source *self_component, @@ -104,6 +111,11 @@ bt_component_class_source *bt_component_class_source_create( const char *name, bt_component_class_source_message_iterator_next_method method); +extern bt_component_class_set_method_status +bt_component_class_source_set_get_supported_mip_versions_method( + bt_component_class_source *comp_class, + bt_component_class_source_get_supported_mip_versions_method method); + extern bt_component_class_set_method_status bt_component_class_source_set_init_method( bt_component_class_source *comp_class, diff --git a/include/babeltrace2/graph/component-class.h b/include/babeltrace2/graph/component-class.h index deba3d03..2c2a85c2 100644 --- a/include/babeltrace2/graph/component-class.h +++ b/include/babeltrace2/graph/component-class.h @@ -33,6 +33,12 @@ extern "C" { #endif +typedef enum bt_component_class_get_supported_mip_versions_method_status { + BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, + BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, + BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, +} bt_component_class_get_supported_mip_versions_method_status; + typedef enum bt_component_class_init_method_status { BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, diff --git a/include/babeltrace2/plugin/plugin-dev.h b/include/babeltrace2/plugin/plugin-dev.h index 5cc04578..cf47d00e 100644 --- a/include/babeltrace2/plugin/plugin-dev.h +++ b/include/babeltrace2/plugin/plugin-dev.h @@ -170,18 +170,19 @@ struct __bt_plugin_component_class_descriptor { enum __bt_plugin_component_class_descriptor_attribute_type { BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 0, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP = 1, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD = 2, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 3, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 4, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD = 5, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD = 6, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD = 7, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD = 8, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD = 9, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD = 10, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD = 11, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD = 12, - BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD = 13, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD = 2, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD = 3, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 4, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 5, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD = 6, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD = 7, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD = 8, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD = 9, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD = 10, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD = 11, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD = 12, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD = 13, + BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD = 14, }; /* Component class attribute (internal use) */ @@ -206,6 +207,11 @@ struct __bt_plugin_component_class_descriptor_attribute { /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */ const char *help; + /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD */ + bt_component_class_source_get_supported_mip_versions_method source_get_supported_mip_versions_method; + bt_component_class_filter_get_supported_mip_versions_method filter_get_supported_mip_versions_method; + bt_component_class_sink_get_supported_mip_versions_method sink_get_supported_mip_versions_method; + /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */ bt_component_class_source_init_method source_init_method; bt_component_class_filter_init_method filter_init_method; @@ -693,6 +699,39 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x) +/* + * Defines a "get supported MIP versions" attribute attached to a + * specific source component class descriptor. + * + * _id: Plugin descriptor ID (C identifier). + * _comp_class_id: Component class descriptor ID (C identifier). + * _x: "Get supported MIP versions" method (bt_component_class_source_get_supported_mip_versions_method). + */ +#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \ + __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, source, _x) + +/* + * Defines a "get supported MIP versions" attribute attached to a + * specific filter component class descriptor. + * + * _id: Plugin descriptor ID (C identifier). + * _comp_class_id: Component class descriptor ID (C identifier). + * _x: "Get supported MIP versions" method (bt_component_class_filter_get_supported_mip_versions_method). + */ +#define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \ + __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, filter, _x) + +/* + * Defines a "get supported MIP versions" attribute attached to a + * specific sink component class descriptor. + * + * _id: Plugin descriptor ID (C identifier). + * _comp_class_id: Component class descriptor ID (C identifier). + * _x: "Get supported MIP versions" method (bt_component_class_sink_get_supported_mip_versions_method). + */ +#define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \ + __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, sink, _x) + /* * Defines a finalization method attribute attached to a specific source * component class descriptor. @@ -1150,6 +1189,39 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_ #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \ BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x) +/* + * Defines a "get supported MIP versions" method attribute attached to a + * source component class descriptor which is attached to the automatic + * plugin descriptor. + * + * _name: Component class name (C identifier). + * _x: Initialization method (bt_component_class_source_get_supported_mip_versions_method). + */ +#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \ + BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x) + +/* + * Defines a "get supported MIP versions" method attribute attached to a + * filter component class descriptor which is attached to the automatic + * plugin descriptor. + * + * _name: Component class name (C identifier). + * _x: Initialization method (bt_component_class_filter_get_supported_mip_versions_method). + */ +#define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \ + BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x) + +/* + * Defines a "get supported MIP versions" method attribute attached to a + * sink component class descriptor which is attached to the automatic + * plugin descriptor. + * + * _name: Component class name (C identifier). + * _x: Initialization method (bt_component_class_sink_get_supported_mip_versions_method). + */ +#define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \ + BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x) + /* * Defines a finalization method attribute attached to a source component * class descriptor which is attached to the automatic plugin diff --git a/src/lib/graph/component-class.c b/src/lib/graph/component-class.c index 5ede96f0..8b5abf9b 100644 --- a/src/lib/graph/component-class.c +++ b/src/lib/graph/component-class.c @@ -261,6 +261,48 @@ end: return (void *) sink_class; } +enum bt_component_class_set_method_status +bt_component_class_source_set_get_supported_mip_versions_method( + struct bt_component_class_source *comp_cls, + bt_component_class_source_get_supported_mip_versions_method method) +{ + BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class"); + BT_ASSERT_PRE_NON_NULL(method, "Method"); + BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls); + comp_cls->methods.get_supported_mip_versions = method; + BT_LIB_LOGD("Set source component class's \"get supported MIP versions\" method: " + "%!+C", comp_cls); + return BT_FUNC_STATUS_OK; +} + +enum bt_component_class_set_method_status +bt_component_class_filter_set_get_supported_mip_versions_method( + struct bt_component_class_filter *comp_cls, + bt_component_class_filter_get_supported_mip_versions_method method) +{ + BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class"); + BT_ASSERT_PRE_NON_NULL(method, "Method"); + BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls); + comp_cls->methods.get_supported_mip_versions = method; + BT_LIB_LOGD("Set filter component class's \"get supported MIP versions\" method: " + "%!+C", comp_cls); + return BT_FUNC_STATUS_OK; +} + +enum bt_component_class_set_method_status +bt_component_class_sink_set_get_supported_mip_versions_method( + struct bt_component_class_sink *comp_cls, + bt_component_class_sink_get_supported_mip_versions_method method) +{ + BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class"); + BT_ASSERT_PRE_NON_NULL(method, "Method"); + BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls); + comp_cls->methods.get_supported_mip_versions = method; + BT_LIB_LOGD("Set sink component class's \"get supported MIP versions\" method: " + "%!+C", comp_cls); + return BT_FUNC_STATUS_OK; +} + enum bt_component_class_set_method_status bt_component_class_source_set_init_method( struct bt_component_class_source *comp_cls, diff --git a/src/lib/graph/component-class.h b/src/lib/graph/component-class.h index 838acbce..7d494aa3 100644 --- a/src/lib/graph/component-class.h +++ b/src/lib/graph/component-class.h @@ -66,6 +66,7 @@ struct bt_component_class { struct bt_component_class_source { struct bt_component_class parent; struct { + bt_component_class_source_get_supported_mip_versions_method get_supported_mip_versions; bt_component_class_source_init_method init; bt_component_class_source_finalize_method finalize; bt_component_class_source_message_iterator_init_method msg_iter_init; @@ -83,6 +84,7 @@ struct bt_component_class_source { struct bt_component_class_sink { struct bt_component_class parent; struct { + bt_component_class_sink_get_supported_mip_versions_method get_supported_mip_versions; bt_component_class_sink_init_method init; bt_component_class_sink_finalize_method finalize; bt_component_class_sink_query_method query; @@ -95,6 +97,7 @@ struct bt_component_class_sink { struct bt_component_class_filter { struct bt_component_class parent; struct { + bt_component_class_filter_get_supported_mip_versions_method get_supported_mip_versions; bt_component_class_filter_init_method init; bt_component_class_filter_finalize_method finalize; bt_component_class_filter_message_iterator_init_method msg_iter_init; diff --git a/src/lib/plugin/plugin-so.c b/src/lib/plugin/plugin-so.c index 24590cf2..260fd687 100644 --- a/src/lib/plugin/plugin-so.c +++ b/src/lib/plugin/plugin-so.c @@ -288,6 +288,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, union { struct { + bt_component_class_source_get_supported_mip_versions_method get_supported_mip_versions; bt_component_class_source_init_method init; bt_component_class_source_finalize_method finalize; bt_component_class_source_query_method query; @@ -301,6 +302,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, } source; struct { + bt_component_class_filter_get_supported_mip_versions_method get_supported_mip_versions; bt_component_class_filter_init_method init; bt_component_class_filter_finalize_method finalize; bt_component_class_filter_query_method query; @@ -315,6 +317,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, } filter; struct { + bt_component_class_sink_get_supported_mip_versions_method get_supported_mip_versions; bt_component_class_sink_init_method init; bt_component_class_sink_finalize_method finalize; bt_component_class_sink_query_method query; @@ -488,6 +491,24 @@ int bt_plugin_so_init(struct bt_plugin *plugin, cc_full_descr->help = cur_cc_descr_attr->value.help; break; + case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD: + switch (cc_type) { + case BT_COMPONENT_CLASS_TYPE_SOURCE: + cc_full_descr->methods.source.get_supported_mip_versions = + cur_cc_descr_attr->value.source_get_supported_mip_versions_method; + break; + case BT_COMPONENT_CLASS_TYPE_FILTER: + cc_full_descr->methods.filter.get_supported_mip_versions = + cur_cc_descr_attr->value.filter_get_supported_mip_versions_method; + break; + case BT_COMPONENT_CLASS_TYPE_SINK: + cc_full_descr->methods.sink.get_supported_mip_versions = + cur_cc_descr_attr->value.sink_get_supported_mip_versions_method; + break; + default: + abort(); + } + break; case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD: switch (cc_type) { case BT_COMPONENT_CLASS_TYPE_SOURCE: @@ -846,6 +867,19 @@ int bt_plugin_so_init(struct bt_plugin *plugin, switch (cc_full_descr->descriptor->type) { case BT_COMPONENT_CLASS_TYPE_SOURCE: + if (cc_full_descr->methods.source.get_supported_mip_versions) { + ret = bt_component_class_source_set_get_supported_mip_versions_method( + src_comp_class, + cc_full_descr->methods.source.get_supported_mip_versions); + if (ret) { + BT_LIB_LOGE_APPEND_CAUSE( + "Cannot set source component class's \"get supported MIP versions\" method."); + status = BT_FUNC_STATUS_MEMORY_ERROR; + BT_OBJECT_PUT_REF_AND_RESET(src_comp_class); + goto end; + } + } + if (cc_full_descr->methods.source.init) { ret = bt_component_class_source_set_init_method( src_comp_class, @@ -978,6 +1012,19 @@ int bt_plugin_so_init(struct bt_plugin *plugin, break; case BT_COMPONENT_CLASS_TYPE_FILTER: + if (cc_full_descr->methods.filter.get_supported_mip_versions) { + ret = bt_component_class_filter_set_get_supported_mip_versions_method( + flt_comp_class, + cc_full_descr->methods.filter.get_supported_mip_versions); + if (ret) { + BT_LIB_LOGE_APPEND_CAUSE( + "Cannot set filter component class's \"get supported MIP versions\" method."); + status = BT_FUNC_STATUS_MEMORY_ERROR; + BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class); + goto end; + } + } + if (cc_full_descr->methods.filter.init) { ret = bt_component_class_filter_set_init_method( flt_comp_class, @@ -1123,6 +1170,19 @@ int bt_plugin_so_init(struct bt_plugin *plugin, break; case BT_COMPONENT_CLASS_TYPE_SINK: + if (cc_full_descr->methods.sink.get_supported_mip_versions) { + ret = bt_component_class_sink_set_get_supported_mip_versions_method( + sink_comp_class, + cc_full_descr->methods.sink.get_supported_mip_versions); + if (ret) { + BT_LIB_LOGE_APPEND_CAUSE( + "Cannot set sink component class's \"get supported MIP versions\" method."); + status = BT_FUNC_STATUS_MEMORY_ERROR; + BT_OBJECT_PUT_REF_AND_RESET(sink_comp_class); + goto end; + } + } + if (cc_full_descr->methods.sink.init) { ret = bt_component_class_sink_set_init_method( sink_comp_class,