2 * module-agl-audio -- PulseAudio module for providing audio routing support
3 * (forked from "module-murphy-ivi" - https://github.com/otcshare )
4 * Copyright (c) 2012, Intel Corporation.
5 * Copyright (c) 2016, IoT.bzh
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU Lesser General Public License,
9 * version 2.1, as published by the Free Software Foundation.
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston,
29 #define AGL_ZONE_MAX 8 /* max 8 zones, demo is using 5 */ /* DEFINED IN MURPHY */
31 /*typedef bool (*agl_rtgroup_accept_t)(struct userdata *, agl_rtgroup *, agl_node *);*/
32 /*typedef int (*agl_rtgroup_compare_t)(struct userdata *, agl_rtgroup *, agl_node *, agl_node *);*/
35 char *name; /**< name of the rtgroup */
36 agl_dlist entries; /**< listhead of ordered rtentries */
37 /*agl_rtgroup_accept_t accept;*/ /**< function pointer, whether to accept a node or not */
38 /*agl_rtgroup_compare_t compare;*/ /**< function pointer, comparision for ordering */
39 /*scripting_rtgroup *scripting;*/ /**< data for scripting, if any */
48 agl_rtgroup **input[AGL_ZONE_MAX];
49 agl_rtgroup **output[AGL_ZONE_MAX];
50 } pa_rtgroup_classmap;
53 pa_rtgroup_hash rtgroups;
54 size_t maplen; /**< length of the class */
55 pa_rtgroup_classmap classmap; /**< map device node types to rtgroups */
56 int *priormap; /**< stream node priorities */
57 agl_dlist nodlist; /**< priorized list of the stream nodes
58 (entry in node: rtprilist) */
59 agl_dlist connlist; /**< listhead of the connections */
62 struct agl_connection {
63 agl_dlist link; /**< list of connections */
64 bool blocked; /**< true if this conflicts with another route */
65 uint16_t amid; /**< audio manager connection id */
66 uint32_t from; /**< source node index */
67 uint32_t to; /**< destination node index */
68 uint32_t stream; /**< index of the sink-input to be routed */
71 pa_router *pa_router_init (struct userdata *);
72 void pa_router_done (struct userdata *);
73 agl_node *agl_router_make_prerouting (struct userdata *, agl_node *);
74 void agl_router_make_routing (struct userdata *);
76 void implement_default_route (struct userdata *, agl_node *, agl_node *, uint32_t);
77 agl_node *find_default_route (struct userdata *, agl_node *, uint32_t);