+ BT_SELF_COMPONENT_PORT_INPUT_NOTIFICATION_ITERATOR_MOVE_REF(
+ dummy->notif_iter, iterator);
+
+end:
+ return status;
+}
+
+BT_HIDDEN
+enum bt_self_component_status dummy_consume(
+ bt_self_component_sink *component)
+{
+ enum bt_self_component_status ret = BT_SELF_COMPONENT_STATUS_OK;
+ bt_notification_array_const notifs;
+ uint64_t count;
+ struct dummy *dummy;
+ enum bt_notification_iterator_status it_ret;
+ uint64_t i;
+
+ dummy = bt_self_component_get_data(
+ bt_self_component_sink_as_self_component(component));
+ BT_ASSERT(dummy);
+
+ if (unlikely(!dummy->notif_iter)) {
+ ret = BT_SELF_COMPONENT_STATUS_END;
+ goto end;
+ }
+
+ /* Consume one notification */
+ it_ret = bt_self_component_port_input_notification_iterator_next(
+ dummy->notif_iter, ¬ifs, &count);
+ switch (it_ret) {
+ case BT_NOTIFICATION_ITERATOR_STATUS_OK:
+ ret = BT_SELF_COMPONENT_STATUS_OK;
+
+ for (i = 0; i < count; i++) {
+ bt_notification_put_ref(notifs[i]);
+ }
+
+ break;
+ case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN:
+ ret = BT_SELF_COMPONENT_STATUS_AGAIN;
+ goto end;
+ case BT_NOTIFICATION_ITERATOR_STATUS_END:
+ ret = BT_SELF_COMPONENT_STATUS_END;
+ goto end;
+ case BT_NOTIFICATION_ITERATOR_STATUS_ERROR:
+ ret = BT_SELF_COMPONENT_STATUS_ERROR;
+ goto end;
+ case BT_NOTIFICATION_ITERATOR_STATUS_NOMEM:
+ ret = BT_SELF_COMPONENT_STATUS_NOMEM;
+ goto end;
+ default:
+ break;