Implementation of bt_component_sink_handle_notification
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 8 Jul 2015 19:56:07 +0000 (15:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 16:57:25 +0000 (12:57 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/sink.c

index 911b5e84060088eadd45ddcc89df00b2ff0d0282..ea7d799373e02757fe45a3eb7912e6548ee7149c 100644 (file)
@@ -72,3 +72,27 @@ struct bt_component *bt_component_sink_create(const char *name,
 end:
        return sink ? &sink->parent : NULL;
 }
+
+enum bt_component_status bt_component_sink_handle_notification(
+               struct bt_component *component,
+               struct bt_notification *notification)
+{
+       enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
+       struct bt_component_sink *sink = NULL;
+
+       if (!component || !notification) {
+               ret = BT_COMPONENT_STATUS_INVAL;
+               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);
+       assert(sink->handle_notification);
+       ret = sink->handle_notification(component, notification);
+end:
+       return ret;
+}
This page took 0.024926 seconds and 4 git commands to generate.