mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pinos-monitor: show peer ports
This commit is contained in:
parent
e8116fa68d
commit
6fcd0985a3
3 changed files with 51 additions and 6 deletions
|
|
@ -103,6 +103,19 @@ G_STMT_START {
|
|||
} \
|
||||
} G_STMT_END
|
||||
|
||||
#define SET_OBJV(name, field, idx) \
|
||||
G_STMT_START { \
|
||||
GVariant *variant; \
|
||||
if (!changed || g_hash_table_contains (changed, name)) \
|
||||
info->change_mask |= 1 << idx; \
|
||||
if ((variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), name))) { \
|
||||
info->field = g_variant_dup_objv (variant, NULL); \
|
||||
g_variant_unref (variant); \
|
||||
} else { \
|
||||
info->field = NULL; \
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
||||
static void
|
||||
daemon_fill_info (PinosDaemonInfo *info, GDBusProxy *proxy)
|
||||
{
|
||||
|
|
@ -324,9 +337,10 @@ port_fill_info (PinosPortInfo *info, GDBusProxy *proxy)
|
|||
|
||||
info->change_mask = 0;
|
||||
SET_STRING ("Name", name, 0);
|
||||
SET_PROPERTIES ("Properties", properties, 1);
|
||||
SET_BYTES ("PossibleFormats", possible_formats, 2);
|
||||
SET_BYTES ("Format", format, 3);
|
||||
SET_OBJV ("Peers", peers, 1);
|
||||
SET_PROPERTIES ("Properties", properties, 2);
|
||||
SET_BYTES ("PossibleFormats", possible_formats, 3);
|
||||
SET_BYTES ("Format", format, 4);
|
||||
|
||||
if (changed)
|
||||
g_hash_table_remove_all (changed);
|
||||
|
|
@ -335,6 +349,8 @@ port_fill_info (PinosPortInfo *info, GDBusProxy *proxy)
|
|||
static void
|
||||
port_clear_info (PinosPortInfo *info)
|
||||
{
|
||||
if (info->peers)
|
||||
g_strfreev (info->peers);
|
||||
if (info->properties)
|
||||
pinos_properties_free (info->properties);
|
||||
if (info->possible_formats)
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ void pinos_context_get_node_info_by_id (PinosContext *context,
|
|||
* @direction: the direction of the port
|
||||
* @change_mask: bitfield of changed fields since last call
|
||||
* @name: name the port, suitable for display
|
||||
* @peers: paths to peer ports
|
||||
* @properties: the properties of the port
|
||||
* @possible_formats: the possible formats this port can consume
|
||||
* @format: the current format on this port
|
||||
|
|
@ -227,6 +228,7 @@ typedef struct {
|
|||
guint64 change_mask;
|
||||
const char *name;
|
||||
PinosProperties *properties;
|
||||
gchar **peers;
|
||||
GBytes *possible_formats;
|
||||
GBytes *format;
|
||||
} PinosPortInfo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue