Home | History | Annotate | Download | only in hal

Lines Matching refs:instance

26  *  struct plugin    struct instance
46 /* This represents an audio port on an instance. */
49 struct plugin *plugin; /* the plugin corresponds to the instance */
54 /* This represents a control port on an instance. */
57 struct plugin *plugin; /* the plugin corresponds to the instance */
65 /* An instance is a dynamic representation of a plugin. We only create
66 * an instance when a plugin is needed (data actually flows through it
67 * and it is not disabled). An instance also contains a pointer to a
69 struct instance {
70 /* The plugin this instance corresponds to */
73 /* These are the ports on this instance. The difference
92 /* This is the total buffering delay from source to this instance. It is
97 DECLARE_ARRAY_TYPE(struct instance, instance_array)
108 * order that if instance B depends on instance A, then A will
119 /* The instance where the audio data flow in */
120 struct instance *source_instance;
122 /* The instance where the audio data flow out */
123 struct instance *sink_instance;
147 static struct instance *find_instance_by_plugin(instance_array *instances,
151 struct instance *instance;
153 FOR_ARRAY_ELEMENT(instances, i, instance) {
154 if (instance->plugin == plugin)
155 return instance;
186 /* if the plugin is not disabled, it will be pointed by some instance */
233 struct instance *instance;
236 instance = find_instance_by_plugin(instances, plugin);
237 if (!instance)
240 FOR_ARRAY_ELEMENT(&instance->output_audio_ports, i, audio_port) {
253 struct instance *instance;
256 instance = find_instance_by_plugin(instances, plugin);
257 if (!instance)
260 FOR_ARRAY_ELEMENT(&instance->output_control_ports, i, control_port) {
286 struct instance *instance;
308 /* if the plugin is disabled, we don't construct an instance for it */
312 instance = ARRAY_APPEND_ZERO(&pipeline->instances);
313 instance->plugin = plugin;
315 /* constructs audio and control ports for the instance */
331 &instance->input_audio_ports :
332 &instance->output_audio_ports;
350 &instance->input_control_ports :
351 &instance->output_control_ports;
466 static int load_module(struct plugin *plugin, struct instance *instance)
472 instance->module = module;
473 instance->properties = module->get_properties(module);
500 /* assign which buffer each audio port on each instance should use */
504 struct instance *instance;
509 FOR_ARRAY_ELEMENT(&pipeline->instances, i, instance) {
510 int in = ARRAY_COUNT(&instance->input_audio_ports);
511 int out = ARRAY_COUNT(&instance->output_audio_ports);
513 if (instance->properties & MODULE_INPLACE_BROKEN) {
544 /* Now assign buffer index for each instance's input/output ports */
546 FOR_ARRAY_ELEMENT(&pipeline->instances, i, instance) {
551 FOR_ARRAY_ELEMENT(&instance->input_audio_ports, j, audio_port) {
581 if (instance->properties & MODULE_INPLACE_BROKEN) {
582 use_buffers(busy, &instance->output_audio_ports);
583 unuse_buffers(busy, &instance->input_audio_ports);
585 unuse_buffers(busy, &instance->input_audio_ports);
586 use_buffers(busy, &instance->output_audio_ports);
597 struct instance *instance;
599 instance) {
600 struct plugin *plugin = instance->plugin;
601 if (load_module(plugin, instance) != 0)
611 /* Calculates the total buffering delay of each instance from the source */
615 struct instance *instance;
617 FOR_ARRAY_ELEMENT(&pipeline->instances, i, instance) {
618 struct dsp_module *module = instance->module;
619 audio_port_array *audio_in = &instance->input_audio_ports;
625 * instance. */
627 struct instance *upstream = find_instance_by_plugin(
632 instance->total_delay = delay + module->get_delay(module);
639 struct instance *instance;
641 FOR_ARRAY_ELEMENT(&pipeline->instances, i, instance) {
642 struct dsp_module *module = instance->module;
645 instance->instantiated = 1;
646 syslog(LOG_DEBUG, "instantiate %s", instance->plugin->label);
650 FOR_ARRAY_ELEMENT(&pipeline->instances, i, instance) {
651 audio_port_array *audio_in = &instance->input_audio_ports;
652 audio_port_array *audio_out = &instance->output_audio_ports;
653 control_port_array *control_in = &instance->input_control_ports;
655 &instance->output_control_ports;
659 struct dsp_module *module = instance->module;
668 audio_port->buf_index, instance->plugin->title,
677 audio_port->buf_index, instance->plugin->title,
695 control_port->value, instance->plugin->title,
704 control_port->value, instance->plugin->title,
716 struct instance *instance;
718 FOR_ARRAY_ELEMENT(&pipeline->instances, i, instance) {
719 struct dsp_module *module = instance->module;
720 if (instance->instantiated) {
722 instance->instantiated = 0;
784 struct instance *instance;
786 FOR_ARRAY_ELEMENT(&pipeline->instances, i, instance) {
787 struct dsp_module *module = instance->module;
868 struct instance *instance;
870 FOR_ARRAY_ELEMENT(&pipeline->instances, i, instance) {
871 struct dsp_module *module = instance->module;
872 instance->plugin = NULL;
873 ARRAY_FREE(&instance->input_audio_ports);
874 ARRAY_FREE(&instance->input_control_ports);
875 ARRAY_FREE(&instance->output_audio_ports);
876 ARRAY_FREE(&instance->output_control_ports);
879 if (instance->instantiated) {
881 instance->instantiated = 0;
884 instance->module = NULL;