#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
#include <pulsecore/namereg.h>
+#include <pulsecore/device-port.h>
#include "card.h"
memset(data, 0, sizeof(*data));
data->proplist = pa_proplist_new();
-
+ data->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
return data;
}
pa_hashmap_free(data->profiles, NULL, NULL);
}
+ if (data->ports)
+ pa_device_port_hashmap_free(data->ports);
+
pa_xfree(data->name);
pa_xfree(data->active_profile);
}
* copying it here */
c->profiles = data->profiles;
data->profiles = NULL;
+ c->ports = data->ports;
+ data->ports = NULL;
c->active_profile = NULL;
c->save_profile = FALSE;
pa_assert(pa_idxset_isempty(c->sources));
pa_idxset_free(c->sources, NULL, NULL);
+ pa_device_port_hashmap_free(c->ports);
+
if (c->profiles) {
pa_card_profile *p;
pa_hashmap *profiles;
pa_card_profile *active_profile;
+ pa_hashmap *ports;
+
pa_bool_t save_profile:1;
void *userdata;
pa_hashmap *profiles;
char *active_profile;
+ pa_hashmap *ports;
+
pa_bool_t namereg_fail:1;
pa_bool_t save_profile:1;
pa_assert(p);
pa_assert(pa_device_port_refcnt(p) == 0);
+ if (p->profiles)
+ pa_hashmap_free(p->profiles, NULL, NULL);
pa_xfree(p->name);
pa_xfree(p->description);
pa_xfree(p);
p->description = pa_xstrdup(description);
p->priority = 0;
p->available = PA_PORT_AVAILABLE_UNKNOWN;
+ p->profiles = NULL;
+ p->is_input = FALSE;
+ p->is_output = FALSE;
return p;
}
unsigned priority;
pa_port_available_t available; /* PA_PORT_AVAILABLE_UNKNOWN, PA_PORT_AVAILABLE_NO or PA_PORT_AVAILABLE_YES */
+ pa_hashmap *profiles; /* Can be NULL. Does not own the profiles */
+ pa_bool_t is_input:1;
+ pa_bool_t is_output:1;
+
/* .. followed by some implementation specific data */
};