Hermes
0.7.0
Linux game streaming host
Toggle main menu visibility
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
14
KITTY_USING_MOVE_T(file_t,
int
, -1, {
15
if
(el >= 0) {
16
close(el);
17
}
18
});
19
20
enum class
window_system_e
{
21
NONE,
22
X11
,
23
WAYLAND,
24
};
25
26
extern
window_system_e
window_system;
27
28
#ifdef HERMES_BUILD_SDBUS
29
struct
sd_bus;
30
#endif
31
32
namespace
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
108
namespace
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
116
namespace
platf {
118
bool
request_user_service_stop
();
119
}
platf::open_encode_render_node
int open_encode_render_node(bool nvenc)
Open the render node of the best GPU to encode a stream on.
Definition
encode_gpu.cpp:80
platf::render_node_descriptions
std::vector< std::string > render_node_descriptions()
Describe every GPU render node, as encode_gpu_description() does, the capture-only Hermes-KMS node in...
Definition
encode_gpu.cpp:313
platf::note_vaapi_encode_gpu
void note_vaapi_encode_gpu(int fd)
Record the GPU a VAAPI encoder actually opened, from its DRM fd.
Definition
encode_gpu.cpp:282
platf::encode_gpu_description
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 ...
Definition
encode_gpu.cpp:266
platf::last_vaapi_encode_gpu
std::string last_vaapi_encode_gpu()
The GPU the last VAAPI encoder opened, described as encode_gpu_description() does,...
Definition
encode_gpu.cpp:294
platf::open_drm_node
int open_drm_node(const char *path, int flags)
Open a DRM device node without becoming its DRM master.
Definition
misc.cpp:138
platf::request_user_service_stop
bool request_user_service_stop()
Definition
misc.cpp:1068
window_system_e
window_system_e
Definition
misc.h:20
window_system_e::X11
@ X11
X11.
Definition
misc.h:22
utility.h
Declarations for utility functions.
src
platform
linux
misc.h
Generated by
1.18.0