aboutsummaryrefslogtreecommitdiff
path: root/include/GsrInfo.hpp
blob: 6ec8e23a4dffbaf21faf9545a30cba1aa88b1cdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#pragma once

#include <string>
#include <vector>

#include <mglpp/system/vec.hpp>

namespace gsr {
    struct SupportedVideoCodecs {
        bool h264 = false;
        bool h264_software = false;
        bool hevc = false;
        bool hevc_hdr = false;
        bool hevc_10bit = false;
        bool av1 = false;
        bool av1_hdr = false;
        bool av1_10bit = false;
        bool vp8 = false;
        bool vp9 = false;
    };

    struct GsrMonitor {
        std::string name;
        mgl::vec2i size;
    };

    struct SupportedCaptureOptions {
        bool window = false;
        bool focused = false;
        bool screen = false;
        bool portal = false;
        std::vector<GsrMonitor> monitors;
    };

    enum class DisplayServer {
        UNKNOWN,
        X11,
        WAYLAND
    };

    struct SystemInfo {
        DisplayServer display_server = DisplayServer::UNKNOWN;
        bool supports_app_audio = false;
    };

    enum class GpuVendor {
        UNKNOWN,
        AMD,
        INTEL,
        NVIDIA
    };

    struct GpuInfo {
        GpuVendor vendor = GpuVendor::UNKNOWN;
        std::string card_path;
    };

    struct GsrInfo {
        SystemInfo system_info;
        GpuInfo gpu_info;
        SupportedVideoCodecs supported_video_codecs;
    };

    enum class GsrInfoExitStatus {
        OK,
        BROKEN_DRIVERS,
        FAILED_TO_RUN_COMMAND,
        OPENGL_FAILED,
        NO_DRM_CARD
    };

    struct AudioDevice {
        std::string name;
        std::string description;
    };

    GsrInfoExitStatus get_gpu_screen_recorder_info(GsrInfo *gsr_info);

    std::vector<AudioDevice> get_audio_devices();
    std::vector<std::string> get_application_audio();
    SupportedCaptureOptions get_supported_capture_options(const GsrInfo &gsr_info);
}