mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-12 13:30:10 -05:00
device-port: add type member
The clients might wanna to know for which purpose is the port. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
861836c5f7
commit
feee531c2b
9 changed files with 77 additions and 10 deletions
|
|
@ -29,6 +29,7 @@ pa_device_port_new_data *pa_device_port_new_data_init(pa_device_port_new_data *d
|
|||
pa_assert(data);
|
||||
|
||||
pa_zero(*data);
|
||||
data->type = PA_DEVICE_PORT_TYPE_UNKNOWN;
|
||||
data->available = PA_AVAILABLE_UNKNOWN;
|
||||
return data;
|
||||
}
|
||||
|
|
@ -66,6 +67,12 @@ void pa_device_port_new_data_set_direction(pa_device_port_new_data *data, pa_dir
|
|||
data->direction = direction;
|
||||
}
|
||||
|
||||
void pa_device_port_new_data_set_type(pa_device_port_new_data *data, pa_device_port_type_t type) {
|
||||
pa_assert(data);
|
||||
|
||||
data->type = type;
|
||||
}
|
||||
|
||||
void pa_device_port_new_data_done(pa_device_port_new_data *data) {
|
||||
pa_assert(data);
|
||||
|
||||
|
|
@ -182,6 +189,7 @@ pa_device_port *pa_device_port_new(pa_core *c, pa_device_port_new_data *data, si
|
|||
data->available_group = NULL;
|
||||
p->profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
|
||||
p->direction = data->direction;
|
||||
p->type = data->type;
|
||||
|
||||
p->latency_offset = 0;
|
||||
p->proplist = pa_proplist_new();
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ struct pa_device_port {
|
|||
char *name;
|
||||
char *description;
|
||||
char *preferred_profile;
|
||||
pa_device_port_type_t type;
|
||||
|
||||
unsigned priority;
|
||||
pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */
|
||||
|
|
@ -70,6 +71,7 @@ typedef struct pa_device_port_new_data {
|
|||
pa_available_t available;
|
||||
char *available_group;
|
||||
pa_direction_t direction;
|
||||
pa_device_port_type_t type;
|
||||
} pa_device_port_new_data;
|
||||
|
||||
pa_device_port_new_data *pa_device_port_new_data_init(pa_device_port_new_data *data);
|
||||
|
|
@ -78,6 +80,7 @@ void pa_device_port_new_data_set_description(pa_device_port_new_data *data, cons
|
|||
void pa_device_port_new_data_set_available(pa_device_port_new_data *data, pa_available_t available);
|
||||
void pa_device_port_new_data_set_available_group(pa_device_port_new_data *data, const char *group);
|
||||
void pa_device_port_new_data_set_direction(pa_device_port_new_data *data, pa_direction_t direction);
|
||||
void pa_device_port_new_data_set_type(pa_device_port_new_data *data, pa_device_port_type_t type);
|
||||
void pa_device_port_new_data_done(pa_device_port_new_data *data);
|
||||
|
||||
pa_device_port *pa_device_port_new(pa_core *c, pa_device_port_new_data *data, size_t extra);
|
||||
|
|
|
|||
|
|
@ -3207,8 +3207,10 @@ static void sink_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sin
|
|||
pa_tagstruct_putu32(t, p->priority);
|
||||
if (c->version >= 24) {
|
||||
pa_tagstruct_putu32(t, p->available);
|
||||
if (c->version >= 34)
|
||||
if (c->version >= 34) {
|
||||
pa_tagstruct_puts(t, p->available_group);
|
||||
pa_tagstruct_putu32(t, p->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3280,8 +3282,10 @@ static void source_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_s
|
|||
pa_tagstruct_putu32(t, p->priority);
|
||||
if (c->version >= 24) {
|
||||
pa_tagstruct_putu32(t, p->available);
|
||||
if (c->version >= 34)
|
||||
if (c->version >= 34) {
|
||||
pa_tagstruct_puts(t, p->available_group);
|
||||
pa_tagstruct_putu32(t, p->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3366,8 +3370,10 @@ static void card_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_car
|
|||
|
||||
if (c->version >= 27) {
|
||||
pa_tagstruct_puts64(t, port->latency_offset);
|
||||
if (c->version >= 34)
|
||||
if (c->version >= 34) {
|
||||
pa_tagstruct_puts(t, port->available_group);
|
||||
pa_tagstruct_putu32(t, port->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue