- PARA_INFO_LOG("activating %p (fd %d, filter node: %p)\n", gc, gc->fd, fn);
- list_del(&gc->node);
- para_list_add(&gc->fcb.node, &fn->callbacks);
+ struct btr_node *root = audiod_get_btr_root(), *parent;
+ char *name = gc->name? gc->name : "grab";
+
+ if (!root)
+ return;
+ parent = btr_search_node(gc->parent, root);
+ if (!parent)
+ return;
+ PARA_INFO_LOG("activating fd %d\n", gc->fd);
+ list_move(&gc->node, &active_grab_client_list);
+ gc->btrn = btr_new_node(&(struct btr_node_description)
+ EMBRACE(.name = name, .parent = parent));
+ gc->task.pre_select = gc_pre_select;
+ gc->task.post_select = gc_post_select;
+ snprintf(gc->task.status, sizeof(gc->task.status) - 1, "%s", name);
+ gc->task.status[sizeof(gc->task.status) - 1] = '\0';
+ gc->task.error = 0;
+ register_task(&gc->task);