|
Hermes 0.7.0
Linux game streaming host
|
Choosing the GPU a stream is encoded on. More...
#include <algorithm>#include <cctype>#include <array>#include <cerrno>#include <cstdint>#include <cstring>#include <filesystem>#include <format>#include <fstream>#include <mutex>#include <string>#include <string_view>#include <fcntl.h>#include <sys/stat.h>#include <sys/sysmacros.h>#include <unistd.h>#include <xf86drm.h>#include "misc.h"#include "src/config.h"#include "src/logging.h"#include "src/utility.h"#include "vaapi.h"Go to the source code of this file.
Functions | |
| int | platf::open_encode_render_node (bool nvenc=false) |
| Open the render node of the best GPU to encode a stream on. | |
| std::string | platf::encode_gpu_description (bool nvenc=false) |
| Describe the GPU a stream encodes on, for logs and diagnostics: its render node, driver and the name it is sold under, or its PCI id. | |
| void | platf::note_vaapi_encode_gpu (int fd) |
| Record the GPU a VAAPI encoder actually opened, from its DRM fd. | |
| std::string | platf::last_vaapi_encode_gpu () |
| The GPU the last VAAPI encoder opened, described as encode_gpu_description() does, or an empty string. | |
| std::vector< std::string > | platf::render_node_descriptions () |
| Describe every GPU render node, as encode_gpu_description() does, the capture-only Hermes-KMS node included and marked as such. | |
Choosing the GPU a stream is encoded on.
Definition in file encode_gpu.cpp.
| std::string platf::encode_gpu_description | ( | bool | nvenc = false | ) |
Describe the GPU a stream encodes on, for logs and diagnostics: its render node, driver and the name it is sold under, or its PCI id.
| nvenc | Whether the stream encodes with NVENC rather than VAAPI. |
Definition at line 266 of file encode_gpu.cpp.
| std::string platf::last_vaapi_encode_gpu | ( | ) |
The GPU the last VAAPI encoder opened, described as encode_gpu_description() does, or an empty string.
Definition at line 294 of file encode_gpu.cpp.
| void platf::note_vaapi_encode_gpu | ( | int | fd | ) |
Record the GPU a VAAPI encoder actually opened, from its DRM fd.
KMS capture hands the encoder the render node of the GPU the captured display is on, which need not be the one adapter_name names. A negative fd forgets the last one.
Definition at line 282 of file encode_gpu.cpp.
| int platf::open_encode_render_node | ( | bool | nvenc = false | ) |
Open the render node of the best GPU to encode a stream on.
adapter_name when it is set. Otherwise every real GPU is ranked by the video it can encode - AV1, then HEVC Main10, HEVC, H.264 - with more video memory breaking a tie, and the best one wins; for NVENC an NVIDIA GPU comes first. The capture-only Hermes-KMS node never qualifies.
| nvenc | Whether the stream encodes with NVENC rather than VAAPI. |
Definition at line 80 of file encode_gpu.cpp.
| std::vector< std::string > platf::render_node_descriptions | ( | ) |
Describe every GPU render node, as encode_gpu_description() does, the capture-only Hermes-KMS node included and marked as such.
Definition at line 313 of file encode_gpu.cpp.