diff options
Diffstat (limited to 'meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch')
-rw-r--r-- | meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch | 101 |
1 files changed, 37 insertions, 64 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch index 97b2e4064a..84c951940b 100644 --- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 6f814b40a01d03f93b36184c19339033949de472 Mon Sep 17 00:00:00 2001 | 1 | From d1c02971867bea10afcafc82c965414012c4d6bd Mon Sep 17 00:00:00 2001 |
2 | From: Tanu Kaskinen <tanuk@iki.fi> | 2 | From: Tanu Kaskinen <tanuk@iki.fi> |
3 | Date: Fri, 23 Oct 2015 12:23:13 +0300 | 3 | Date: Fri, 23 Oct 2015 12:23:13 +0300 |
4 | Subject: [PATCH 1/4] card: add pa_card_profile.ports | 4 | Subject: [PATCH 1/4] card: add pa_card_profile.ports |
@@ -9,23 +9,30 @@ availability (implemented in a later patch). | |||
9 | 9 | ||
10 | http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448 | 10 | http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448 |
11 | 11 | ||
12 | Upstream-Status: Submitted [http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024614.html] | ||
13 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> | 12 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> |
13 | |||
14 | Rebased on 8.0. | ||
15 | |||
16 | Upstream-Status: Denied [The patch set needs some work to be accepted. | ||
17 | The review thread: | ||
18 | http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301] | ||
19 | |||
20 | Signed-off-by: Tanu Kaskinen <tanuk@iki.fi> | ||
14 | --- | 21 | --- |
15 | src/modules/alsa/alsa-mixer.c | 4 +++- | 22 | src/modules/alsa/alsa-mixer.c | 4 +++- |
16 | src/modules/alsa/alsa-ucm.c | 1 + | 23 | src/modules/alsa/alsa-ucm.c | 1 + |
17 | src/modules/bluetooth/module-bluez4-device.c | 6 ++++++ | 24 | src/modules/bluetooth/module-bluez4-device.c | 6 ++++++ |
18 | src/modules/bluetooth/module-bluez5-device.c | 6 ++++++ | 25 | src/modules/bluetooth/module-bluez5-device.c | 6 ++++++ |
19 | src/pulsecore/card.c | 16 ++++++++++++++++ | 26 | src/pulsecore/card.c | 15 +++++++++++++++ |
20 | src/pulsecore/card.h | 18 ++++++++++++------ | 27 | src/pulsecore/card.h | 4 ++++ |
21 | src/pulsecore/device-port.c | 7 ++++++- | 28 | src/pulsecore/device-port.c | 7 ++++++- |
22 | 7 files changed, 50 insertions(+), 8 deletions(-) | 29 | 7 files changed, 41 insertions(+), 2 deletions(-) |
23 | 30 | ||
24 | diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c | 31 | diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c |
25 | index 47cbd14..c5b82b0 100644 | 32 | index 1fe2a02..5b76b06 100644 |
26 | --- a/src/modules/alsa/alsa-mixer.c | 33 | --- a/src/modules/alsa/alsa-mixer.c |
27 | +++ b/src/modules/alsa/alsa-mixer.c | 34 | +++ b/src/modules/alsa/alsa-mixer.c |
28 | @@ -4654,8 +4654,10 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports, /* card ports */ | 35 | @@ -4783,8 +4783,10 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports, /* card ports */ |
29 | path->port = p; | 36 | path->port = p; |
30 | } | 37 | } |
31 | 38 | ||
@@ -38,10 +45,10 @@ index 47cbd14..c5b82b0 100644 | |||
38 | if (extra) { | 45 | if (extra) { |
39 | pa_hashmap_put(extra, p->name, p); | 46 | pa_hashmap_put(extra, p->name, p); |
40 | diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c | 47 | diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c |
41 | index aa2d601..c8199d6 100644 | 48 | index 42f3242..68fcc26 100644 |
42 | --- a/src/modules/alsa/alsa-ucm.c | 49 | --- a/src/modules/alsa/alsa-ucm.c |
43 | +++ b/src/modules/alsa/alsa-ucm.c | 50 | +++ b/src/modules/alsa/alsa-ucm.c |
44 | @@ -761,6 +761,7 @@ static void ucm_add_port_combination( | 51 | @@ -791,6 +791,7 @@ static void ucm_add_port_combination( |
45 | if (cp) { | 52 | if (cp) { |
46 | pa_log_debug("Adding profile %s to port %s.", cp->name, port->name); | 53 | pa_log_debug("Adding profile %s to port %s.", cp->name, port->name); |
47 | pa_hashmap_put(port->profiles, cp->name, cp); | 54 | pa_hashmap_put(port->profiles, cp->name, cp); |
@@ -50,10 +57,10 @@ index aa2d601..c8199d6 100644 | |||
50 | 57 | ||
51 | if (hash) { | 58 | if (hash) { |
52 | diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c | 59 | diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c |
53 | index db69d34..b40c6a0 100644 | 60 | index 9a921a5..adecb32 100644 |
54 | --- a/src/modules/bluetooth/module-bluez4-device.c | 61 | --- a/src/modules/bluetooth/module-bluez4-device.c |
55 | +++ b/src/modules/bluetooth/module-bluez4-device.c | 62 | +++ b/src/modules/bluetooth/module-bluez4-device.c |
56 | @@ -2183,6 +2183,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid | 63 | @@ -2180,6 +2180,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid |
57 | p->max_sink_channels = 2; | 64 | p->max_sink_channels = 2; |
58 | p->max_source_channels = 0; | 65 | p->max_source_channels = 0; |
59 | pa_hashmap_put(output_port->profiles, p->name, p); | 66 | pa_hashmap_put(output_port->profiles, p->name, p); |
@@ -61,7 +68,7 @@ index db69d34..b40c6a0 100644 | |||
61 | 68 | ||
62 | d = PA_CARD_PROFILE_DATA(p); | 69 | d = PA_CARD_PROFILE_DATA(p); |
63 | *d = PA_BLUEZ4_PROFILE_A2DP; | 70 | *d = PA_BLUEZ4_PROFILE_A2DP; |
64 | @@ -2194,6 +2195,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid | 71 | @@ -2191,6 +2192,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid |
65 | p->max_sink_channels = 0; | 72 | p->max_sink_channels = 0; |
66 | p->max_source_channels = 2; | 73 | p->max_source_channels = 2; |
67 | pa_hashmap_put(input_port->profiles, p->name, p); | 74 | pa_hashmap_put(input_port->profiles, p->name, p); |
@@ -69,7 +76,7 @@ index db69d34..b40c6a0 100644 | |||
69 | 76 | ||
70 | d = PA_CARD_PROFILE_DATA(p); | 77 | d = PA_CARD_PROFILE_DATA(p); |
71 | *d = PA_BLUEZ4_PROFILE_A2DP_SOURCE; | 78 | *d = PA_BLUEZ4_PROFILE_A2DP_SOURCE; |
72 | @@ -2206,6 +2208,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid | 79 | @@ -2203,6 +2205,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid |
73 | p->max_source_channels = 1; | 80 | p->max_source_channels = 1; |
74 | pa_hashmap_put(input_port->profiles, p->name, p); | 81 | pa_hashmap_put(input_port->profiles, p->name, p); |
75 | pa_hashmap_put(output_port->profiles, p->name, p); | 82 | pa_hashmap_put(output_port->profiles, p->name, p); |
@@ -78,7 +85,7 @@ index db69d34..b40c6a0 100644 | |||
78 | 85 | ||
79 | d = PA_CARD_PROFILE_DATA(p); | 86 | d = PA_CARD_PROFILE_DATA(p); |
80 | *d = PA_BLUEZ4_PROFILE_HSP; | 87 | *d = PA_BLUEZ4_PROFILE_HSP; |
81 | @@ -2218,6 +2222,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid | 88 | @@ -2215,6 +2219,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid |
82 | p->max_source_channels = 1; | 89 | p->max_source_channels = 1; |
83 | pa_hashmap_put(input_port->profiles, p->name, p); | 90 | pa_hashmap_put(input_port->profiles, p->name, p); |
84 | pa_hashmap_put(output_port->profiles, p->name, p); | 91 | pa_hashmap_put(output_port->profiles, p->name, p); |
@@ -88,7 +95,7 @@ index db69d34..b40c6a0 100644 | |||
88 | d = PA_CARD_PROFILE_DATA(p); | 95 | d = PA_CARD_PROFILE_DATA(p); |
89 | *d = PA_BLUEZ4_PROFILE_HFGW; | 96 | *d = PA_BLUEZ4_PROFILE_HFGW; |
90 | diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c | 97 | diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c |
91 | index 7238e6f..3321785 100644 | 98 | index 84e6d55..b015c67 100644 |
92 | --- a/src/modules/bluetooth/module-bluez5-device.c | 99 | --- a/src/modules/bluetooth/module-bluez5-device.c |
93 | +++ b/src/modules/bluetooth/module-bluez5-device.c | 100 | +++ b/src/modules/bluetooth/module-bluez5-device.c |
94 | @@ -1790,6 +1790,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid | 101 | @@ -1790,6 +1790,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid |
@@ -126,18 +133,18 @@ index 7238e6f..3321785 100644 | |||
126 | p = PA_CARD_PROFILE_DATA(cp); | 133 | p = PA_CARD_PROFILE_DATA(cp); |
127 | *p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY; | 134 | *p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY; |
128 | diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c | 135 | diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c |
129 | index 6f9391e..cc4c784 100644 | 136 | index b6cbbf7..f92ac87 100644 |
130 | --- a/src/pulsecore/card.c | 137 | --- a/src/pulsecore/card.c |
131 | +++ b/src/pulsecore/card.c | 138 | +++ b/src/pulsecore/card.c |
132 | @@ -50,6 +50,7 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description, | 139 | @@ -45,6 +45,7 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description, |
133 | c->n_sinks = c->n_sources = 0; | 140 | c->name = pa_xstrdup(name); |
134 | c->max_sink_channels = c->max_source_channels = 0; | 141 | c->description = pa_xstrdup(description); |
135 | c->available = PA_AVAILABLE_UNKNOWN; | 142 | c->available = PA_AVAILABLE_UNKNOWN; |
136 | + c->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); | 143 | + c->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); |
137 | 144 | ||
138 | return c; | 145 | return c; |
139 | } | 146 | } |
140 | @@ -57,11 +58,25 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description, | 147 | @@ -52,6 +53,14 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description, |
141 | void pa_card_profile_free(pa_card_profile *c) { | 148 | void pa_card_profile_free(pa_card_profile *c) { |
142 | pa_assert(c); | 149 | pa_assert(c); |
143 | 150 | ||
@@ -149,8 +156,10 @@ index 6f9391e..cc4c784 100644 | |||
149 | + pa_hashmap_free(c->ports); | 156 | + pa_hashmap_free(c->ports); |
150 | + } | 157 | + } |
151 | + | 158 | + |
159 | pa_xfree(c->input_name); | ||
160 | pa_xfree(c->output_name); | ||
152 | pa_xfree(c->name); | 161 | pa_xfree(c->name); |
153 | pa_xfree(c->description); | 162 | @@ -59,6 +68,12 @@ void pa_card_profile_free(pa_card_profile *c) { |
154 | pa_xfree(c); | 163 | pa_xfree(c); |
155 | } | 164 | } |
156 | 165 | ||
@@ -163,47 +172,11 @@ index 6f9391e..cc4c784 100644 | |||
163 | void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available) { | 172 | void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available) { |
164 | pa_core *core; | 173 | pa_core *core; |
165 | 174 | ||
166 | @@ -198,6 +213,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) { | ||
167 | |||
168 | c->userdata = NULL; | ||
169 | c->set_profile = NULL; | ||
170 | + c->active_profile = NULL; | ||
171 | |||
172 | pa_device_init_description(c->proplist, c); | ||
173 | pa_device_init_icon(c->proplist, true); | ||
174 | diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h | 175 | diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h |
175 | index 3e2c004..1c33958 100644 | 176 | index 30bfc0e..fff9057 100644 |
176 | --- a/src/pulsecore/card.h | 177 | --- a/src/pulsecore/card.h |
177 | +++ b/src/pulsecore/card.h | 178 | +++ b/src/pulsecore/card.h |
178 | @@ -22,19 +22,21 @@ | 179 | @@ -50,6 +50,8 @@ struct pa_card_profile { |
179 | |||
180 | typedef struct pa_card pa_card; | ||
181 | |||
182 | -#include <pulse/proplist.h> | ||
183 | -#include <pulsecore/core.h> | ||
184 | -#include <pulsecore/module.h> | ||
185 | -#include <pulsecore/idxset.h> | ||
186 | - | ||
187 | /* This enum replaces pa_port_available_t (defined in pulse/def.h) for | ||
188 | - * internal use, so make sure both enum types stay in sync. */ | ||
189 | + * internal use, so make sure both enum types stay in sync. This is defined | ||
190 | + * before the #includes, because device-port.h depends on this enum. */ | ||
191 | typedef enum pa_available { | ||
192 | PA_AVAILABLE_UNKNOWN = 0, | ||
193 | PA_AVAILABLE_NO = 1, | ||
194 | PA_AVAILABLE_YES = 2, | ||
195 | } pa_available_t; | ||
196 | |||
197 | +#include <pulse/proplist.h> | ||
198 | +#include <pulsecore/core.h> | ||
199 | +#include <pulsecore/device-port.h> | ||
200 | +#include <pulsecore/module.h> | ||
201 | +#include <pulsecore/idxset.h> | ||
202 | + | ||
203 | typedef struct pa_card_profile { | ||
204 | pa_card *card; | ||
205 | char *name; | ||
206 | @@ -43,6 +45,8 @@ typedef struct pa_card_profile { | ||
207 | unsigned priority; | 180 | unsigned priority; |
208 | pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */ | 181 | pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */ |
209 | 182 | ||
@@ -212,7 +185,7 @@ index 3e2c004..1c33958 100644 | |||
212 | /* We probably want to have different properties later on here */ | 185 | /* We probably want to have different properties later on here */ |
213 | unsigned n_sinks; | 186 | unsigned n_sinks; |
214 | unsigned n_sources; | 187 | unsigned n_sources; |
215 | @@ -100,6 +104,8 @@ typedef struct pa_card_new_data { | 188 | @@ -107,6 +109,8 @@ typedef struct pa_card_new_data { |
216 | pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra); | 189 | pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra); |
217 | void pa_card_profile_free(pa_card_profile *c); | 190 | void pa_card_profile_free(pa_card_profile *c); |
218 | 191 | ||
@@ -222,10 +195,10 @@ index 3e2c004..1c33958 100644 | |||
222 | void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available); | 195 | void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available); |
223 | 196 | ||
224 | diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c | 197 | diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c |
225 | index cfe2a80..f16ecef 100644 | 198 | index 5807d3e..d12dfbc 100644 |
226 | --- a/src/pulsecore/device-port.c | 199 | --- a/src/pulsecore/device-port.c |
227 | +++ b/src/pulsecore/device-port.c | 200 | +++ b/src/pulsecore/device-port.c |
228 | @@ -95,8 +95,13 @@ static void device_port_free(pa_object *o) { | 201 | @@ -107,8 +107,13 @@ static void device_port_free(pa_object *o) { |
229 | if (p->proplist) | 202 | if (p->proplist) |
230 | pa_proplist_free(p->proplist); | 203 | pa_proplist_free(p->proplist); |
231 | 204 | ||
@@ -238,8 +211,8 @@ index cfe2a80..f16ecef 100644 | |||
238 | pa_hashmap_free(p->profiles); | 211 | pa_hashmap_free(p->profiles); |
239 | + } | 212 | + } |
240 | 213 | ||
214 | pa_xfree(p->preferred_profile); | ||
241 | pa_xfree(p->name); | 215 | pa_xfree(p->name); |
242 | pa_xfree(p->description); | ||
243 | -- | 216 | -- |
244 | 2.1.4 | 217 | 2.7.0 |
245 | 218 | ||