lib: add "get supported MIP versions" method support
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 10 Aug 2019 19:18:17 +0000 (15:18 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 13 Aug 2019 00:28:02 +0000 (20:28 -0400)
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 <eeppeliteloop@gmail.com>
Change-Id: Ib26ec9e90b47a3d3e51cc56465a264de9d02b97c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1870
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
include/babeltrace2/graph/component-class-filter.h
include/babeltrace2/graph/component-class-sink.h
include/babeltrace2/graph/component-class-source.h
include/babeltrace2/graph/component-class.h
include/babeltrace2/plugin/plugin-dev.h
src/lib/graph/component-class.c
src/lib/graph/component-class.h
src/lib/plugin/plugin-so.c

index 046a43bb5bfa5ad3959d3cac2f1baa27f87e24d0..d0bfbcd895846af39656b4f51921f24ba46a91eb 100644 (file)
 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,
index ef3233b76135bb40f6d5fc815fb440fc2c1e2ba2..d2ebe549fdb1e86c1372173dab8710d805ae2474 100644 (file)
 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,
index 8d67bcb8c8c1115518f91039910ed66456794d9c..b8cf57e8f6c7fd3ca583d338a1ee5984709d8ce8 100644 (file)
 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,
index deba3d03959d3c118a1a181a41ef66be65bed8ae..2c2a85c23c3139879b4e8bf5f31c3a1f0ad2cdfe 100644 (file)
 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,
index 5cc04578434d3948ee2beb7899ccc3355463d02f..cf47d00ef6a07624a5cbe8aa89638176ec052f95 100644 (file)
@@ -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
index 5ede96f08a730bb532e97dbe4bb57a971d2a5f6b..8b5abf9b31a4a1b52b8209eae0104d3383cf0904 100644 (file)
@@ -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,
index 838acbcebd116074b754171efe27ff0d4d9d4ef8..7d494aa3f7a57e667860a559698e1b7f9e6daded 100644 (file)
@@ -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;
index 24590cf2041d985237292cfde7e4f23a534ecf25..260fd687e8c086df6c6d7eefacd7948e98e4bc34 100644 (file)
@@ -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,
This page took 0.031366 seconds and 4 git commands to generate.