| 1 |
/* WirePlumber |
| 2 |
* |
| 3 |
* Copyright © 2021 Collabora Ltd. |
| 4 |
* @author George Kiagiadakis <[email protected]> |
| 5 |
* |
| 6 |
* SPDX-License-Identifier: MIT |
| 7 |
*/ |
| 8 |
|
| 9 |
#ifndef __WIREPLUMBER_RESERVE_DEVICE_H__ |
| 10 |
#define __WIREPLUMBER_RESERVE_DEVICE_H__ |
| 11 |
|
| 12 |
#include <wp/wp.h> |
| 13 |
|
| 14 |
G_BEGIN_DECLS |
| 15 |
|
| 16 |
typedef enum { |
| 17 |
WP_RESERVE_DEVICE_STATE_UNKNOWN = 0, |
| 18 |
WP_RESERVE_DEVICE_STATE_BUSY, |
| 19 |
WP_RESERVE_DEVICE_STATE_AVAILABLE, |
| 20 |
WP_RESERVE_DEVICE_STATE_ACQUIRED, |
| 21 |
} WpReserveDeviceState; |
| 22 |
|
| 23 |
G_DECLARE_FINAL_TYPE (WpReserveDevice, wp_reserve_device, |
| 24 |
WP, RESERVE_DEVICE, GObject) |
| 25 |
|
| 26 |
struct _WpReserveDevice |
| 27 |
{ |
| 28 |
GObject parent; |
| 29 |
|
| 30 |
GWeakRef plugin; |
| 31 |
gchar *name; |
| 32 |
gchar *app_name; |
| 33 |
gchar *app_dev_name; |
| 34 |
gint priority; |
| 35 |
gchar *owner_app_name; |
| 36 |
|
| 37 |
gchar *service_name; |
| 38 |
gchar *object_path; |
| 39 |
|
| 40 |
GWeakRef transition; |
| 41 |
GDBusMethodInvocation *req_rel_invocation; |
| 42 |
WpReserveDeviceState state; |
| 43 |
guint watcher_id; |
| 44 |
guint owner_id; |
| 45 |
|
| 46 |
GCancellable *get_owner_call; |
| 47 |
}; |
| 48 |
|
| 49 |
void wp_reserve_device_export_object (WpReserveDevice *self); |
| 50 |
void wp_reserve_device_unexport_object (WpReserveDevice *self); |
| 51 |
|
| 52 |
void wp_reserve_device_own_name (WpReserveDevice * self, gboolean force); |
| 53 |
void wp_reserve_device_unown_name (WpReserveDevice * self); |
| 54 |
|
| 55 |
G_END_DECLS |
| 56 |
|
| 57 |
#endif |