2019-05-17 13:08:45 +03:00
|
|
|
/* WirePlumber
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2019 Collabora Ltd.
|
|
|
|
|
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
|
|
|
|
|
*
|
2019-05-31 12:13:01 +03:00
|
|
|
* SPDX-License-Identifier: MIT
|
2019-05-17 13:08:45 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WIREPLUMBER_CORE_H__
|
|
|
|
|
#define __WIREPLUMBER_CORE_H__
|
|
|
|
|
|
2023-06-20 13:22:26 +03:00
|
|
|
#include "object.h"
|
2020-11-16 10:35:50 +02:00
|
|
|
#include "properties.h"
|
2023-05-25 18:29:58 +03:00
|
|
|
#include "spa-json.h"
|
2019-05-17 13:08:45 +03:00
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2020-01-09 12:39:45 -05:00
|
|
|
struct pw_context;
|
2020-01-30 17:41:25 +02:00
|
|
|
struct pw_core;
|
2020-11-16 10:35:50 +02:00
|
|
|
typedef struct _WpObjectManager WpObjectManager;
|
2019-09-07 17:55:46 +03:00
|
|
|
|
2023-06-20 13:22:26 +03:00
|
|
|
/*!
|
|
|
|
|
* \brief Flags to be used as WpObjectFeatures on WpCore
|
|
|
|
|
* \ingroup wpcore
|
|
|
|
|
*/
|
|
|
|
|
typedef enum { /*< flags >*/
|
|
|
|
|
/*! connects to pipewire */
|
|
|
|
|
WP_CORE_FEATURE_CONNECTED = (1 << 0),
|
|
|
|
|
} WpCoreFeatures;
|
|
|
|
|
|
2021-05-13 17:54:58 +03:00
|
|
|
/*!
|
2021-05-21 18:40:43 +03:00
|
|
|
* \brief The WpCore GType
|
|
|
|
|
* \ingroup wpcore
|
2021-05-13 17:54:58 +03:00
|
|
|
*/
|
2019-05-17 13:08:45 +03:00
|
|
|
#define WP_TYPE_CORE (wp_core_get_type ())
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2023-06-20 13:22:26 +03:00
|
|
|
G_DECLARE_FINAL_TYPE (WpCore, wp_core, WP, CORE, WpObject)
|
2019-05-17 13:08:45 +03:00
|
|
|
|
2020-01-09 12:39:45 -05:00
|
|
|
/* Basic */
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-09-07 18:21:17 +03:00
|
|
|
WpCore * wp_core_new (GMainContext *context, WpProperties * properties);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
2020-06-10 12:27:39 -04:00
|
|
|
WP_API
|
|
|
|
|
WpCore * wp_core_clone (WpCore * self);
|
|
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2020-06-16 12:53:18 +03:00
|
|
|
GMainContext * wp_core_get_g_main_context (WpCore * self);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2020-01-09 12:39:45 -05:00
|
|
|
struct pw_context * wp_core_get_pw_context (WpCore * self);
|
|
|
|
|
|
2020-01-30 17:41:25 +02:00
|
|
|
WP_API
|
|
|
|
|
struct pw_core * wp_core_get_pw_core (WpCore * self);
|
|
|
|
|
|
2022-05-25 12:45:13 -04:00
|
|
|
WP_API
|
|
|
|
|
gchar *wp_core_get_vm_type (WpCore *self);
|
|
|
|
|
|
2020-01-09 12:39:45 -05:00
|
|
|
/* Connection */
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2020-01-09 12:39:45 -05:00
|
|
|
gboolean wp_core_connect (WpCore *self);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2020-01-09 12:39:45 -05:00
|
|
|
void wp_core_disconnect (WpCore *self);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2020-01-09 12:39:45 -05:00
|
|
|
gboolean wp_core_is_connected (WpCore * self);
|
|
|
|
|
|
2020-06-15 17:50:03 +03:00
|
|
|
/* Properties */
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
guint32 wp_core_get_remote_cookie (WpCore * self);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
const gchar * wp_core_get_remote_name (WpCore * self);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
const gchar * wp_core_get_remote_user_name (WpCore * self);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
const gchar * wp_core_get_remote_host_name (WpCore * self);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
const gchar * wp_core_get_remote_version (WpCore * self);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
WpProperties * wp_core_get_remote_properties (WpCore * self);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
WpProperties * wp_core_get_properties (WpCore * self);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
void wp_core_update_properties (WpCore * self, WpProperties * updates);
|
|
|
|
|
|
2020-01-09 12:39:45 -05:00
|
|
|
/* Callback */
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2020-02-19 09:33:11 -05:00
|
|
|
void wp_core_idle_add (WpCore * self, GSource **source, GSourceFunc function,
|
|
|
|
|
gpointer data, GDestroyNotify destroy);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
2020-02-12 13:20:17 -05:00
|
|
|
WP_API
|
2020-05-07 11:10:12 +03:00
|
|
|
void wp_core_idle_add_closure (WpCore * self, GSource **source,
|
|
|
|
|
GClosure * closure);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
void wp_core_timeout_add (WpCore * self, GSource **source, guint timeout_ms,
|
2020-02-12 13:20:17 -05:00
|
|
|
GSourceFunc function, gpointer data, GDestroyNotify destroy);
|
|
|
|
|
|
2020-05-07 11:10:12 +03:00
|
|
|
WP_API
|
|
|
|
|
void wp_core_timeout_add_closure (WpCore * self, GSource **source,
|
|
|
|
|
guint timeout_ms, GClosure * closure);
|
|
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2019-12-06 08:43:40 -05:00
|
|
|
gboolean wp_core_sync (WpCore * self, GCancellable * cancellable,
|
2019-12-04 15:20:42 -05:00
|
|
|
GAsyncReadyCallback callback, gpointer user_data);
|
2019-09-07 17:55:46 +03:00
|
|
|
|
2021-12-21 20:03:58 +02:00
|
|
|
WP_API
|
|
|
|
|
gboolean wp_core_sync_closure (WpCore * self, GCancellable * cancellable,
|
|
|
|
|
GClosure * closure);
|
|
|
|
|
|
2020-01-17 14:22:04 +02:00
|
|
|
WP_API
|
|
|
|
|
gboolean wp_core_sync_finish (WpCore * self, GAsyncResult * res,
|
|
|
|
|
GError ** error);
|
|
|
|
|
|
2023-06-13 19:20:33 +03:00
|
|
|
/* Object Registry */
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
gpointer wp_core_find_object (WpCore * self, GEqualFunc func,
|
|
|
|
|
gconstpointer data);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
void wp_core_register_object (WpCore * self, gpointer obj);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
void wp_core_remove_object (WpCore * self, gpointer obj);
|
|
|
|
|
|
2020-01-09 12:39:45 -05:00
|
|
|
/* Object Manager */
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-11-13 15:44:23 +02:00
|
|
|
void wp_core_install_object_manager (WpCore * self, WpObjectManager * om);
|
|
|
|
|
|
2023-06-12 23:48:32 +03:00
|
|
|
/* Global Features */
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
gboolean wp_core_test_feature (WpCore * self, const gchar * feature);
|
|
|
|
|
|
2019-05-17 13:08:45 +03:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif
|