aboutsummaryrefslogtreecommitdiff
path: root/dbus/protocol.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-05-10 17:10:59 +0200
committerdec05eba <dec05eba@protonmail.com>2025-05-10 17:10:59 +0200
commite3225bc62835c6accc18787c6038fc1dce2484fc (patch)
tree56c22deacd2a1101ad82ecc80ad300896e6c872f /dbus/protocol.h
parent811a14481dbd75fe2c2a072517e06add336fee4f (diff)
Move dbus code to a separate process to allow gpu-screen-recorder to use cap_sys_nice for better recording performance on amd
Diffstat (limited to 'dbus/protocol.h')
-rw-r--r--dbus/protocol.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/dbus/protocol.h b/dbus/protocol.h
new file mode 100644
index 0000000..212358d
--- /dev/null
+++ b/dbus/protocol.h
@@ -0,0 +1,86 @@
+#ifndef GSR_DBUS_PROTOCOL_H
+#define GSR_DBUS_PROTOCOL_H
+
+#include <stdint.h>
+
+#define GSR_DBUS_PROTOCOL_VERSION 1
+
+typedef enum {
+ GSR_DBUS_MESSAGE_REQ_CREATE_SESSION,
+ GSR_DBUS_MESSAGE_REQ_SELECT_SOURCES,
+ GSR_DBUS_MESSAGE_REQ_START,
+ GSR_DBUS_MESSAGE_REQ_OPEN_PIPEWIRE_REMOTE
+} gsr_dbus_message_req_type;
+
+typedef struct {
+
+} gsr_dbus_message_req_create_session;
+
+typedef struct {
+ char session_handle[128];
+ uint32_t capture_type;
+ uint32_t cursor_mode;
+} gsr_dbus_message_req_select_sources;
+
+typedef struct {
+ char session_handle[128];
+} gsr_dbus_message_req_start;
+
+typedef struct {
+ char session_handle[128];
+} gsr_dbus_message_req_open_pipewire_remote;
+
+typedef struct {
+ uint8_t protocol_version;
+ gsr_dbus_message_req_type type;
+ union {
+ gsr_dbus_message_req_create_session create_session;
+ gsr_dbus_message_req_select_sources select_sources;
+ gsr_dbus_message_req_start start;
+ gsr_dbus_message_req_open_pipewire_remote open_pipewire_remote;
+ };
+} gsr_dbus_request_message;
+
+typedef enum {
+ GSR_DBUS_MESSAGE_RESP_ERROR,
+ GSR_DBUS_MESSAGE_RESP_CREATE_SESSION,
+ GSR_DBUS_MESSAGE_RESP_SELECT_SOURCES,
+ GSR_DBUS_MESSAGE_RESP_START,
+ GSR_DBUS_MESSAGE_RESP_OPEN_PIPEWIRE_REMOTE
+} gsr_dbus_message_resp_type;
+
+typedef struct {
+ uint32_t error_code;
+ char message[128];
+} gsr_dbus_message_resp_error;
+
+typedef struct {
+ char session_handle[128];
+} gsr_dbus_message_resp_create_session;
+
+typedef struct {
+
+} gsr_dbus_message_resp_select_sources;
+
+typedef struct {
+ char restore_token[128];
+ uint32_t pipewire_node;
+} gsr_dbus_message_resp_start;
+
+typedef struct {
+
+} gsr_dbus_message_resp_open_pipewire_remote;
+
+typedef struct {
+ uint8_t protocol_version;
+ gsr_dbus_message_resp_type type;
+ union {
+ gsr_dbus_message_resp_error error;
+ gsr_dbus_message_resp_create_session create_session;
+ gsr_dbus_message_resp_select_sources select_sources;
+ gsr_dbus_message_resp_start start;
+ gsr_dbus_message_resp_open_pipewire_remote open_pipewire_remote;
+ };
+} gsr_dbus_response_message;
+
+#endif /* GSR_DBUS_PROTOCOL_H */