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,
32 #define APCLASS_DIM (agl_application_class_end - agl_application_class_begin + 1)
38 const char *class_name[APCLASS_DIM]; /* as much elements as app.classes (see in "userdata.h") */
41 struct pa_nodeset_resdef {
49 struct pa_nodeset_map {
53 pa_nodeset_resdef *resdef;
62 char *id; /**< resource set id, if any */
63 bool grant; /**< permission to play/render etc */
67 uint32_t index; /**< index into nodeset->idxset */
68 char *key; /**< hash key for discover lookups */
69 agl_direction direction; /**< agl_input | agl_output */
70 agl_implement implement; /**< agl_device | agl_stream */
71 pa_client *client; /**< matching client pointer (for agl_input nodes only) */
72 pa_null_sink *nullsink; /**< associated null sink (for agl_input nodes only) */
73 pa_loopnode *loopnode; /**< associated loopback */
74 uint32_t channels; /**< number of channels (eg. 1=mono, 2=stereo) */
75 agl_location location; /**< mir_internal | mir_external */
76 agl_privacy privacy; /**< mir_public | mir_private */
77 agl_node_type type; /**< mir_speakers | mir_headset | ... */
78 char *zone; /**< zone where the node belong */
79 bool visible; /**< internal or can appear on UI */
80 bool available; /**< eg. is the headset connected? */
81 bool ignore; /**< do not consider it while routing */
82 bool localrset; /**< locally generated resource set */
83 const char *amname; /**< audiomanager name */
84 const char *amdescr; /**< UI description */
85 uint16_t amid; /**< handle to audiomanager, if any */
86 const char *paname; /**< sink|source|sink_input|source_output name */
87 uint32_t paidx; /**< sink|source|sink_input|source_output index*/
88 pa_node_card pacard; /**< pulse card related data, if any */
89 const char *paport; /**< sink or source port if applies */
90 /*pa_muxnode *mux;*/ /**< for multiplexable input streams only */
91 /*pa_loopnode *loop;*/ /**< for looped back sources only */
92 agl_dlist rtentries; /**< in device nodes: listhead of nodchain */
93 agl_dlist rtprilist; /**< in stream nodes: priority link (head is in
95 agl_dlist constrains; /**< listhead of constrains */
96 /*mir_vlim vlim;*/ /**< volume limit */
97 pa_node_rset rset; /**< resource set info if applies */
99 /*scripting_node *scripting;*/ /** scripting data, if any */
102 pa_nodeset *pa_nodeset_init (struct userdata *);
103 void pa_nodeset_done (struct userdata *);
105 agl_node *agl_node_create (struct userdata *, agl_node *);
106 const char *agl_node_type_str (agl_node_type);
108 agl_node *agl_node_get_from_data (struct userdata *, agl_direction, void *);
109 agl_node *agl_node_get_from_client (struct userdata *, pa_client *);