From ad31d39a7edad0fc4c59a4fb254cbb214a4ed1b1 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 30 Mar 2022 15:41:30 -0700 Subject: *: use til_module_create_context() in more places Just mechanical replacement of some remaining ad-hoc til_module_t.create_context() calls. The montage module continues using an ad-hoc call because it forces num_cpus=1 since it's already a threaded using a fragment per module's tile. This suggests the til_module_create_context() call should probably accept a num_cpus parameter, perhaps treating a 0 value as the "automagic" discover value so callers can explicitly set it when necessary. --- src/modules/compose/compose.c | 3 +-- src/modules/rtv/rtv.c | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c index 9be4c0c..b3e2dbc 100644 --- a/src/modules/compose/compose.c +++ b/src/modules/compose/compose.c @@ -78,8 +78,7 @@ static void * compose_create_context(unsigned ticks, unsigned num_cpus) module = til_lookup_module(layers[i]); ctxt->layers[i].module = module; - if (module->create_context) - ctxt->layers[i].module_ctxt = module->create_context(ticks, num_cpus); + (void) til_module_create_context(module, ticks, &ctxt->layers[i].module_ctxt); ctxt->n_layers++; } diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c index 6464a8e..1804613 100644 --- a/src/modules/rtv/rtv.c +++ b/src/modules/rtv/rtv.c @@ -198,8 +198,8 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks) ctxt->next_hide_caption = now + rtv_caption_duration; } - if (!ctxt->channel->module_ctxt && ctxt->channel->module->create_context) - ctxt->channel->module_ctxt = ctxt->channel->module->create_context(ticks, ctxt->n_cpus); + if (!ctxt->channel->module_ctxt) + (void) til_module_create_context(ctxt->channel->module, ticks, &ctxt->channel->module_ctxt); ctxt->channel->last_on_time = now; } @@ -241,8 +241,7 @@ static void * rtv_create_context(unsigned ticks, unsigned num_cpus) ctxt->snow_channel.module = &none_module; if (rtv_snow_module) { ctxt->snow_channel.module = til_lookup_module(rtv_snow_module); - if (ctxt->snow_channel.module->create_context) - ctxt->snow_channel.module_ctxt = ctxt->snow_channel.module->create_context(ticks, ctxt->n_cpus); + (void) til_module_create_context(ctxt->snow_channel.module, ticks, &ctxt->snow_channel.module_ctxt); } for (size_t i = 0; i < n_modules; i++) { -- cgit v1.2.3