alsa: Add associations between jacks, UCM devices and UCM ports

These associations will be used by subsequent UCM jack detection
refactoring work.
This commit is contained in:
Tanu Kaskinen 2015-05-04 21:03:42 +03:00
parent d7ce78b234
commit 40714b6bcc
4 changed files with 90 additions and 2 deletions

View file

@ -123,6 +123,7 @@ pa_alsa_jack *pa_alsa_jack_new(pa_alsa_path *path, const char *name, const char
jack->state_unplugged = PA_AVAILABLE_NO;
jack->state_plugged = PA_AVAILABLE_YES;
jack->ucm_devices = pa_dynarray_new(NULL);
return jack;
}
@ -130,11 +131,21 @@ pa_alsa_jack *pa_alsa_jack_new(pa_alsa_path *path, const char *name, const char
void pa_alsa_jack_free(pa_alsa_jack *jack) {
pa_assert(jack);
if (jack->ucm_devices)
pa_dynarray_free(jack->ucm_devices);
pa_xfree(jack->alsa_name);
pa_xfree(jack->name);
pa_xfree(jack);
}
void pa_alsa_jack_add_ucm_device(pa_alsa_jack *jack, pa_alsa_ucm_device *device) {
pa_assert(jack);
pa_assert(device);
pa_dynarray_append(jack->ucm_devices, device);
}
static const char *lookup_description(const char *key, const struct description_map dm[], unsigned n) {
unsigned i;