Lines Matching refs:context
58 int (*init)(effect_context_t *context);
59 int (*release)(effect_context_t *context);
60 int (*reset)(effect_context_t *context);
61 int (*enable)(effect_context_t *context);
62 int (*disable)(effect_context_t *context);
63 int (*start)(effect_context_t *context, output_context_t *output);
64 int (*stop)(effect_context_t *context, output_context_t *output);
65 int (*process)(effect_context_t *context, audio_buffer_t *in, audio_buffer_t *out);
66 int (*set_parameter)(effect_context_t *context, effect_param_t *param, uint32_t size);
67 int (*get_parameter)(effect_context_t *context, effect_param_t *param, uint32_t *size);
68 int (*command)(effect_context_t *context, uint32_t cmdCode, uint32_t cmdSize,
227 bool effect_exists(effect_context_t *context) { in effect_exists() argument
234 if (fx_ctxt == context) { in effect_exists()
255 void add_effect_to_output(output_context_t * output, effect_context_t *context) { in add_effect_to_output() argument
262 if (fx_ctxt == context) in add_effect_to_output()
265 list_add_tail(&output->effects_list, &context->output_node); in add_effect_to_output()
266 if (context->ops.start) in add_effect_to_output()
267 context->ops.start(context, output); in add_effect_to_output()
270 void remove_effect_from_output(output_context_t * output, effect_context_t *context) { in remove_effect_from_output() argument
277 if (fx_ctxt == context) { in remove_effect_from_output()
278 if (context->ops.stop) in remove_effect_from_output()
279 context->ops.stop(context, output); in remove_effect_from_output()
280 list_remove(&context->output_node); in remove_effect_from_output()
539 int set_config(effect_context_t *context, effect_config_t *config) in set_config() argument
549 context->config = *config; in set_config()
551 if (context->ops.reset) in set_config()
552 context->ops.reset(context); in set_config()
557 void get_config(effect_context_t *context, effect_config_t *config) in get_config() argument
559 *config = context->config; in get_config()
584 int visualizer_reset(effect_context_t *context) in visualizer_reset() argument
586 visualizer_context_t * visu_ctxt = (visualizer_context_t *)context; in visualizer_reset()
596 int visualizer_init(effect_context_t *context) in visualizer_init() argument
600 visualizer_context_t * visu_ctxt = (visualizer_context_t *)context; in visualizer_init()
602 context->config.inputCfg.accessMode = EFFECT_BUFFER_ACCESS_READ; in visualizer_init()
603 context->config.inputCfg.channels = AUDIO_CHANNEL_OUT_STEREO; in visualizer_init()
604 context->config.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT; in visualizer_init()
605 context->config.inputCfg.samplingRate = 44100; in visualizer_init()
606 context->config.inputCfg.bufferProvider.getBuffer = NULL; in visualizer_init()
607 context->config.inputCfg.bufferProvider.releaseBuffer = NULL; in visualizer_init()
608 context->config.inputCfg.bufferProvider.cookie = NULL; in visualizer_init()
609 context->config.inputCfg.mask = EFFECT_CONFIG_ALL; in visualizer_init()
610 context->config.outputCfg.accessMode = EFFECT_BUFFER_ACCESS_ACCUMULATE; in visualizer_init()
611 context->config.outputCfg.channels = AUDIO_CHANNEL_OUT_STEREO; in visualizer_init()
612 context->config.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT; in visualizer_init()
613 context->config.outputCfg.samplingRate = 44100; in visualizer_init()
614 context->config.outputCfg.bufferProvider.getBuffer = NULL; in visualizer_init()
615 context->config.outputCfg.bufferProvider.releaseBuffer = NULL; in visualizer_init()
616 context->config.outputCfg.bufferProvider.cookie = NULL; in visualizer_init()
617 context->config.outputCfg.mask = EFFECT_CONFIG_ALL; in visualizer_init()
623 visu_ctxt->channel_count = audio_channel_count_from_out_mask(context->config.inputCfg.channels); in visualizer_init()
633 set_config(context, &context->config); in visualizer_init()
651 int visualizer_get_parameter(effect_context_t *context, effect_param_t *p, uint32_t *size) in visualizer_get_parameter() argument
653 visualizer_context_t *visu_ctxt = (visualizer_context_t *)context; in visualizer_get_parameter()
686 int visualizer_set_parameter(effect_context_t *context, effect_param_t *p, uint32_t size __unused) in visualizer_set_parameter() argument
688 visualizer_context_t *visu_ctxt = (visualizer_context_t *)context; in visualizer_set_parameter()
718 int visualizer_process(effect_context_t *context, in visualizer_process() argument
722 visualizer_context_t *visu_ctxt = (visualizer_context_t *)context; in visualizer_process()
724 if (!effect_exists(context)) in visualizer_process()
811 if (context->state != EFFECT_STATE_ACTIVE) { in visualizer_process()
819 int visualizer_command(effect_context_t * context, uint32_t cmdCode, uint32_t cmdSize __unused, in visualizer_command() argument
822 visualizer_context_t * visu_ctxt = (visualizer_context_t *)context; in visualizer_command()
832 if (!context->offload_enabled) in visualizer_command()
835 if (context->state == EFFECT_STATE_ACTIVE) { in visualizer_command()
843 const uint32_t delta_smp = context->config.inputCfg.samplingRate * latency_ms / 1000; in visualizer_command()
977 effect_context_t *context; in effect_lib_create() local
981 context = (effect_context_t *)visu_ctxt; in effect_lib_create()
982 context->ops.init = visualizer_init; in effect_lib_create()
983 context->ops.reset = visualizer_reset; in effect_lib_create()
984 context->ops.process = visualizer_process; in effect_lib_create()
985 context->ops.set_parameter = visualizer_set_parameter; in effect_lib_create()
986 context->ops.get_parameter = visualizer_get_parameter; in effect_lib_create()
987 context->ops.command = visualizer_command; in effect_lib_create()
988 context->desc = &visualizer_descriptor; in effect_lib_create()
993 context->itfe = &effect_interface; in effect_lib_create()
994 context->state = EFFECT_STATE_UNINITIALIZED; in effect_lib_create()
995 context->out_handle = (audio_io_handle_t)ioId; in effect_lib_create()
997 ret = context->ops.init(context); in effect_lib_create()
1000 free(context); in effect_lib_create()
1004 context->state = EFFECT_STATE_INITIALIZED; in effect_lib_create()
1007 list_add_tail(&created_effects_list, &context->effects_list_node); in effect_lib_create()
1010 add_effect_to_output(out_ctxt, context); in effect_lib_create()
1013 *pHandle = (effect_handle_t)context; in effect_lib_create()
1015 ALOGV("%s created context %p", __func__, context); in effect_lib_create()
1022 effect_context_t *context = (effect_context_t *)handle; in effect_lib_release() local
1031 if (effect_exists(context)) { in effect_lib_release()
1032 output_context_t *out_ctxt = get_output(context->out_handle); in effect_lib_release()
1034 remove_effect_from_output(out_ctxt, context); in effect_lib_release()
1035 list_remove(&context->effects_list_node); in effect_lib_release()
1036 if (context->ops.release) in effect_lib_release()
1037 context->ops.release(context); in effect_lib_release()
1038 free(context); in effect_lib_release()
1077 effect_context_t * context = (effect_context_t *)self; in effect_process() local
1083 if (!effect_exists(context)) { in effect_process()
1088 if (context->state != EFFECT_STATE_ACTIVE) { in effect_process()
1102 effect_context_t * context = (effect_context_t *)self; in effect_command() local
1108 if (!effect_exists(context)) { in effect_command()
1113 if (context == NULL || context->state == EFFECT_STATE_UNINITIALIZED) { in effect_command()
1127 if (context->ops.init) in effect_command()
1128 *(int *) pReplyData = context->ops.init(context); in effect_command()
1138 *(int *) pReplyData = set_config(context, (effect_config_t *) pCmdData); in effect_command()
1146 if (!context->offload_enabled) { in effect_command()
1151 get_config(context, (effect_config_t *)pReplyData); in effect_command()
1154 if (context->ops.reset) in effect_command()
1155 context->ops.reset(context); in effect_command()
1162 if (context->state != EFFECT_STATE_INITIALIZED) { in effect_command()
1166 context->state = EFFECT_STATE_ACTIVE; in effect_command()
1167 if (context->ops.enable) in effect_command()
1168 context->ops.enable(context); in effect_command()
1178 if (context->state != EFFECT_STATE_ACTIVE) { in effect_command()
1182 context->state = EFFECT_STATE_INITIALIZED; in effect_command()
1183 if (context->ops.disable) in effect_command()
1184 context->ops.disable(context); in effect_command()
1197 if (!context->offload_enabled) { in effect_command()
1203 if (context->ops.get_parameter) in effect_command()
1204 context->ops.get_parameter(context, p, replySize); in effect_command()
1215 if (context->ops.set_parameter) in effect_command()
1216 *(int32_t *)pReplyData = context->ops.set_parameter(context, p, *replySize); in effect_command()
1241 context->offload_enabled = offload_param->isOffload; in effect_command()
1242 if (context->out_handle == offload_param->ioHandle) in effect_command()
1245 out_ctxt = get_output(context->out_handle); in effect_command()
1247 remove_effect_from_output(out_ctxt, context); in effect_command()
1249 context->out_handle = offload_param->ioHandle; in effect_command()
1252 add_effect_to_output(out_ctxt, context); in effect_command()
1258 if (cmdCode >= EFFECT_CMD_FIRST_PROPRIETARY && context->ops.command) in effect_command()
1259 status = context->ops.command(context, cmdCode, cmdSize, in effect_command()
1279 effect_context_t *context = (effect_context_t *)self; in effect_get_descriptor() local
1281 if (!effect_exists(context)) in effect_get_descriptor()
1287 *descriptor = *context->desc; in effect_get_descriptor()