Lines Matching refs:context

91 bool effect_exists(effect_context_t *context)  in effect_exists()  argument
99 if (fx_ctxt == context) { in effect_exists()
120 void add_effect_to_output(output_context_t * output, effect_context_t *context) in add_effect_to_output() argument
128 if (fx_ctxt == context) in add_effect_to_output()
131 list_add_tail(&output->effects_list, &context->output_node); in add_effect_to_output()
132 if (context->ops.start) in add_effect_to_output()
133 context->ops.start(context, output); in add_effect_to_output()
138 effect_context_t *context) in remove_effect_from_output() argument
146 if (fx_ctxt == context) { in remove_effect_from_output()
147 if (context->ops.stop) in remove_effect_from_output()
148 context->ops.stop(context, output); in remove_effect_from_output()
149 list_remove(&context->output_node); in remove_effect_from_output()
292 int set_config(effect_context_t *context, effect_config_t *config) in set_config() argument
294 context->config = *config; in set_config()
296 if (context->ops.reset) in set_config()
297 context->ops.reset(context); in set_config()
302 void get_config(effect_context_t *context, effect_config_t *config) in get_config() argument
304 *config = context->config; in get_config()
333 effect_context_t *context; in effect_lib_create() local
338 context = (effect_context_t *)eq_ctxt; in effect_lib_create()
339 context->ops.init = equalizer_init; in effect_lib_create()
340 context->ops.reset = equalizer_reset; in effect_lib_create()
341 context->ops.set_parameter = equalizer_set_parameter; in effect_lib_create()
342 context->ops.get_parameter = equalizer_get_parameter; in effect_lib_create()
343 context->ops.set_device = equalizer_set_device; in effect_lib_create()
344 context->ops.enable = equalizer_enable; in effect_lib_create()
345 context->ops.disable = equalizer_disable; in effect_lib_create()
346 context->ops.start = equalizer_start; in effect_lib_create()
347 context->ops.stop = equalizer_stop; in effect_lib_create()
349 context->desc = &equalizer_descriptor; in effect_lib_create()
355 context = (effect_context_t *)bass_ctxt; in effect_lib_create()
356 context->ops.init = bassboost_init; in effect_lib_create()
357 context->ops.reset = bassboost_reset; in effect_lib_create()
358 context->ops.set_parameter = bassboost_set_parameter; in effect_lib_create()
359 context->ops.get_parameter = bassboost_get_parameter; in effect_lib_create()
360 context->ops.set_device = bassboost_set_device; in effect_lib_create()
361 context->ops.enable = bassboost_enable; in effect_lib_create()
362 context->ops.disable = bassboost_disable; in effect_lib_create()
363 context->ops.start = bassboost_start; in effect_lib_create()
364 context->ops.stop = bassboost_stop; in effect_lib_create()
366 context->desc = &bassboost_descriptor; in effect_lib_create()
372 context = (effect_context_t *)virt_ctxt; in effect_lib_create()
373 context->ops.init = virtualizer_init; in effect_lib_create()
374 context->ops.reset = virtualizer_reset; in effect_lib_create()
375 context->ops.set_parameter = virtualizer_set_parameter; in effect_lib_create()
376 context->ops.get_parameter = virtualizer_get_parameter; in effect_lib_create()
377 context->ops.set_device = virtualizer_set_device; in effect_lib_create()
378 context->ops.enable = virtualizer_enable; in effect_lib_create()
379 context->ops.disable = virtualizer_disable; in effect_lib_create()
380 context->ops.start = virtualizer_start; in effect_lib_create()
381 context->ops.stop = virtualizer_stop; in effect_lib_create()
383 context->desc = &virtualizer_descriptor; in effect_lib_create()
395 context = (effect_context_t *)reverb_ctxt; in effect_lib_create()
396 context->ops.init = reverb_init; in effect_lib_create()
397 context->ops.reset = reverb_reset; in effect_lib_create()
398 context->ops.set_parameter = reverb_set_parameter; in effect_lib_create()
399 context->ops.get_parameter = reverb_get_parameter; in effect_lib_create()
400 context->ops.set_device = reverb_set_device; in effect_lib_create()
401 context->ops.enable = reverb_enable; in effect_lib_create()
402 context->ops.disable = reverb_disable; in effect_lib_create()
403 context->ops.start = reverb_start; in effect_lib_create()
404 context->ops.stop = reverb_stop; in effect_lib_create()
408 context->desc = &aux_env_reverb_descriptor; in effect_lib_create()
412 context->desc = &ins_env_reverb_descriptor; in effect_lib_create()
416 context->desc = &aux_preset_reverb_descriptor; in effect_lib_create()
420 context->desc = &ins_preset_reverb_descriptor; in effect_lib_create()
428 context->itfe = &effect_interface; in effect_lib_create()
429 context->state = EFFECT_STATE_UNINITIALIZED; in effect_lib_create()
430 context->out_handle = (audio_io_handle_t)ioId; in effect_lib_create()
432 ret = context->ops.init(context); in effect_lib_create()
435 free(context); in effect_lib_create()
439 context->state = EFFECT_STATE_INITIALIZED; in effect_lib_create()
442 list_add_tail(&created_effects_list, &context->effects_list_node); in effect_lib_create()
445 add_effect_to_output(out_ctxt, context); in effect_lib_create()
448 *pHandle = (effect_handle_t)context; in effect_lib_create()
450 ALOGV("%s created context %p", __func__, context); in effect_lib_create()
458 effect_context_t *context = (effect_context_t *)handle; in effect_lib_release() local
467 if (effect_exists(context)) { in effect_lib_release()
468 output_context_t *out_ctxt = get_output(context->out_handle); in effect_lib_release()
470 remove_effect_from_output(out_ctxt, context); in effect_lib_release()
471 list_remove(&context->effects_list_node); in effect_lib_release()
472 if (context->ops.release) in effect_lib_release()
473 context->ops.release(context); in effect_lib_release()
474 free(context); in effect_lib_release()
515 effect_context_t * context = (effect_context_t *)self; in effect_process() local
521 if (!effect_exists(context)) { in effect_process()
526 if (context->state != EFFECT_STATE_ACTIVE) { in effect_process()
540 effect_context_t * context = (effect_context_t *)self; in effect_command() local
546 if (!effect_exists(context)) { in effect_command()
551 if (context == NULL || context->state == EFFECT_STATE_UNINITIALIZED) { in effect_command()
562 if (context->ops.init) in effect_command()
563 *(int *) pReplyData = context->ops.init(context); in effect_command()
573 *(int *) pReplyData = set_config(context, (effect_config_t *) pCmdData); in effect_command()
581 if (!context->offload_enabled) { in effect_command()
586 get_config(context, (effect_config_t *)pReplyData); in effect_command()
589 if (context->ops.reset) in effect_command()
590 context->ops.reset(context); in effect_command()
597 if (context->state != EFFECT_STATE_INITIALIZED) { in effect_command()
601 context->state = EFFECT_STATE_ACTIVE; in effect_command()
602 if (context->ops.enable) in effect_command()
603 context->ops.enable(context); in effect_command()
612 if (context->state != EFFECT_STATE_ACTIVE) { in effect_command()
616 context->state = EFFECT_STATE_INITIALIZED; in effect_command()
617 if (context->ops.disable) in effect_command()
618 context->ops.disable(context); in effect_command()
634 if (!context->offload_enabled) { in effect_command()
641 if (context->ops.get_parameter) in effect_command()
642 context->ops.get_parameter(context, p, replySize); in effect_command()
656 if (context->ops.set_parameter) in effect_command()
657 *(int32_t *)pReplyData = context->ops.set_parameter(context, p, in effect_command()
670 if (context->ops.set_device) in effect_command()
671 context->ops.set_device(context, device); in effect_command()
703 context->offload_enabled = offload_param->isOffload; in effect_command()
704 if (context->out_handle == offload_param->ioHandle) in effect_command()
707 out_ctxt = get_output(context->out_handle); in effect_command()
709 remove_effect_from_output(out_ctxt, context); in effect_command()
711 context->out_handle = offload_param->ioHandle; in effect_command()
712 out_ctxt = get_output(context->out_handle); in effect_command()
714 add_effect_to_output(out_ctxt, context); in effect_command()
718 if (cmdCode >= EFFECT_CMD_FIRST_PROPRIETARY && context->ops.command) in effect_command()
719 status = context->ops.command(context, cmdCode, cmdSize, in effect_command()
738 effect_context_t *context = (effect_context_t *)self; in effect_get_descriptor() local
740 if (!effect_exists(context) || (descriptor == NULL)) in effect_get_descriptor()
743 *descriptor = *context->desc; in effect_get_descriptor()