Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
misc.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <unistd.h>
9#include <vector>
10
11// local includes
12#include "src/utility.h"
13
14KITTY_USING_MOVE_T(file_t, int, -1, {
15 if (el >= 0) {
16 close(el);
17 }
18});
19
20enum class window_system_e {
21 NONE,
23 WAYLAND,
24};
25
26extern window_system_e window_system;
27
28#ifdef HERMES_BUILD_SDBUS
29struct sd_bus;
30#endif
31
32namespace platf {
47 int open_drm_node(const char *path, int flags);
48
58 int open_encode_render_node(bool nvenc = false);
59
68 std::string encode_gpu_description(bool nvenc = false);
69
77 void note_vaapi_encode_gpu(int fd);
78
83 std::string last_vaapi_encode_gpu();
84
89 std::vector<std::string> render_node_descriptions();
90
91#ifdef HERMES_BUILD_SDBUS
103 int open_user_bus(sd_bus **result);
104#endif
105
106} // namespace platf
107
108namespace dyn {
109 typedef void (*apiproc)(void);
110
111 int load(void *handle, const std::vector<std::tuple<apiproc *, const char *>> &funcs, bool strict = true);
112 void *handle(const std::vector<const char *> &libs);
113
114} // namespace dyn
115
116namespace platf {
119}
int open_encode_render_node(bool nvenc)
Open the render node of the best GPU to encode a stream on.
std::vector< std::string > render_node_descriptions()
Describe every GPU render node, as encode_gpu_description() does, the capture-only Hermes-KMS node in...
void note_vaapi_encode_gpu(int fd)
Record the GPU a VAAPI encoder actually opened, from its DRM fd.
std::string encode_gpu_description(bool nvenc)
Describe the GPU a stream encodes on, for logs and diagnostics: its render node, driver and the name ...
std::string last_vaapi_encode_gpu()
The GPU the last VAAPI encoder opened, described as encode_gpu_description() does,...
int open_drm_node(const char *path, int flags)
Open a DRM device node without becoming its DRM master.
Definition misc.cpp:138
bool request_user_service_stop()
Definition misc.cpp:1068
window_system_e
Definition misc.h:20
@ X11
X11.
Definition misc.h:22
Declarations for utility functions.