Two different proposals (very drafty) on how to expose ports for
inactive profiles, dunno which one is better. The first one adds a
cross-reference struct which will repeat itself for every combination of
port and profile. The second one adds a profile list for every port. The
second one looks less ugly, but would bloat the network a little more as
that would make pa_sink_port_info include the profile list as well.
Both proposals add port lists to the card. The internal structure for
this is coming soon to a patch near you.
Both patches can also be combined with a patch that would merge
pa_source_port_info and pa_sink_port_info into a single struct (for
simplicity).
Note: as some of you might remember, I tried adding a "ports" field to
the pa_card_profile struct, but that broke the ABI as pa_card has a list
that's depending on the size of pa_card_profile.
// David
diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h
index 1d77d45..66cf2e0 100644
--- a/src/pulse/introspect.h
+++ b/src/pulse/introspect.h
@@ -464,6 +464,15 @@ typedef struct pa_card_info {
pa_card_profile_info* profiles; /**< Array of available profile, or NULL. Array is terminated by an entry with name set to NULL. Number of entries is stored in n_profiles */
pa_card_profile_info* active_profile; /**< Pointer to active profile in the array, or NULL */
pa_proplist *proplist; /**< Property list */
+ uint32_t n_source_ports;
+ pa_source_port_info **source_ports;
+ uint32_t n_sink_ports;
+ pa_sink_port_info **sink_ports;
+ struct { /* One entry for every combination of port and profile */
+ pa_sink_port_info *sink_port; /* Either sink_port or source_port can be NULL, but not both (but possibly none of them?) */
+ pa_source_port_info *source_port;
+ pa_card_profile *profile;
+ } port_profiles;
} pa_card_info;
/** Callback prototype for pa_context_get_card_info_...() \since 0.9.15 */
diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h
index 1d77d45..e27c8e8 100644
--- a/src/pulse/introspect.h
+++ b/src/pulse/introspect.h
@@ -202,6 +202,8 @@ typedef struct pa_sink_port_info {
const char *name; /**< Name of this port */
const char *description; /**< Description of this port */
uint32_t priority; /**< The higher this value is the more useful this port is as a default */
+ int n_profiles;
+ pa_card_profile* profiles;
} pa_sink_port_info;
/** Stores information about sinks. Please note that this structure
@@ -281,6 +283,8 @@ typedef struct pa_source_port_info {
const char *name; /**< Name of this port */
const char *description; /**< Description of this port */
uint32_t priority; /**< The higher this value is the more useful this port is as a default */
+ int n_profiles;
+ pa_card_profile* profiles;
} pa_source_port_info;
/** Stores information about sources. Please note that this structure
@@ -464,6 +468,10 @@ typedef struct pa_card_info {
pa_card_profile_info* profiles; /**< Array of available profile, or NULL. Array is terminated by an entry with name set to NULL. Number of entries is stored in n_profiles */
pa_card_profile_info* active_profile; /**< Pointer to active profile in the array, or NULL */
pa_proplist *proplist; /**< Property list */
+ uint32_t n_source_ports;
+ pa_source_port_info **source_ports;
+ uint32_t n_sink_ports;
+ pa_sink_port_info **sink_ports;
} pa_card_info;
/** Callback prototype for pa_context_get_card_info_...() \since 0.9.15 */
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss