1
From 0ef3456f6836fa8d0083e5fb9d62e85c6edbc3aa Mon Sep 17 00:00:00 2001
2
From: David Henningsson <david.henningsson@canonical.com>
3
Date: Fri, 2 Dec 2011 13:34:54 +0100
4
Subject: [PATCH 609/609] device-port: Add a property list to ports.
6
They're not used for anything yet, but hopefully soon they'll be.
8
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10
src/pulsecore/cli-text.c | 6 +++++-
11
src/pulsecore/device-port.c | 3 +++
12
src/pulsecore/device-port.h | 1 +
13
3 files changed, 9 insertions(+), 1 deletions(-)
15
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
16
index 2253635..4823924 100644
17
--- a/src/pulsecore/cli-text.c
18
+++ b/src/pulsecore/cli-text.c
19
@@ -124,9 +124,13 @@ static void append_port_list(pa_strbuf *s, pa_hashmap *ports)
22
pa_strbuf_puts(s, "\tports:\n");
23
- PA_HASHMAP_FOREACH(p, ports, state)
24
+ PA_HASHMAP_FOREACH(p, ports, state) {
25
+ char *t = pa_proplist_to_string_sep(p->proplist, "\n\t\t\t\t");
26
pa_strbuf_printf(s, "\t\t%s: %s (priority %u, available: %s)\n",
27
p->name, p->description, p->priority, port_available_to_string(p->available));
28
+ pa_strbuf_printf(s, "\t\t\tproperties:\n\t\t\t\t%s\n", t);
33
char *pa_card_list_to_string(pa_core *c) {
34
diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
35
index 7988649..30fb025 100644
36
--- a/src/pulsecore/device-port.c
37
+++ b/src/pulsecore/device-port.c
38
@@ -70,6 +70,8 @@ static void device_port_free(pa_object *o) {
40
pa_assert(pa_device_port_refcnt(p) == 0);
43
+ pa_proplist_free(p->proplist);
45
pa_hashmap_free(p->profiles, NULL, NULL);
47
@@ -94,6 +96,7 @@ pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *des
51
+ p->proplist = pa_proplist_new();
55
diff --git a/src/pulsecore/device-port.h b/src/pulsecore/device-port.h
56
index ee4fc3e..4e90a62 100644
57
--- a/src/pulsecore/device-port.h
58
+++ b/src/pulsecore/device-port.h
59
@@ -47,6 +47,7 @@ struct pa_device_port {
61
pa_port_available_t available; /* PA_PORT_AVAILABLE_UNKNOWN, PA_PORT_AVAILABLE_NO or PA_PORT_AVAILABLE_YES */
63
+ pa_proplist *proplist;
64
pa_hashmap *profiles; /* Can be NULL. Does not own the profiles */
66
pa_bool_t is_output:1;