f->open = aacdec_open;
f->close = aacdec_close;
f->pre_select = generic_filter_pre_select;
- f->new_post_select = aacdec_post_select;
+ f->post_select = aacdec_post_select;
f->execute = aacdec_execute;
}
r->open = afh_recv_open;
r->close = afh_recv_close;
r->pre_select = afh_recv_pre_select;
- r->new_post_select = afh_recv_post_select;
+ r->post_select = afh_recv_post_select;
r->parse_config = afh_recv_parse_config;
r->free_config = afh_recv_free_config;
r->execute = afh_execute;
para_install_sighandler(SIGHUP);
st->task.pre_select = signal_pre_select;
- st->task.new_post_select = afs_signal_post_select;
+ st->task.post_select = afs_signal_post_select;
sprintf(st->task.status, "signal task");
register_task(s, &st->task);
}
ct->cookie = cookie;
ct->task.pre_select = command_pre_select;
- ct->task.new_post_select = command_post_select;
+ ct->task.post_select = command_post_select;
sprintf(ct->task.status, "afs command task");
register_task(s, &ct->task);
}
alsa_write_cmdline_parser_init(&dummy);
w->close = alsa_close;
w->pre_select = alsa_write_pre_select;
- w->new_post_select = alsa_write_post_select;
+ w->post_select = alsa_write_post_select;
w->parse_config_or_die = alsa_parse_config_or_die;
w->free_config = alsa_free_config;
w->help = (struct ggo_help) {
f->open = amp_open;
f->close = amp_close;
f->pre_select = generic_filter_pre_select;
- f->new_post_select = amp_post_select;
+ f->post_select = amp_post_select;
f->parse_config = amp_parse_config;
f->free_config = amp_free_config;
f->help = (struct ggo_help) {
ao_write_cmdline_parser_init(&dummy);
w->close = aow_close;
w->pre_select = aow_pre_select;
- w->new_post_select = aow_post_select;
+ w->post_select = aow_post_select;
w->parse_config_or_die = aow_parse_config_or_die;
w->free_config = aow_free_config;
w->help = (struct ggo_help) {
static struct audioc_task audioc_task = {
.task = {
.pre_select = audioc_pre_select,
- .new_post_select = audioc_post_select,
+ .post_select = audioc_post_select,
.status = "audioc task"
},
}, *at = &audioc_task;
fn->filter_num = a->filter_nums[i];
fn->conf = a->filter_conf[i];
fn->task.pre_select = f->pre_select;
- fn->task.new_post_select = f->new_post_select;
+ fn->task.post_select = f->post_select;
fn->btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = f->name, .parent = parent,
.handler = f->execute, .context = fn));
PARA_NOTICE_LOG("started %s: %s receiver in slot %d\n",
audio_formats[format], r->name, slot_num);
rn->task.pre_select = r->pre_select;
- rn->task.new_post_select = r->new_post_select;
+ rn->task.post_select = r->post_select;
sprintf(rn->task.status, "%s receiver node", r->name);
register_task(&sched, &rn->task);
return slot_num;
static void signal_setup_default(struct signal_task *st)
{
st->task.pre_select = signal_pre_select;
- st->task.new_post_select = signal_post_select;
+ st->task.post_select = signal_post_select;
sprintf(st->task.status, "signal task");
}
static void init_command_task(struct command_task *ct)
{
ct->task.pre_select = command_pre_select;
- ct->task.new_post_select = command_post_select;
+ ct->task.post_select = command_post_select;
ct->task.error = 0;
ct->fd = audiod_get_socket(); /* doesn't return on errors */
sprintf(ct->task.status, "command task");
{
memset(st, 0, sizeof(struct status_task));
st->task.pre_select = status_pre_select;
- st->task.new_post_select = status_post_select;
+ st->task.post_select = status_post_select;
st->sa_time_diff_sign = 1;
st->clock_diff_count = conf.clock_diff_count_arg;
st->current_audio_format_num = -1;
struct exec_task exec_task = {
.task = {
.pre_select = exec_pre_select,
- .new_post_select = exec_post_select,
+ .post_select = exec_post_select,
.status = "client exec task",
},
.result_buf = para_strdup(""),
}
static struct task svt = {
- .new_post_select = supervisor_post_select,
+ .post_select = supervisor_post_select,
.status = "supervisor task"
};
ct->btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = "client", .parent = parent, .child = child));
ct->task.pre_select = client_pre_select;
- ct->task.new_post_select = client_post_select;
+ ct->task.post_select = client_post_select;
ct->task.error = 0;
sprintf(ct->task.status, "client");
register_task(s, &ct->task);
f->open = compress_open;
f->close = compress_close;
f->pre_select = generic_filter_pre_select;
- f->new_post_select = compress_post_select;
+ f->post_select = compress_post_select;
f->parse_config = compress_parse_config;
f->free_config = compress_free_config;
f->help = (struct ggo_help) {
r->open = dccp_recv_open;
r->close = dccp_recv_close;
r->pre_select = dccp_recv_pre_select;
- r->new_post_select = dccp_recv_post_select;
+ r->post_select = dccp_recv_post_select;
r->parse_config = dccp_recv_parse_config;
r->free_config = dccp_recv_free_config;
r->help = (struct ggo_help) {
f->close = fecdec_close;
f->open = fecdec_open;
f->pre_select = generic_filter_pre_select;
- f->new_post_select = fecdec_post_select;
+ f->post_select = fecdec_post_select;
}
file_write_cmdline_parser_init(&dummy);
w->pre_select = file_write_pre_select;
- w->new_post_select = file_write_post_select;
+ w->post_select = file_write_post_select;
w->parse_config_or_die = file_write_parse_config_or_die;
w->free_config = file_write_free_config;
w->close = file_write_close;
EMBRACE(.name = f->name, .parent = parent,
.handler = f->execute, .context = fn));
fn->task.pre_select = f->pre_select;
- fn->task.new_post_select = f->new_post_select;
+ fn->task.post_select = f->post_select;
f->open(fn);
register_task(&s, &fn->task);
parent = fn->btrn;
* post_select function is supposed to set t->error to a (negative)
* error code.
*/
- int (*new_post_select)(struct sched *s, struct task *t);
+ int (*post_select)(struct sched *s, struct task *t);
/**
* Answer a buffer tree query.
*
f->open = flacdec_open;
f->close = flacdec_close;
f->pre_select = flacdec_pre_select;
- f->new_post_select = flacdec_post_select;
+ f->post_select = flacdec_post_select;
f->execute = flacdec_execute;
}
gc->btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = name, .parent = parent));
gc->task.pre_select = gc_pre_select;
- gc->task.new_post_select = gc_post_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;
r->open = http_recv_open;
r->close = http_recv_close;
r->pre_select = http_recv_pre_select;
- r->new_post_select = http_recv_post_select;
+ r->post_select = http_recv_post_select;
r->parse_config = http_recv_parse_config;
r->free_config = http_recv_free_config;
r->help = (struct ggo_help) {
if (ret < 0)
return ret;
i9ep->task.pre_select = i9e_pre_select;
- i9ep->task.new_post_select = i9e_post_select;
+ i9ep->task.post_select = i9e_post_select;
sprintf(i9ep->task.status, "i9e");
register_task(s, &i9ep->task);
rl_readline_name = "para_i9e";
f->parse_config = mp3dec_parse_config;
f->free_config = mp3dec_free_config;
f->pre_select = generic_filter_pre_select;
- f->new_post_select = mp3dec_post_select;
+ f->post_select = mp3dec_post_select;
f->execute = mp3dec_execute;
f->help = (struct ggo_help) {
.short_help = mp3dec_filter_args_info_help,
f->open = ogg_open;
f->close = ogg_close;
f->pre_select = ogg_pre_select;
- f->new_post_select = ogg_post_select;
+ f->post_select = ogg_post_select;
f->execute = oggdec_execute;
}
oss_write_cmdline_parser_init(&dummy);
w->close = oss_close;
w->pre_select = oss_pre_select;
- w->new_post_select = oss_post_select;
+ w->post_select = oss_post_select;
w->parse_config_or_die = oss_parse_config_or_die;
w->free_config = oss_free_config;
w->help = (struct ggo_help) {
osx_write_cmdline_parser_init(&dummy);
w->close = osx_write_close;
w->pre_select = osx_write_pre_select;
- w->new_post_select = osx_write_post_select;
+ w->post_select = osx_write_post_select;
w->parse_config_or_die = osx_write_parse_config_or_die;
w->free_config = osx_free_config;
w->help = (struct ggo_help) {
tmp = NULL;
}
pt->rn.task.pre_select = afh_recv->pre_select;
- pt->rn.task.new_post_select = afh_recv->new_post_select;
+ pt->rn.task.post_select = afh_recv->post_select;
sprintf(pt->rn.task.status, "%s receiver node", afh_recv->name);
return 1;
fail:
pt->fn.filter_num = ret;
decoder = filters + ret;
pt->fn.task.pre_select = decoder->pre_select;
- pt->fn.task.new_post_select = decoder->new_post_select;
+ pt->fn.task.post_select = decoder->post_select;
sprintf(pt->fn.task.status, "%s decoder", af);
pt->fn.btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = decoder->name, .parent = pt->rn.btrn,
pt->current_file = conf.inputs_num - 1;
pt->playing = true;
pt->task.pre_select = play_pre_select;
- pt->task.new_post_select = play_post_select;
+ pt->task.post_select = play_post_select;
sprintf(pt->task.status, "play task");
register_task(&sched, &pt->task);
ret = schedule(&sched);
f->parse_config = prebuffer_parse_config;
f->free_config = prebuffer_free_config;
f->pre_select = prebuffer_pre_select;
- f->new_post_select = prebuffer_post_select;
+ f->post_select = prebuffer_post_select;
f->help = (struct ggo_help) {
.short_help = prebuffer_filter_args_info_help,
.detailed_help = prebuffer_filter_args_info_detailed_help
register_task(&s, &sot.task);
rn.task.pre_select = r->pre_select;
- rn.task.new_post_select = r->new_post_select;
+ rn.task.post_select = r->post_select;
sprintf(rn.task.status, "%s", r->name);
register_task(&s, &rn.task);
*
* \sa select(2), struct receiver.
*/
- int (*new_post_select)(struct sched *s, struct task *t);
+ int (*post_select)(struct sched *s, struct task *t);
/** The two help texts of this receiver. */
struct ggo_help help;
f->close = resample_close;
f->open = resample_open;
f->pre_select = resample_pre_select;
- f->new_post_select = resample_post_select;
+ f->post_select = resample_post_select;
f->parse_config = resample_parse_config;
f->free_config = resample_free_config;
f->execute = resample_execute;
para_strerror(-t->error));
if (t->pre_select)
list_del(&t->pre_select_node);
- if (t->new_post_select)
+ if (t->post_select)
list_del(&t->post_select_node);
}
static inline void call_post_select(struct sched *s, struct task *t)
{
#ifndef SCHED_DEBUG
- t->error = t->new_post_select(s, t);
+ t->error = t->post_select(s, t);
#else
struct timeval t1, t2, diff;
unsigned long pst;
clock_get_realtime(&t1);
- t->error = t->new_post_select(s, t);
+ t->error = t->post_select(s, t);
clock_get_realtime(&t2);
tv_diff(&t1, &t2, &diff);
pst = tv2ms(&diff);
PARA_DEBUG_LOG("pre_select: %p\n", &t->pre_select);
list_add_tail(&t->pre_select_node, &s->pre_select_list);
}
- if (t->new_post_select) {
- PARA_DEBUG_LOG("post_select: %p\n", &t->new_post_select);
+ if (t->post_select) {
+ PARA_DEBUG_LOG("post_select: %p\n", &t->post_select);
list_add_tail(&t->post_select_node, &s->post_select_list);
}
}
*/
void (*pre_select)(struct sched *s, struct task *t);
/**
- * The newer variant of the post select hook of \a t.
+ * The post select hook of \a t.
*
- * This hook must return the error code rather than store it in
- * t->error.
+ * Its purpose is to evaluate and act upon the results of the previous
+ * select call. If this function returns a negative value, the
+ * scheduler unregisters the task.
*/
- int (*new_post_select)(struct sched *s, struct task *t);
+ int (*post_select)(struct sched *s, struct task *t);
/** Whether this task is in error state. */
int error;
/** Position of the task in the pre_select list of the scheduler. */
*st = &signal_task_struct;
st->task.pre_select = signal_pre_select;
- st->task.new_post_select = signal_post_select;
+ st->task.post_select = signal_post_select;
sprintf(st->task.status, "signal task");
PARA_NOTICE_LOG("setting up signal handling\n");
PARA_NOTICE_LOG("initializing tcp command socket\n");
sct->task.pre_select = command_pre_select;
- sct->task.new_post_select = command_post_select;
+ sct->task.post_select = command_post_select;
sct->argc = argc;
sct->argv = argv;
ret = para_listen_simple(IPPROTO_TCP, conf.port_arg);
f->open = spxdec_open;
f->close = speexdec_close;
f->pre_select = generic_filter_pre_select;
- f->new_post_select = speexdec_post_select;
+ f->post_select = speexdec_post_select;
f->execute = speexdec_execute;
}
int ret;
sit->task.pre_select = stdin_pre_select;
- sit->task.new_post_select = stdin_post_select;
+ sit->task.post_select = stdin_post_select;
sit->btrp = btr_pool_new("stdin", 128 * 1024);
sprintf(sit->task.status, "stdin reader");
ret = mark_fd_nonblocking(STDIN_FILENO);
int ret;
sot->task.pre_select = stdout_pre_select;
- sot->task.new_post_select = stdout_post_select;
+ sot->task.post_select = stdout_post_select;
sprintf(sot->task.status, "stdout");
ret = mark_fd_nonblocking(STDOUT_FILENO);
if (ret >= 0)
r->open = udp_recv_open;
r->close = udp_recv_close;
r->pre_select = udp_recv_pre_select;
- r->new_post_select = udp_recv_post_select;
+ r->post_select = udp_recv_post_select;
r->parse_config = udp_recv_parse_config;
r->free_config = udp_recv_free_config;
r->help = (struct ggo_help) {
vsst->header_interval.tv_sec = 5; /* should this be configurable? */
vsst->afs_socket = afs_socket;
vsst->task.pre_select = vss_pre_select;
- vsst->task.new_post_select = vss_post_select;
+ vsst->task.post_select = vss_post_select;
ms2tv(announce_time, &vsst->announce_tv);
PARA_INFO_LOG("announce timeval: %lums\n", tv2ms(&vsst->announce_tv));
INIT_LIST_HEAD(&fec_client_list);
f->close = wav_close;
f->open = wav_open;
f->pre_select = wav_pre_select;
- f->new_post_select = wav_post_select;
+ f->post_select = wav_post_select;
}
f->close = wmadec_close;
f->execute = wmadec_execute;
f->pre_select = generic_filter_pre_select;
- f->new_post_select = wmadec_post_select;
+ f->post_select = wmadec_post_select;
}
struct write_task wt = {
.task = {
.pre_select = write_pre_select,
- .new_post_select = write_post_select,
+ .post_select = write_post_select,
.status = "write task",
},
};
*
* Called from the post_select function of the writer node's task.
*/
- int (*new_post_select)(struct sched *s, struct task *t);
+ int (*post_select)(struct sched *s, struct task *t);
/**
* Close one instance of the writer.
*
strcpy(wn->task.status, name);
free(name);
wn->task.pre_select = w->pre_select;
- wn->task.new_post_select = w->new_post_select;
+ wn->task.post_select = w->post_select;
register_task(s, &wn->task);
}