summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend
AgeCommit message (Expand)AuthorFilesLines
2020-05-12Add i.MX8MQ EVK supportScott Murray1-26/+0
2020-05-12meta-agl-profile-graphical: add SMACK labelling for westonScott Murray1-3/+13
2020-04-27meta-agl-profile-graphical: disable memfd usage in westonScott Murray1-1/+3
2020-04-27meta-agl-profile-graphical: update weston for dunfellScott Murray1-0/+14
lor: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * module-agl-audio -- PulseAudio module for providing audio routing support
 * (forked from "module-murphy-ivi" - https://github.com/otcshare )
 * Copyright (c) 2012, Intel Corporation.
 * Copyright (c) 2016, IoT.bzh
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU Lesser General Public License,
 * version 2.1, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston,
 * MA 02110-1301 USA.
 *
 */
#include "loopback.h"
#include "utils.h"
#include "list.h"

agl_loopback *agl_loopback_init (void)
{
	agl_loopback *loopback = pa_xnew0 (agl_loopback, 1);

	return loopback;
}

void agl_loopback_done (struct userdata *u, agl_loopback *loopback)
{
	agl_loopnode *loop, *n;
	pa_core *core;

	pa_assert_se (core = u->core);

	PA_LLIST_FOREACH_SAFE(loop, n, loopback->loopnodes) {
		pa_module_unload_by_index (core, loop->module_index, false);
    }
}

agl_loopnode *agl_loopnode_create (struct userdata *u, agl_loopnode_type type,
				   uint32_t node_index, uint32_t source_index, uint32_t sink_index)
{
	pa_core *core;
	pa_module *module;
	pa_source *source;
	pa_sink *sink;
	const char *sonam;
	const char *sinam;
	pa_source_output *sout;
	pa_sink_input *sinp;
	agl_loopnode *loopnode;
	int idx;
	char args[256];

	pa_assert (u);
	pa_assert_se (core = u->core);

	source = pa_idxset_get_by_index (core->sources, source_index);
	sink = pa_idxset_get_by_index (core->sinks, sink_index);
	sonam = agl_utils_get_source_name (source);
	sinam = agl_utils_get_sink_name (sink);

	snprintf (args, sizeof(args), "source=\"%s\" sink=\"%s\"", sonam, sinam);
	module = pa_module_load (core, "module-loopback", args);

	if (!module) {
		pa_log ("failed to load loopback for source '%s' & sink '%s'", sonam, sinam);
		return NULL;
	}

	 /* find the sink_input/source_output couple generated but the module we just loaded */
	PA_IDXSET_FOREACH(sout, core->source_outputs, idx) {
		if (sout->module && sout->module == module)
			break;
		sout = NULL;
	}
	PA_IDXSET_FOREACH(sinp, core->sink_inputs, idx) {
		if (sinp->module && sinp->module == module)
			break;
		sinp = NULL;
	}
	if (!sout || !sinp) {
		pa_module_unload (module, false);
		return NULL;
	}

	loopnode = pa_xnew0 (agl_loopnode, 1);
	loopnode->module_index = module->index;
	loopnode->source_output_index = sout->index;
	loopnode->sink_input_index = sinp->index;

	return loopnode;
}

void agl_loopnode_destroy (struct userdata *u, agl_loopnode *loopnode)
{
	pa_core      *core;
	pa_module    *module;

	if (u && (core = u->core)) {
		if ((module = pa_idxset_get_by_index (core->modules, loopnode->module_index))){
			pa_log_info ("unloading loopback");
			pa_module_unload (module, false);
		}
		pa_xfree (loopnode);
	}
}