
This one offers API to interract on a lower level with the D-Bus reservation API and uses GDBus high level bindings only. Also, this one implements the full Acquire procedure, calling RequestRelease() on the peer and requesting the name again with REPLACE_EXISTING
43 lines
937 B
C
43 lines
937 B
C
/* WirePlumber
|
|
*
|
|
* Copyright © 2021 Collabora Ltd.
|
|
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef __WIREPLUMBER_RESERVE_DEVICE_PLUGIN_H__
|
|
#define __WIREPLUMBER_RESERVE_DEVICE_PLUGIN_H__
|
|
|
|
#include <wp/wp.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define FDO_RESERVE_DEVICE1_SERVICE "org.freedesktop.ReserveDevice1"
|
|
#define FDO_RESERVE_DEVICE1_PATH "/org/freedesktop/ReserveDevice1"
|
|
|
|
typedef enum {
|
|
WP_DBUS_CONNECTION_STATE_CLOSED = 0,
|
|
WP_DBUS_CONNECTION_STATE_CONNECTING,
|
|
WP_DBUS_CONNECTION_STATE_CONNECTED,
|
|
} WpDBusConnectionState;
|
|
|
|
G_DECLARE_FINAL_TYPE (WpReserveDevicePlugin, wp_reserve_device_plugin,
|
|
WP, RESERVE_DEVICE_PLUGIN, WpPlugin)
|
|
|
|
struct _WpReserveDevicePlugin
|
|
{
|
|
WpPlugin parent;
|
|
|
|
WpDBusConnectionState state;
|
|
GHashTable *reserve_devices;
|
|
|
|
GCancellable *cancellable;
|
|
GDBusConnection *connection;
|
|
GDBusObjectManagerServer *manager;
|
|
};
|
|
|
|
G_END_DECLS
|
|
|
|
#endif
|