fn->private_data = NULL;
}
-static int aacdec_post_select(__a_unused struct sched *s, void *context)
+static int aacdec_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct btr_node *btrn = fn->btrn;
const struct filter lsg_filter_cmd_com_aacdec_user_data = {
.open = aacdec_open,
.close = aacdec_close,
- .pre_select = generic_filter_pre_select,
- .post_select = aacdec_post_select,
+ .pre_monitor = generic_filter_pre_monitor,
+ .post_monitor = aacdec_post_monitor,
.execute = aacdec_execute
};
freep(&rn->private_data);
}
-static void afh_recv_pre_select(struct sched *s, void *context)
+static void afh_recv_pre_monitor(struct sched *s, void *context)
{
struct receiver_node *rn = context;
struct private_afh_recv_data *pard = rn->private_data;
struct afh_info *afhi = &pard->afhi;
struct lls_parse_result *lpr = rn->lpr;
struct timeval chunk_time;
- int state = generic_recv_pre_select(s, rn);
+ int state = generic_recv_pre_monitor(s, rn);
unsigned j_given = RECV_CMD_OPT_GIVEN(AFH, JUST_IN_TIME, lpr);
if (state <= 0)
sched_request_barrier_or_min_delay(&chunk_time, s);
}
-static int afh_recv_post_select(__a_unused struct sched *s, void *context)
+static int afh_recv_post_monitor(__a_unused struct sched *s, void *context)
{
struct receiver_node *rn = context;
struct lls_parse_result *lpr = rn->lpr;
const struct receiver lsg_recv_cmd_com_afh_user_data = {
.open = afh_recv_open,
.close = afh_recv_close,
- .pre_select = afh_recv_pre_select,
- .post_select = afh_recv_post_select,
+ .pre_monitor = afh_recv_pre_monitor,
+ .post_monitor = afh_recv_post_monitor,
.execute = afh_execute,
};
return ret;
}
-static int afs_signal_post_select(struct sched *s, __a_unused void *context)
+static int afs_signal_post_monitor(struct sched *s, __a_unused void *context)
{
int signum, ret;
signal_task->task = task_register(&(struct task_info) {
.name = "signal",
- .pre_select = signal_pre_select,
- .post_select = afs_signal_post_select,
+ .pre_monitor = signal_pre_monitor,
+ .post_monitor = afs_signal_post_monitor,
.context = signal_task,
}, s);
struct timeval connect_time;
};
-static void command_pre_select(struct sched *s, void *context)
+static void command_pre_monitor(struct sched *s, void *context)
{
struct command_task *ct = context;
struct afs_client *client;
/** Shutdown connection if query has not arrived until this many seconds. */
#define AFS_CLIENT_TIMEOUT 3
-static int command_post_select(struct sched *s, void *context)
+static int command_post_monitor(struct sched *s, void *context)
{
struct command_task *ct = context;
struct sockaddr_un unix_addr;
ct->task = task_register(&(struct task_info) {
.name = "afs command",
- .pre_select = command_pre_select,
- .post_select = command_post_select,
+ .pre_monitor = command_pre_monitor,
+ .post_monitor = command_post_monitor,
.context = ct,
}, s);
}
return ret;
}
-static void alsa_write_pre_select(struct sched *s, void *context)
+static void alsa_write_pre_monitor(struct sched *s, void *context)
{
struct pollfd pfd;
struct writer_node *wn = context;
free(pad);
}
-static int alsa_write_post_select(__a_unused struct sched *s, void *context)
+static int alsa_write_post_monitor(__a_unused struct sched *s, void *context)
{
struct writer_node *wn = context;
struct private_alsa_write_data *pad = wn->private_data;
struct writer lsg_write_cmd_com_alsa_user_data = {
- .pre_select = alsa_write_pre_select,
- .post_select = alsa_write_post_select,
+ .pre_monitor = alsa_write_pre_monitor,
+ .post_monitor = alsa_write_post_monitor,
.close = alsa_close,
};
pad->amp, pad->amp / 64.0 + 1.0);
}
-static int amp_post_select(__a_unused struct sched *s, void *context)
+static int amp_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct private_amp_data *pad = fn->private_data;
const struct filter lsg_filter_cmd_com_amp_user_data = {
.open = amp_open,
.close = amp_close,
- .pre_select = generic_filter_pre_select,
- .post_select = amp_post_select,
+ .pre_monitor = generic_filter_pre_monitor,
+ .post_monitor = amp_post_monitor,
};
ao_shutdown();
}
-static void aow_pre_select(struct sched *s, void *context)
+static void aow_pre_monitor(struct sched *s, void *context)
{
struct writer_node *wn = context;
struct private_aow_data *pawd = wn->private_data;
return -E_AO_PTHREAD;
}
-static int aow_post_select(__a_unused struct sched *s, void *context)
+static int aow_post_monitor(__a_unused struct sched *s, void *context)
{
struct writer_node *wn = context;
struct private_aow_data *pawd = wn->private_data;
struct writer lsg_write_cmd_com_ao_user_data = {
.close = aow_close,
- .pre_select = aow_pre_select,
- .post_select = aow_post_select,
+ .pre_monitor = aow_pre_monitor,
+ .post_monitor = aow_post_monitor,
};
{.name = NULL}
};
-static void audioc_pre_select(struct sched *s, void *context)
+static void audioc_pre_monitor(struct sched *s, void *context)
{
struct audioc_task *at = context;
int ret = btr_node_status(at->btrn, 0, BTR_NT_ROOT);
sched_monitor_readfd(at->fd, s);
}
-static int audioc_post_select(struct sched *s, void *context)
+static int audioc_post_monitor(struct sched *s, void *context)
{
char *buf = NULL;
struct audioc_task *at = context;
EMBRACE(.name = "audioc line handler"));
at->task = task_register(&(struct task_info) {
.name = "audioc",
- .pre_select = audioc_pre_select,
- .post_select = audioc_post_select,
+ .pre_monitor = audioc_pre_monitor,
+ .post_monitor = audioc_post_monitor,
.context = at,
}, &sched);
i9e_attach_to_stdout(at->btrn);
sprintf(buf, "%s (slot %d)", name, (int)(s - slot));
fn->task = task_register(&(struct task_info) {
.name = buf,
- .pre_select = f->pre_select,
- .post_select = f->post_select,
+ .pre_monitor = f->pre_monitor,
+ .post_monitor = f->post_monitor,
.context = fn,
}, &sched);
parent = fn->btrn;
audio_formats[format], name, slot_num);
rn->task = task_register(&(struct task_info) {
.name = name,
- .pre_select = r->pre_select,
- .post_select = r->post_select,
+ .pre_monitor = r->pre_monitor,
+ .post_monitor = r->post_monitor,
.context = rn,
}, &sched);
return slot_num;
exit(EXIT_FAILURE);
}
-static int signal_post_select(struct sched *s, void *context)
+static int signal_post_monitor(struct sched *s, void *context)
{
struct signal_task *st = context;
int ret, signum;
return 0;
}
-static void command_pre_select(struct sched *s, void *context)
+static void command_pre_monitor(struct sched *s, void *context)
{
struct command_task *ct = context;
sched_monitor_readfd(ct->fd, s);
}
-static int command_post_select(struct sched *s, void *context)
+static int command_post_monitor(struct sched *s, void *context)
{
int ret;
struct command_task *ct = context;
ct->task = task_register(&(struct task_info) {
.name = "command",
- .pre_select = command_pre_select,
- .post_select = command_post_select,
+ .pre_monitor = command_pre_monitor,
+ .post_monitor = command_post_monitor,
.context = ct,
}, &sched);
}
audiod_status_dump(true);
}
-static void status_pre_select(struct sched *s, void *context)
+static void status_pre_monitor(struct sched *s, void *context)
{
struct status_task *st = context;
int i, ret, cafn = stat_task->current_audio_format_num;
}
/* restart the client task if necessary */
-static int status_post_select(struct sched *s, void *context)
+static int status_post_monitor(struct sched *s, void *context)
{
struct status_task *st = context;
int ret;
stat_task->task = task_register(&(struct task_info) {
.name = "stat",
- .pre_select = status_pre_select,
- .post_select = status_post_select,
+ .pre_monitor = status_pre_monitor,
+ .post_monitor = status_post_monitor,
.context = stat_task,
}, &sched);
}
signal_task->task = task_register(&(struct task_info) {
.name = "signal",
- .pre_select = signal_pre_select,
- .post_select = signal_post_select,
+ .pre_monitor = signal_pre_monitor,
+ .post_monitor = signal_post_monitor,
.context = signal_task,
}, &sched);
* buffer.
*
* Since the buffer tree may change at any time, this function should be called
- * during each post_select call.
+ * during each post_monitor call.
*
* \return True if \a btrn has no siblings.
*/
* \param type The supposed type of \a btrn.
*
* Most users of the buffer tree subsystem call this function from both
- * their pre_select and the post_select methods.
+ * their ->pre_monitor() and ->post_monitor() methods.
*
* \return Negative if an error condition was detected, zero if there
* is nothing to do and positive otherwise.
* If no data is available and the buffer tree node is not in error state, the
* function does nothing.
*/
-void check_wav_pre_select(struct sched *s, struct check_wav_context *cwc)
+void check_wav_pre_monitor(struct sched *s, struct check_wav_context *cwc)
{
int ret = btr_node_status(cwc->btrn, cwc->min_iqs, BTR_NT_INTERNAL);
if (ret != 0)
*
* \return Standard.
*/
-int check_wav_post_select(struct check_wav_context *cwc)
+int check_wav_post_monitor(struct check_wav_context *cwc)
{
struct btr_node *btrn = cwc->btrn;
unsigned char *a;
* children of this node can figure out channel count, sample rate, etc.
*
* \return The (opaque) handle of the newly created check_wav instance. It is
- * supposed to be passed to \ref check_wav_pre_select() and \ref
- * check_wav_post_select().
+ * supposed to be passed to \ref check_wav_pre_monitor() and \ref
+ * check_wav_post_monitor().
*
* \sa \ref btr_new_node.
*/
*
* \param cwc Determines the instance to shut down.
*
- * This function may only be called after check_wav_post_select() has returned
+ * This function may only be called after check_wav_post_monitor() has returned
* negative.
*/
void check_wav_shutdown(struct check_wav_context *cwc)
struct check_wav_context *check_wav_init(struct btr_node *parent,
struct btr_node *child, struct wav_params *params,
struct btr_node **cw_btrn);
-void check_wav_pre_select(struct sched *s, struct check_wav_context *cwc);
-int check_wav_post_select(struct check_wav_context *cwc);
+void check_wav_pre_monitor(struct sched *s, struct check_wav_context *cwc);
+int check_wav_post_monitor(struct check_wav_context *cwc);
void check_wav_shutdown(struct check_wav_context *cwc);
size_t result_size;
};
-static void exec_pre_select(struct sched *s, void *context)
+static void exec_pre_monitor(struct sched *s, void *context)
{
struct exec_task *et = context;
int ret = btr_node_status(et->btrn, 0, BTR_NT_LEAF);
sched_min_delay(s);
}
-static int exec_post_select(__a_unused struct sched *s, void *context)
+static int exec_post_monitor(__a_unused struct sched *s, void *context)
{
struct exec_task *et = context;
struct btr_node *btrn = et->btrn;
EMBRACE(.name = "exec_collect"));
exec_task.task = task_register(&(struct task_info) {
.name = "client exec",
- .pre_select = exec_pre_select,
- .post_select = exec_post_select,
+ .pre_monitor = exec_pre_monitor,
+ .post_monitor = exec_post_monitor,
.context = &exec_task,
}, &command_sched);
ret = client_connect(ct, &command_sched, NULL, exec_task.btrn);
struct task *task;
};
-static int supervisor_post_select(struct sched *s, void *context)
+static int supervisor_post_monitor(struct sched *s, void *context)
{
struct supervisor_task *svt = context;
int ret = task_status(ct->task);
EMBRACE(.name = "stdout", .parent = ct->btrn[0]));
supervisor_task.task = task_register(&(struct task_info) {
.name = "supervisor",
- .post_select = supervisor_post_select,
+ .post_monitor = supervisor_post_monitor,
.context = &supervisor_task,
}, &sched);
* The context pointer is assumed to refer to a client task structure that was
* initialized earlier by client_open().
*/
-static void client_pre_select(struct sched *s, void *context)
+static void client_pre_monitor(struct sched *s, void *context)
{
int ret;
struct client_task *ct = context;
* The context pointer refers to a client task structure that was initialized
* earlier by client_open().
*/
-static int client_post_select(struct sched *s, void *context)
+static int client_post_monitor(struct sched *s, void *context)
{
struct client_task *ct = context;
int ret = 0;
ct->task = task_register(&(struct task_info) {
.name = "client",
- .pre_select = client_pre_select,
- .post_select = client_post_select,
+ .pre_monitor = client_pre_monitor,
+ .post_monitor = client_post_monitor,
.context = ct,
}, s);
return 1;
free(fn->private_data);
}
-static int compress_post_select(__a_unused struct sched *s, void *context)
+static int compress_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct private_compress_data *pcd = fn->private_data;
.setup = compress_setup,
.open = compress_open,
.close = compress_close,
- .pre_select = generic_filter_pre_select,
- .post_select = compress_post_select,
+ .pre_monitor = generic_filter_pre_monitor,
+ .post_monitor = compress_post_monitor,
};
return ret;
}
-static void dccp_recv_pre_select(struct sched *s, void *context)
+static void dccp_recv_pre_monitor(struct sched *s, void *context)
{
struct receiver_node *rn = context;
- if (generic_recv_pre_select(s, rn) <= 0)
+ if (generic_recv_pre_monitor(s, rn) <= 0)
return;
sched_monitor_readfd(rn->fd, s);
}
-static int dccp_recv_post_select(__a_unused struct sched *s, void *context)
+static int dccp_recv_post_monitor(__a_unused struct sched *s, void *context)
{
struct receiver_node *rn = context;
struct btr_node *btrn = rn->btrn;
const struct receiver lsg_recv_cmd_com_dccp_user_data = {
.open = dccp_recv_open,
.close = dccp_recv_close,
- .pre_select = dccp_recv_pre_select,
- .post_select = dccp_recv_post_select,
+ .pre_monitor = dccp_recv_pre_monitor,
+ .post_monitor = dccp_recv_post_monitor,
};
struct fec_client *fc;
};
-static void dccp_pre_select(struct sched *s)
+static void dccp_pre_monitor(struct sched *s)
{
unsigned n;
dccp_shutdown_client(sc);
}
-static void dccp_post_select(__a_unused struct sched *s)
+static void dccp_post_monitor(__a_unused struct sched *s)
{
struct sender_client *sc;
struct dccp_fec_client *dfc;
.name = "dccp",
.init = dccp_send_init,
.shutdown = dccp_shutdown,
- .pre_select = dccp_pre_select,
- .post_select = dccp_post_select,
+ .pre_monitor = dccp_pre_monitor,
+ .post_monitor = dccp_post_monitor,
.shutdown_clients = dccp_shutdown_clients,
.client_cmds = {
[SENDER_on] = dccp_com_on,
fn->private_data = NULL;
}
-static int fecdec_post_select(__a_unused struct sched *s, void *context)
+static int fecdec_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct btr_node *btrn = fn->btrn;
const struct filter lsg_filter_cmd_com_fecdec_user_data = {
.open = fecdec_open,
- .pre_select = generic_filter_pre_select,
- .post_select = fecdec_post_select,
+ .pre_monitor = generic_filter_pre_monitor,
+ .post_monitor = fecdec_post_monitor,
.close = fecdec_close,
};
return 1;
}
-static void file_write_pre_select(struct sched *s, void *context)
+static void file_write_pre_monitor(struct sched *s, void *context)
{
struct writer_node *wn = context;
struct private_file_write_data *pfwd = wn->private_data;
free(pfwd);
}
-static int file_write_post_select(__a_unused struct sched *s, void *context)
+static int file_write_post_monitor(__a_unused struct sched *s, void *context)
{
struct writer_node *wn = context;
struct private_file_write_data *pfwd = wn->private_data;
/** the init function of the file writer */
struct writer lsg_write_cmd_com_file_user_data = {
- .pre_select = file_write_pre_select,
- .post_select = file_write_post_select,
+ .pre_monitor = file_write_pre_monitor,
+ .post_monitor = file_write_post_monitor,
.close = file_write_close,
};
EMBRACE(.name = name, .parent = parent,
.handler = f->execute, .context = fn));
ti.name = name;
- ti.pre_select = f->pre_select;
- ti.post_select = f->post_select;
+ ti.pre_monitor = f->pre_monitor;
+ ti.post_monitor = f->post_monitor;
ti.context = fn;
if (f->open)
f->open(fn);
*/
void (*teardown)(const struct lls_parse_result *lpr, void *conf);
/** Force a zero timeout if data is available in the buffer tree. */
- void (*pre_select)(struct sched *s, void *context);
+ void (*pre_monitor)(struct sched *s, void *context);
/** Convert (filter) input data into output data. */
- int (*post_select)(struct sched *s, void *context);
+ int (*post_monitor)(struct sched *s, void *context);
/**
* Answer a buffer tree query.
*
#define FILTER_CMD_OPT_STRING_VAL(_cmd, _opt, _lpr) \
(lls_string_val(0, FILTER_CMD_OPT_RESULT(_cmd, _opt, _lpr)))
-void generic_filter_pre_select(struct sched *s, void *context);
+void generic_filter_pre_monitor(struct sched *s, void *context);
int decoder_execute(const char *cmd, unsigned sample_rate, unsigned channels,
char **result);
* in error state) a minimal I/O timeout is requested from the scheduler.
* Otherwise the function does nothing.
*/
-void generic_filter_pre_select(struct sched *s, void *context)
+void generic_filter_pre_monitor(struct sched *s, void *context)
{
struct filter_node *fn = context;
return btr_get_output_queue_size(btrn) > FLACDEC_MAX_OUTPUT_SIZE;
}
-static void flacdec_pre_select(struct sched *s, void *context)
+static void flacdec_pre_monitor(struct sched *s, void *context)
{
struct filter_node *fn = context;
struct private_flacdec_data *pfd = fn->private_data;
return sched_min_delay(s);
}
-static int flacdec_post_select(__a_unused struct sched *s, void *context)
+static int flacdec_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct private_flacdec_data *pfd = fn->private_data;
const struct filter lsg_filter_cmd_com_flacdec_user_data = {
.open = flacdec_open,
.close = flacdec_close,
- .pre_select = flacdec_pre_select,
- .post_select = flacdec_post_select,
+ .pre_monitor = flacdec_pre_monitor,
+ .post_monitor = flacdec_post_monitor,
.execute = flacdec_execute,
};
return -E_GC_WRITE;
}
-static void gc_pre_select(struct sched *s, void *context)
+static void gc_pre_monitor(struct sched *s, void *context)
{
struct grab_client *gc = context;
int ret = btr_node_status(gc->btrn, 0, BTR_NT_LEAF);
}
/*
- * We need this forward declaration as post_select() needs
+ * We need this forward declaration as gc_post_monitor() needs
* activate_grab_client and vice versa.
*/
-static int gc_post_select(struct sched *s, void *context);
+static int gc_post_monitor(struct sched *s, void *context);
/**
* Move a grab client to the active list and start it.
gc->task = task_register(&(struct task_info) {
.name = name,
- .pre_select = gc_pre_select,
- .post_select = gc_post_select,
+ .pre_monitor = gc_pre_monitor,
+ .post_monitor = gc_post_monitor,
.context = gc,
}, s);
}
/*
* We must not free the gc structure here as it contains ->task
* which is still used because this function is called from
- * post_select().
+ * post_monitor().
*/
close(gc->fd);
gc->fd = -1;
return 0;
}
-static int gc_post_select(__a_unused struct sched *s, void *context)
+static int gc_post_monitor(__a_unused struct sched *s, void *context)
{
struct grab_client *gc = context;
struct btr_node *btrn = gc->btrn;
}
}
-static void status_pre_select(struct sched *s, void *context)
+static void status_pre_monitor(struct sched *s, void *context)
{
struct status_task *st = context;
sched_request_barrier_or_min_delay(&st->next_exec, s);
}
-static int status_post_select(__a_unused struct sched *s, void *context)
+static int status_post_monitor(__a_unused struct sched *s, void *context)
{
struct status_task *st = context;
size_t sz;
}
/* React to various signal-related events. */
-static int signal_post_select(struct sched *s, __a_unused void *context)
+static int signal_post_monitor(struct sched *s, __a_unused void *context)
{
int ret = para_next_signal();
return EXEC_IDLE;
}
-static void exec_pre_select(struct sched *s, void *context)
+static void exec_pre_monitor(struct sched *s, void *context)
{
struct exec_task *et = context;
if (exec_fds[0] >= 0)
sched_min_delay(s);
}
-static int exec_post_select(__a_unused struct sched *s, void *context)
+static int exec_post_monitor(__a_unused struct sched *s, void *context)
{
struct exec_task *ct = context;
int i, ret;
return 0;
}
-static void input_pre_select(struct sched *s, __a_unused void *context)
+static void input_pre_monitor(struct sched *s, __a_unused void *context)
{
if (exec_status() != EXEC_XCMD)
sched_monitor_readfd(STDIN_FILENO, s);
keyname);
}
-static int input_post_select(__a_unused struct sched *s,
+static int input_post_monitor(__a_unused struct sched *s,
__a_unused void *context)
{
int ret;
ret = wgetch(top.win);
if (ret == ERR)
return 0;
- if (ret == KEY_RESIZE) /* already handled in signal_post_select() */
+ if (ret == KEY_RESIZE) /* already handled in signal_post_monitor() */
return 0;
if (exs == EXEC_IDLE)
handle_command(ret);
exec_task.task = task_register(&(struct task_info) {
.name = "exec",
- .pre_select = exec_pre_select,
- .post_select = exec_post_select,
+ .pre_monitor = exec_pre_monitor,
+ .post_monitor = exec_post_monitor,
.context = &exec_task,
}, &sched);
status_task.task = task_register(&(struct task_info) {
.name = "status",
- .pre_select = status_pre_select,
- .post_select = status_post_select,
+ .pre_monitor = status_pre_monitor,
+ .post_monitor = status_post_monitor,
.context = &status_task,
}, &sched);
input_task.task = task_register(&(struct task_info) {
.name = "input",
- .pre_select = input_pre_select,
- .post_select = input_post_select,
+ .pre_monitor = input_pre_monitor,
+ .post_monitor = input_post_monitor,
.context = &input_task,
}, &sched);
para_install_sighandler(SIGWINCH);
signal_task->task = task_register(&(struct task_info) {
.name = "signal",
- .pre_select = signal_pre_select,
- .post_select = signal_post_select,
+ .pre_monitor = signal_pre_monitor,
+ .post_monitor = signal_post_monitor,
.context = signal_task,
}, &sched);
ret = schedule(&sched);
return ret;
}
-static void http_recv_pre_select(struct sched *s, void *context)
+static void http_recv_pre_monitor(struct sched *s, void *context)
{
struct receiver_node *rn = context;
struct private_http_recv_data *phd = rn->private_data;
- if (generic_recv_pre_select(s, rn) <= 0)
+ if (generic_recv_pre_monitor(s, rn) <= 0)
return;
if (phd->status == HTTP_CONNECTED)
sched_monitor_writefd(rn->fd, s);
* area with data read from the socket. In any case, update the state of the
* connection if necessary.
*/
-static int http_recv_post_select(struct sched *s, void *context)
+static int http_recv_post_monitor(struct sched *s, void *context)
{
struct receiver_node *rn = context;
struct private_http_recv_data *phd = rn->private_data;
const struct receiver lsg_recv_cmd_com_http_user_data = {
.open = http_recv_open,
.close = http_recv_close,
- .pre_select = http_recv_pre_select,
- .post_select = http_recv_post_select,
+ .pre_monitor = http_recv_pre_monitor,
+ .post_monitor = http_recv_post_monitor,
};
}
}
-static void http_post_select(__a_unused struct sched *s)
+static void http_post_monitor(__a_unused struct sched *s)
{
struct sender_client *sc, *tmp;
struct private_http_sender_data *phsd;
phsd->status = HTTP_CONNECTED;
}
-static void http_pre_select(struct sched *s)
+static void http_pre_monitor(struct sched *s)
{
struct sender_client *sc, *tmp;
unsigned n;
.name = "http",
.init = http_send_init,
.shutdown = http_shutdown,
- .pre_select = http_pre_select,
- .post_select = http_post_select,
+ .pre_monitor = http_pre_monitor,
+ .post_monitor = http_post_monitor,
.send = http_send,
.shutdown_clients = http_shutdown_clients,
.client_cmds = {
free(line);
}
-static int i9e_post_select(__a_unused struct sched *s, __a_unused void *context)
+static int i9e_post_monitor(__a_unused struct sched *s, __a_unused void *context)
{
int ret;
struct i9e_client_info *ici = i9ep->ici;
return ret;
}
-static void i9e_pre_select(struct sched *s, __a_unused void *context)
+static void i9e_pre_monitor(struct sched *s, __a_unused void *context)
{
int ret;
return ret;
i9ep->task = task_register(&(struct task_info) {
.name = "i9e",
- .pre_select = i9e_pre_select,
- .post_select = i9e_post_select,
+ .pre_monitor = i9e_pre_monitor,
+ .post_monitor = i9e_post_monitor,
.context = i9ep,
}, s);
#define MP3DEC_MAX_FRAME 8192
-static int mp3dec_post_select(__a_unused struct sched *s, void *context)
+static int mp3dec_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
int i, ret;
btr_merge(btrn, fn->min_iqs);
len = btr_next_buffer(btrn, &inbuffer);
/*
- * Decode at most 8K in one go to give the post_select() functions of
+ * Decode at most 8K in one go to give the post_monitor() functions of
* other buffer tree nodes a chance to run. This is necessary to avoid
* buffer underruns on slow machines.
*/
const struct filter lsg_filter_cmd_com_mp3dec_user_data = {
.open = mp3dec_open,
.close = mp3dec_close,
- .pre_select = generic_filter_pre_select,
- .post_select = mp3dec_post_select,
+ .pre_monitor = generic_filter_pre_monitor,
+ .post_monitor = mp3dec_post_monitor,
.execute = mp3dec_execute,
};
/**
* Allocate chunks of this size and produce at most one chunk of output per
- * ->post_select() invocation. If the buffer could only be filled partially
+ * ->post_monitor() invocation. If the buffer could only be filled partially
* due to insufficient input being available, it is shrunk to the real output
* size and the resized buffer is fed into the output queue.
*/
#define OGGDEC_OUTPUT_CHUNK_SIZE (32 * 1024)
-static void ogg_pre_select(struct sched *s, void *context)
+static void ogg_pre_monitor(struct sched *s, void *context)
{
struct filter_node *fn = context;
struct private_oggdec_data *pod = fn->private_data;
sched_min_delay(s);
}
-static int ogg_post_select(__a_unused struct sched *s, void *context)
+static int ogg_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct private_oggdec_data *pod = fn->private_data;
const struct filter lsg_filter_cmd_com_oggdec_user_data = {
.open = ogg_open,
.close = ogg_close,
- .pre_select = ogg_pre_select,
- .post_select = ogg_post_select,
+ .pre_monitor = ogg_pre_monitor,
+ .post_monitor = ogg_post_monitor,
.execute = oggdec_execute
};
#define OPUSDEC_MAX_OUTPUT_SIZE (1024 * 1024)
-static int opusdec_post_select(__a_unused struct sched *s, void *context)
+static int opusdec_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct opusdec_context *ctx = fn->private_data;
return ret;
}
-static void opusdec_pre_select(struct sched *s, void *context)
+static void opusdec_pre_monitor(struct sched *s, void *context)
{
struct filter_node *fn = context;
struct opusdec_context *ctx = fn->private_data;
const struct filter lsg_filter_cmd_com_opusdec_user_data = {
.open = opusdec_open,
.close = opusdec_close,
- .pre_select = opusdec_pre_select,
- .post_select = opusdec_post_select,
+ .pre_monitor = opusdec_pre_monitor,
+ .post_monitor = opusdec_post_monitor,
.execute = opusdec_execute,
};
}
}
-static void oss_pre_select(struct sched *s, void *context)
+static void oss_pre_monitor(struct sched *s, void *context)
{
struct writer_node *wn = context;
struct private_oss_write_data *powd = wn->private_data;
return ret;
}
-static int oss_post_select(__a_unused struct sched *s, void *context)
+static int oss_post_monitor(__a_unused struct sched *s, void *context)
{
struct writer_node *wn = context;
struct private_oss_write_data *powd = wn->private_data;
}
const struct writer lsg_write_cmd_com_oss_user_data = {
- .pre_select = oss_pre_select,
- .post_select = oss_post_select,
+ .pre_monitor = oss_pre_monitor,
+ .post_monitor = oss_post_monitor,
.close = oss_close,
};
* Describes a request to change the state of para_play.
*
* There is only one variable of this type: \a rq of the global play task
- * structure. Command handlers only set this variable and the post_select()
+ * structure. Command handlers only set this variable and the post_monitor()
* function of the play task investigates its value during each iteration of
* the scheduler run and performs the actual work.
*/
pt->rn.task = task_register(
&(struct task_info) {
.name = lls_command_name(AFH_RECV_CMD),
- .pre_select = AFH_RECV->pre_select,
- .post_select = AFH_RECV->post_select,
+ .pre_monitor = AFH_RECV->pre_monitor,
+ .post_monitor = AFH_RECV->post_monitor,
.context = &pt->rn
}, &sched);
sprintf(buf, "%s decoder", af);
pt->fn.task = task_register(
&(struct task_info) {
.name = buf,
- .pre_select = decoder->pre_select,
- .post_select = decoder->post_select,
+ .pre_monitor = decoder->pre_monitor,
+ .post_monitor = decoder->post_monitor,
.context = &pt->fn
}, &sched);
register_writer_node(&pt->wn, pt->fn.btrn, &sched);
/*
* If we are about to die we must call i9e_close() to reset the terminal.
* However, i9e_close() must be called in *this* context, i.e. from
- * play_task.post_select() rather than from i9e_post_select(), because
+ * play_task.post_monitor() rather than from i9e_post_monitor(), because
* otherwise i9e would access freed memory upon return. So the play task must
* stay alive until the i9e task terminates.
*
* We achieve this by sending a fake SIGTERM signal via i9e_signal_dispatch()
- * and reschedule. In the next iteration, i9e->post_select returns an error and
+ * and reschedule. In the next iteration, i9e->post_monitor returns an error and
* terminates. Subsequent calls to i9e_get_error() then return negative and we
* are allowed to call i9e_close() and terminate as well.
*/
-static int session_post_select(__a_unused struct sched *s)
+static int session_post_monitor(__a_unused struct sched *s)
{
int ret;
#else /* HAVE_READLINE */
-static int session_post_select(struct sched *s)
+static int session_post_monitor(struct sched *s)
{
char c;
}
#endif /* HAVE_READLINE */
-static void play_pre_select(struct sched *s, __a_unused void *context)
+static void play_pre_monitor(struct sched *s, __a_unused void *context)
{
char state;
);
}
-static int play_post_select(struct sched *s, __a_unused void *context)
+static int play_post_monitor(struct sched *s, __a_unused void *context)
{
int ret;
pt->rq = CRT_TERM_RQ;
return 0;
}
- ret = session_post_select(s);
+ ret = session_post_monitor(s);
if (ret < 0)
goto out;
if (!pt->wn.btrn && !pt->fn.btrn) {
pt->playing = true;
pt->task = task_register(&(struct task_info){
.name = "play",
- .pre_select = play_pre_select,
- .post_select = play_post_select,
+ .pre_monitor = play_pre_monitor,
+ .post_monitor = play_post_monitor,
.context = pt,
}, &sched);
ret = schedule(&sched);
struct timeval barrier;
};
-static void prebuffer_pre_select(struct sched *s, void *context)
+static void prebuffer_pre_monitor(struct sched *s, void *context)
{
struct filter_node *fn = context;
struct btr_node *btrn = fn->btrn;
free(fn->private_data);
}
-static int prebuffer_post_select(__a_unused struct sched *s, void *context)
+static int prebuffer_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct btr_node *btrn = fn->btrn;
const struct filter lsg_filter_cmd_com_prebuffer_user_data = {
.open = prebuffer_open,
.close = prebuffer_close,
- .pre_select = prebuffer_pre_select,
- .post_select = prebuffer_post_select,
+ .pre_monitor = prebuffer_pre_monitor,
+ .post_monitor = prebuffer_post_monitor,
};
stdout_task_register(&sot, &s);
ti.name = lls_command_name(cmd);
- ti.pre_select = r->pre_select;
- ti.post_select = r->post_select;
+ ti.pre_monitor = r->pre_monitor;
+ ti.post_monitor = r->post_monitor;
ti.context = &rn;
rn.task = task_register(&ti, &s);
/**
* The file descriptor to receive the stream.
*
- * The pre_select function of the receiver adds this file descriptor to
+ * The pre_monitor function of the receiver adds this file descriptor to
* the set of file descriptors which are watched for readability or
* writability, depending on the state of the connection (if any).
*
- * If \a fd is readable, the post_select function of the receiver reads
+ * If \a fd is readable, the post_monitor function of the receiver reads
* data from this fd into the buffer pool area of \a btrp.
*
* \sa \ref receiver.
*/
void (*close)(struct receiver_node *rn);
/** Ask the scheduler to monitor receive fds. */
- void (*pre_select)(struct sched *s, void *context);
+ void (*pre_monitor)(struct sched *s, void *context);
/** Receive data and make it available to consumers. */
- int (*post_select)(struct sched *s, void *context);
+ int (*post_monitor)(struct sched *s, void *context);
/**
* Answer a buffer tree query.
*
int check_receiver_arg(const char *ra, struct lls_parse_result **lprp);
void print_receiver_helps(bool detailed);
-int generic_recv_pre_select(struct sched *s, struct receiver_node *rn);
+int generic_recv_pre_monitor(struct sched *s, struct receiver_node *rn);
* \return The status of of the receiver node's buffer tree node. That is, the
* return value of the underlying call to \ref btr_node_status().
*/
-int generic_recv_pre_select(struct sched *s, struct receiver_node *rn)
+int generic_recv_pre_monitor(struct sched *s, struct receiver_node *rn)
{
int ret = btr_node_status(rn->btrn, 0, BTR_NT_ROOT);
btr_log_tree(btr_parent(btr_parent(btrn)), LL_INFO);
}
-static void resample_pre_select(struct sched *s, void *context)
+static void resample_pre_monitor(struct sched *s, void *context)
{
struct filter_node *fn = context;
struct resample_context *ctx = fn->private_data;
if (ret != 0)
return sched_min_delay(s);
- check_wav_pre_select(s, ctx->cwc);
+ check_wav_pre_monitor(s, ctx->cwc);
}
static int get_btr_val(const char *what, struct btr_node *btrn)
return data.input_frames_used;
}
-static int resample_post_select(__a_unused struct sched *s, void *context)
+static int resample_post_monitor(__a_unused struct sched *s, void *context)
{
int ret;
struct filter_node *fn = context;
size_t in_bytes, num_frames;
bool have_more;
- ret = check_wav_post_select(ctx->cwc);
+ ret = check_wav_post_monitor(ctx->cwc);
if (ret < 0)
goto out;
ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);
if (ret < 0) {
btr_remove_node(&fn->btrn);
/* This releases the check_wav btr node */
- check_wav_post_select(ctx->cwc);
+ check_wav_post_monitor(ctx->cwc);
}
return ret;
}
const struct filter lsg_filter_cmd_com_resample_user_data = {
.setup = resample_setup,
.open = resample_open,
- .pre_select = resample_pre_select,
- .post_select = resample_post_select,
+ .pre_monitor = resample_pre_monitor,
+ .post_monitor = resample_post_monitor,
.close = resample_close,
.teardown = resample_teardown,
.execute = resample_execute
* The possible states of a task.
*
* In addition to the states listed here, a task may also enter zombie state.
- * This happens when its ->post_select function returns negative, the ->status
+ * This happens when its ->post_monitor function returns negative, the ->status
* field is then set to this return value. Such tasks are not scheduled any
- * more (i.e. ->pre_select() and ->post_select() are no longer called), but
+ * more (i.e. ->pre_monitor() and ->post_monitor() are no longer called), but
* they stay on the scheduler task list until \ref task_reap() or
* \ref sched_shutdown() is called.
*/
static struct timeval now_struct;
const struct timeval *now = &now_struct;
-static void sched_preselect(struct sched *s)
+static void sched_pre_monitor(struct sched *s)
{
struct task *t, *tmp;
continue;
if (t->notification != 0)
sched_min_delay(s);
- if (t->info.pre_select)
- t->info.pre_select(s, t->info.context);
+ if (t->info.pre_monitor)
+ t->info.pre_monitor(s, t->info.context);
}
}
}
//#define SCHED_DEBUG 1
-static inline void call_post_select(struct sched *s, struct task *t)
+static inline void call_post_monitor(struct sched *s, struct task *t)
{
int ret;
#ifndef SCHED_DEBUG
- ret = t->info.post_select(s, t->info.context);
+ ret = t->info.post_monitor(s, t->info.context);
#else
struct timeval t1, t2, diff;
unsigned long pst;
clock_get_realtime(&t1);
- ret = t->info.post_select(s, t->info.context);
+ ret = t->info.post_monitor(s, t->info.context);
clock_get_realtime(&t2);
tv_diff(&t1, &t2, &diff);
pst = tv2ms(&diff);
if (pst > 50)
- PARA_WARNING_LOG("%s: post_select time: %lums\n",
+ PARA_WARNING_LOG("%s: post_monitor time: %lums\n",
t->name, pst);
#endif
t->status = ret < 0? ret : TS_RUNNING;
}
-static unsigned sched_post_select(struct sched *s)
+static unsigned sched_post_monitor(struct sched *s)
{
struct task *t, *tmp;
unsigned num_running_tasks = 0;
if (t->status == TS_DEAD) /* task has been reaped */
unlink_and_free_task(t);
else if (t->status == TS_RUNNING) {
- call_post_select(s, t); /* sets t->status */
+ call_post_monitor(s, t); /* sets t->status */
t->notification = 0;
if (t->status == TS_RUNNING)
num_running_tasks++;
* \param s Pointer to the scheduler struct.
*
* This function updates the global \a now pointer, calls all registered
- * pre_select hooks which may set the timeout and add any file descriptors to
- * the fd sets of \a s. Next, it calls para_select() and makes the result available
- * to the registered tasks by calling their post_select hook.
+ * pre_monitor hooks which may set the timeout and add any file descriptors to
+ * the fd sets of \a s. Next, it calls para_select() and makes the result
+ * available to the registered tasks by calling their post_monitor hook.
*
* \return Zero if no more tasks are left in the task list, negative if the
* select function returned an error.
s->timeout = s->default_timeout;
s->max_fileno = -1;
clock_get_realtime(&now_struct);
- sched_preselect(s);
+ sched_pre_monitor(s);
ret = s->select_function(s->max_fileno + 1, &s->rfds, &s->wfds,
s->timeout);
if (ret < 0)
FD_ZERO(&s->wfds);
}
clock_get_realtime(&now_struct);
- num_running_tasks = sched_post_select(s);
+ num_running_tasks = sched_post_monitor(s);
if (num_running_tasks == 0)
return 0;
goto again;
/*
* With list_for_each_entry_safe() it is only safe to remove the
* _current_ list item. Since we are being called from the loop in
- * schedule() via some task's ->post_select() function, freeing the
+ * schedule() via some task's ->post_monitor() function, freeing the
* given task here would result in use-after-free bugs in schedule().
* So we only set the task status to TS_DEAD which tells schedule() to
* free the task in the next iteration of its loop.
{
struct task *t = para_malloc(sizeof(*t));
- assert(info->post_select);
+ assert(info->post_monitor);
if (!s->task_list.next)
init_list_head(&s->task_list);
* \param err A positive error code.
*
* Tasks which honor notifications are supposed to call \ref
- * task_get_notification() in their post_select function and act on the
+ * task_get_notification() in their post_monitor function and act on the
* returned notification value.
*
- * If the scheduler detects during its pre_select loop that at least one task
- * has been notified, the loop terminates, and the post_select methods of all
+ * If the scheduler detects during its pre_monitor loop that at least one task
+ * has been notified, the loop terminates, and the post_monitor methods of all
* taks are immediately called again.
*
- * The notification for a task is reset after the call to its post_select
+ * The notification for a task is reset after the call to its post_monitor
* method.
*
* \sa \ref task_get_notification().
*
* \return The notification value. If this is negative, the task has been
* notified by another task. Tasks are supposed to check for notifications by
- * calling this function from their post_select method.
+ * calling this function from their post_monitor method.
*
* \sa \ref task_notify().
*/
* Paraslash's scheduler.
*
* Designed with KISS in mind. It maintains a list of task structures which is
- * extended when a new task is registered. Each task may define a pre_select
+ * extended when a new task is registered. Each task may define a pre_monitor
* function which is called from the scheduler main loop before it calls
- * select(). Similarly, each task must define a post_select function which is
+ * select(). Similarly, each task must define a post_monitor function which is
* called after the select call.
*
* \sa select(2), poll(2).
*/
struct sched {
- /** Initial value (in milliseconds) before any pre_select call. */
+ /** Initial value (in milliseconds) before any pre_monitor call. */
int default_timeout;
/** The timeout (also in milliseconds) for the next select call. */
int timeout;
*
* \sa \ref time.c.
*/
- void (*pre_select)(struct sched *s, void *context);
+ void (*pre_monitor)(struct sched *s, void *context);
/**
* Perform I/O on file descriptors which are ready for I/O.
*
* If this function returns a negative value, the scheduler unregisters
* the task.
*/
- int (*post_select)(struct sched *s, void *context);
+ int (*post_monitor)(struct sched *s, void *context);
/**
* This pointer is saved when the task is registered. It is passed to
- * ->pre_select() and ->post_select(). Usually this is a pointer to the
+ * ->pre_monitor() and ->post_monitor(). Usually this is a pointer to the
* struct owned by the caller which contains the task pointer.
*/
void *context;
const char *buf, size_t len, const char *header_buf,
size_t header_len);
/** Ask the scheduler to monitor file descriptors. */
- void (*pre_select)(struct sched *s);
+ void (*pre_monitor)(struct sched *s);
/** Perform I/O on the file descriptors which are ready. */
- void (*post_select)(struct sched *s);
+ void (*post_monitor)(struct sched *s);
/**
* Terminate all connected clients.
*
kill(afs_pid, SIGHUP);
}
-static int signal_post_select(struct sched *s, __a_unused void *context)
+static int signal_post_monitor(struct sched *s, __a_unused void *context)
{
int ret, signum;
add_close_on_fork_list(signal_task->fd);
signal_task->task = task_register(&(struct task_info) {
.name = "signal",
- .pre_select = signal_pre_select,
- .post_select = signal_post_select,
+ .pre_monitor = signal_pre_monitor,
+ .post_monitor = signal_post_monitor,
.context = signal_task,
}, &sched);
}
-static void command_pre_select(struct sched *s, void *context)
+static void command_pre_monitor(struct sched *s, void *context)
{
unsigned n;
struct server_command_task *sct = context;
/*
* After we return, the scheduler calls server_select() with a minimal
* timeout value, because the remaining tasks have a notification
- * pending. Next it calls the ->post_select method of these tasks,
+ * pending. Next it calls the ->post_monitor method of these tasks,
* which will return negative in view of the notification. This causes
* schedule() to return as there are no more runnable tasks.
*
return 0;
}
-static int command_post_select(struct sched *s, void *context)
+static int command_post_monitor(struct sched *s, void *context)
{
struct server_command_task *sct = context;
unsigned n;
sct->task = task_register(&(struct task_info) {
.name = "server command",
- .pre_select = command_pre_select,
- .post_select = command_post_select,
+ .pre_monitor = command_pre_monitor,
+ .post_monitor = command_post_monitor,
.context = sct,
}, &sched);
/*
* structure, the parameter is specified as void * here to match the signature
* declared in struct \ref task_info.
*/
-_static_inline_ void signal_pre_select(struct sched *s, void *context)
+_static_inline_ void signal_pre_monitor(struct sched *s, void *context)
{
struct signal_task *st = context;
sched_monitor_readfd(st->fd, s);
return ret;
}
-static int speexdec_post_select(__a_unused struct sched *s, void *context)
+static int speexdec_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct private_spxdec_data *psd = fn->private_data;
const struct filter lsg_filter_cmd_com_spxdec_user_data = {
.open = spxdec_open,
.close = speexdec_close,
- .pre_select = generic_filter_pre_select,
- .post_select = speexdec_post_select,
+ .pre_monitor = generic_filter_pre_monitor,
+ .post_monitor = speexdec_post_monitor,
.execute = speexdec_execute,
};
* If there is space left in the buffer of the stdin task, ask the scheduler to
* monitor STDIN_FILENO.
*/
-static void stdin_pre_select(struct sched *s, void *context)
+static void stdin_pre_monitor(struct sched *s, void *context)
{
struct stdin_task *sit = context;
int ret;
* Feed data from stdin into the buffer tree if STDIN_FILENO is ready for
* reading.
*/
-static int stdin_post_select(__a_unused struct sched *s, void *context)
+static int stdin_post_monitor(__a_unused struct sched *s, void *context)
{
struct stdin_task *sit = context;
ssize_t ret;
int ret;
struct task_info ti = {
.name = "stdin",
- .pre_select = stdin_pre_select,
- .post_select = stdin_post_select,
+ .pre_monitor = stdin_pre_monitor,
+ .post_monitor = stdin_post_monitor,
.context = sit,
};
#include "buffer_tree.h"
/* Monitor STDOUT_FILENO if there is input data available. */
-static void stdout_pre_select(struct sched *s, void *context)
+static void stdout_pre_monitor(struct sched *s, void *context)
{
struct stdout_task *sot = context;
int ret;
* If input from the buffer tree is available and STDOUT_FILENO is ready, write
* as much as possible.
*/
-static int stdout_post_select(struct sched *s, void *context)
+static int stdout_post_monitor(struct sched *s, void *context)
{
struct stdout_task *sot = context;
struct btr_node *btrn = sot->btrn;
{
int ret;
struct task_info ti = {
- .pre_select = stdout_pre_select,
- .post_select = stdout_post_select,
+ .pre_monitor = stdout_pre_monitor,
+ .post_monitor = stdout_post_monitor,
.context = sot,
.name = "stdout",
};
tv_add(now, &to, &ctx->timeout);
}
-static void sync_pre_select(struct sched *s, void *context)
+static void sync_pre_monitor(struct sched *s, void *context)
{
int ret;
struct filter_node *fn = context;
return NULL;
}
-static int sync_post_select(__a_unused struct sched *s, void *context)
+static int sync_post_monitor(__a_unused struct sched *s, void *context)
{
int ret;
struct filter_node *fn = context;
const struct filter lsg_filter_cmd_com_sync_user_data = {
.setup = sync_setup,
.open = sync_open,
- .pre_select = sync_pre_select,
- .post_select = sync_post_select,
+ .pre_monitor = sync_pre_monitor,
+ .post_monitor = sync_post_monitor,
.close = sync_close,
.teardown = sync_teardown
};
#include "net.h"
#include "fd.h"
-static void udp_recv_pre_select(struct sched *s, void *context)
+static void udp_recv_pre_monitor(struct sched *s, void *context)
{
struct receiver_node *rn = context;
- if (generic_recv_pre_select(s, rn) <= 0)
+ if (generic_recv_pre_monitor(s, rn) <= 0)
return;
sched_monitor_readfd(rn->fd, s);
}
return -E_RECV_EOF;
}
-static int udp_recv_post_select(__a_unused struct sched *s, void *context)
+static int udp_recv_post_monitor(__a_unused struct sched *s, void *context)
{
struct receiver_node *rn = context;
struct btr_node *btrn = rn->btrn;
const struct receiver lsg_recv_cmd_com_udp_user_data = {
.open = udp_recv_open,
.close = udp_recv_close,
- .pre_select = udp_recv_pre_select,
- .post_select = udp_recv_post_select,
+ .pre_monitor = udp_recv_pre_monitor,
+ .post_monitor = udp_recv_post_monitor,
};
mmd->offset = tv2ms(&offset);
}
-static void vss_pre_select(struct sched *s, void *context)
+static void vss_pre_monitor(struct sched *s, void *context)
{
int i;
struct vss_task *vsst = context;
} else
sched_monitor_readfd(vsst->afs_socket, s);
FOR_EACH_SENDER(i) {
- if (!senders[i]->pre_select)
+ if (!senders[i]->pre_monitor)
continue;
- senders[i]->pre_select(s);
+ senders[i]->pre_monitor(s);
}
vss_compute_timeout(s, vsst);
}
/**
* Main sending function.
*
- * This function gets called from vss_post_select(). It checks whether the next
+ * This function gets called from vss_post_monitor(). It checks whether the next
* chunk of data should be pushed out. It obtains a pointer to the data to be
* sent out as well as its length from mmd->afd.afhi. This information is then
* passed to each supported sender's send() function as well as to the send()
mmd->current_chunk++;
}
-static int vss_post_select(struct sched *s, void *context)
+static int vss_post_monitor(struct sched *s, void *context)
{
int ret, i;
struct vss_task *vsst = context;
vsst->afsss = AFS_SOCKET_AFD_PENDING;
}
FOR_EACH_SENDER(i) {
- if (!senders[i]->post_select)
+ if (!senders[i]->post_monitor)
continue;
- senders[i]->post_select(s);
+ senders[i]->post_monitor(s);
}
if ((vss_playing() && !(mmd->vss_status_flags & VSS_PLAYING)) ||
(vss_next() && vss_playing()))
}
vsst->task = task_register(&(struct task_info) {
.name = "vss",
- .pre_select = vss_pre_select,
- .post_select = vss_post_select,
+ .pre_monitor = vss_pre_monitor,
+ .post_monitor = vss_post_monitor,
.context = vsst,
}, s);
}
*bof = 1;
}
-static void wav_pre_select(struct sched *s, void *context)
+static void wav_pre_monitor(struct sched *s, void *context)
{
struct filter_node *fn = context;
size_t iqs = btr_get_input_queue_size(fn->btrn);
sched_min_delay(s);
}
-static int wav_post_select(__a_unused struct sched *s, void *context)
+static int wav_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
struct btr_node *btrn = fn->btrn;
const struct filter lsg_filter_cmd_com_wav_user_data = {
.close = wav_close,
.open = wav_open,
- .pre_select = wav_pre_select,
- .post_select = wav_post_select,
+ .pre_monitor = wav_pre_monitor,
+ .post_monitor = wav_post_monitor,
};
#define WMA_OUTPUT_BUFFER_SIZE (128 * 1024)
-static int wmadec_post_select(__a_unused struct sched *s, void *context)
+static int wmadec_post_monitor(__a_unused struct sched *s, void *context)
{
struct filter_node *fn = context;
int ret, converted, out_size;
.open = wmadec_open,
.close = wmadec_close,
.execute = wmadec_execute,
- .pre_select = generic_filter_pre_select,
- .post_select = wmadec_post_select,
+ .pre_monitor = generic_filter_pre_monitor,
+ .post_monitor = wmadec_post_monitor,
};
struct check_wav_context *cwc;
};
-static void write_pre_select(struct sched *s, void *context)
+static void write_pre_monitor(struct sched *s, void *context)
{
struct write_task *wt = context;
- check_wav_pre_select(s, wt->cwc);
+ check_wav_pre_monitor(s, wt->cwc);
}
-static int write_post_select(__a_unused struct sched *s, void *context)
+static int write_post_monitor(__a_unused struct sched *s, void *context)
{
struct write_task *wt = context;
- return check_wav_post_select(wt->cwc);
+ return check_wav_post_monitor(wt->cwc);
}
static int setup_and_schedule(struct lls_parse_result *lpr)
wt.cwc = check_wav_init(sit.btrn, NULL, &wp, &cw_btrn);
wt.task = task_register(&(struct task_info) {
.name = "write",
- .pre_select = write_pre_select,
- .post_select = write_post_select,
+ .pre_monitor = write_pre_monitor,
+ .post_monitor = write_post_monitor,
.context = &wt,
}, &s);
*/
struct writer {
/** Ask the scheduler to check whether data can be written. */
- void (*pre_select)(struct sched *s, void *context);
+ void (*pre_monitor)(struct sched *s, void *context);
/** Write audio data. */
- int (*post_select)(struct sched *s, void *context);
+ int (*post_monitor)(struct sched *s, void *context);
/**
* Close one instance of the writer.
*
.handler = w->execute, .context = wn));
wn->task = task_register(&(struct task_info) {
.name = writer_name(wn->wid),
- .pre_select = w->pre_select,
- .post_select = w->post_select,
+ .pre_monitor = w->pre_monitor,
+ .post_monitor = w->post_monitor,
.context = wn,
}, s);
}