Implement bt_component_sink_set_handle_notification_cb
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 25 Feb 2016 17:30:57 +0000 (12:30 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 16:57:26 +0000 (12:57 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/plugin-system/sink.c

index c1d1df066859cbf2ed637634c70d57f71effed60..7067e06edc395baaf465eb957b17c9dd9e3c825a 100644 (file)
@@ -142,3 +142,26 @@ enum bt_component_status bt_component_sink_register_notification_type(
 end:
        return ret;
 }
+
+enum bt_component_status bt_component_sink_set_handle_notification_cb(
+               struct bt_component *component,
+               bt_component_sink_handle_notification_cb handle_notification)
+{
+       enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
+       struct bt_component_sink *sink = NULL;
+
+       if (!component) {
+               ret = BT_COMPONENT_STATUS_INVALID;
+               goto end;
+       }
+
+       if (bt_component_get_type(component) != BT_COMPONENT_TYPE_SINK) {
+               ret = BT_COMPONENT_STATUS_UNSUPPORTED;
+               goto end;
+       }
+
+       sink = container_of(component, struct bt_component_sink, parent);
+       sink->handle_notification = handle_notification;
+end:
+       return ret;
+}
This page took 0.025562 seconds and 4 git commands to generate.