mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-19 07:00:10 -05:00
introspect: add state and format for output source
Add state and negotiated format to output source properties.
This commit is contained in:
parent
95f479a760
commit
51f18b540a
5 changed files with 77 additions and 8 deletions
|
|
@ -339,6 +339,20 @@ source_output_fill_info (PinosSourceOutputInfo *info, GDBusProxy *proxy)
|
|||
} else {
|
||||
info->possible_formats = NULL;
|
||||
}
|
||||
if ((variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "State"))) {
|
||||
info->state = g_variant_get_uint32 (variant);
|
||||
g_variant_unref (variant);
|
||||
} else {
|
||||
info->state = PINOS_SOURCE_OUTPUT_STATE_ERROR;
|
||||
}
|
||||
if ((variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Format"))) {
|
||||
gsize len;
|
||||
gchar *format = g_variant_dup_string (variant, &len);
|
||||
info->format = g_bytes_new_take (format, len + 1);
|
||||
g_variant_unref (variant);
|
||||
} else {
|
||||
info->format = NULL;
|
||||
}
|
||||
info->properties = pinos_properties_from_variant (
|
||||
g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Properties"));
|
||||
|
||||
|
|
|
|||
|
|
@ -164,12 +164,30 @@ void pinos_context_get_source_info_by_id (PinosContext *context,
|
|||
GCancellable *cancellable,
|
||||
gpointer user_data);
|
||||
|
||||
/**
|
||||
* PinosSourceState:
|
||||
* @PINOS_SOURCE_OUTPUT_STATE_ERROR: the source output is in error
|
||||
* @PINOS_SOURCE_OUTPUT_STATE_IDLE: the source output is idle
|
||||
* @PINOS_SOURCE_OUTPUT_STATE_STARTING: the source output is starting
|
||||
* @PINOS_SOURCE_OUTPUT_STATE_STREAMING: the source output is streaming
|
||||
*
|
||||
* The different source output states
|
||||
*/
|
||||
typedef enum {
|
||||
PINOS_SOURCE_OUTPUT_STATE_ERROR = -1,
|
||||
PINOS_SOURCE_OUTPUT_STATE_IDLE = 0,
|
||||
PINOS_SOURCE_OUTPUT_STATE_STARTING = 1,
|
||||
PINOS_SOURCE_OUTPUT_STATE_STREAMING = 2,
|
||||
} PinosSourceOutputState;
|
||||
|
||||
/**
|
||||
* PinosSourceOutputInfo:
|
||||
* @id: generic id of the output
|
||||
* @client_path: the owner client
|
||||
* @source_path: the source path
|
||||
* @possible_formats: the possible formats
|
||||
* @state: the state
|
||||
* @format: when streaming, the current format
|
||||
* @properties: the properties of the source
|
||||
*
|
||||
* The source information. Extra information can be added in later
|
||||
|
|
@ -180,6 +198,8 @@ typedef struct {
|
|||
const char *client_path;
|
||||
const char *source_path;
|
||||
GBytes *possible_formats;
|
||||
PinosSourceOutputState state;
|
||||
GBytes *format;
|
||||
PinosProperties *properties;
|
||||
} PinosSourceOutputInfo;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue