]> git.sesse.net Git - nageru/blob - nageru/flags.h
IWYU-fix nageru/*.h.
[nageru] / nageru / flags.h
1 #ifndef _FLAGS_H
2 #define _FLAGS_H
3
4 #include <math.h>
5
6 #include <map>
7 #include <string>
8 #include <vector>
9
10 #include "defs.h"
11 #include "shared/shared_defs.h"
12 #include "ycbcr_interpretation.h"
13
14 struct Flags {
15         int width = 1280, height = 720;
16         int min_num_cards = 2;
17         int max_num_cards = MAX_VIDEO_CARDS;
18         std::string va_display;
19         bool fake_cards_audio = false;
20         bool x264_video_to_http = false;
21         bool x264_video_to_disk = false;  // Disables Quick Sync entirely. Implies x264_video_to_http == true.
22         bool x264_separate_disk_encode = false;  // Disables Quick Sync entirely. Implies x264_video_to_disk == true.
23         bool av1_video_to_http = false;
24         std::vector<std::string> theme_dirs { ".", PREFIX "/share/nageru" };
25         std::string recording_dir = ".";
26         std::string theme_filename = "theme.lua";
27         bool locut_enabled = true;
28         bool gain_staging_auto = true;
29         float initial_gain_staging_db = 0.0f;
30         bool compressor_enabled = true;
31         bool limiter_enabled = true;
32         bool final_makeup_gain_auto = true;
33         bool flush_pbos = true;
34         std::string stream_mux_name = DEFAULT_STREAM_MUX_NAME;
35         bool stream_coarse_timebase = false;
36         std::string stream_audio_codec_name;  // Blank = use the same as for the recording.
37         int stream_audio_codec_bitrate = DEFAULT_AUDIO_OUTPUT_BIT_RATE;  // Ignored if stream_audio_codec_name is blank.
38         std::string x264_preset;  // Empty will be overridden by X264_DEFAULT_PRESET, unless speedcontrol is set.
39         std::string x264_tune = X264_DEFAULT_TUNE;
40         bool x264_speedcontrol = false;
41         bool x264_speedcontrol_verbose = false;
42         int x264_bitrate = -1;  // In kilobit/sec. -1 = not set = DEFAULT_X264_OUTPUT_BIT_RATE.
43         float x264_crf = HUGE_VAL;  // From 51 - QP_MAX_SPEC to 51. HUGE_VAL = not set = use x264_bitrate instead.
44         std::vector<std::string> x264_extra_param;  // In “key[,value]” format.
45
46         int av1_preset = DEFAULT_AV1_PRESET;
47         int av1_bitrate = DEFAULT_AV1_OUTPUT_BIT_RATE;
48         int av1_fps_num = DEFAULT_AV1_FPS_NUM, av1_fps_den = DEFAULT_AV1_FPS_DEN;
49         std::vector<std::string> av1_extra_param;  // In “key[,value]” format.
50
51         std::string x264_separate_disk_preset;  // Empty will be overridden by X264_DEFAULT_PRESET, unless speedcontrol is set.
52         std::string x264_separate_disk_tune = X264_DEFAULT_TUNE;
53         int x264_separate_disk_bitrate = -1;
54         float x264_separate_disk_crf = HUGE_VAL;
55         std::vector<std::string> x264_separate_disk_extra_param;  // In “key[,value]” format.
56
57         std::string v4l_output_device;  // Empty if none.
58         bool enable_alsa_output = true;
59         std::map<int, int> default_stream_mapping;
60         bool multichannel_mapping_mode = false;  // Implicitly true if input_mapping_filename is nonempty.
61         std::string input_mapping_filename;  // Empty for none.
62         std::string midi_mapping_filename;  // Empty for none.
63         bool default_hdmi_input = false;
64         bool print_video_latency = false;
65         double audio_queue_length_ms = 100.0;
66         bool ycbcr_rec709_coefficients = false;  // Will be overridden by HDMI/SDI output if ycbcr_auto_coefficients == true.
67         bool ycbcr_auto_coefficients = true;
68         int output_card = -1;
69         double output_buffer_frames = 6.0;
70         double output_slop_frames = 0.5;
71         bool output_card_is_master = true;
72         int max_input_queue_frames = 6;
73         int http_port = DEFAULT_HTTPD_PORT;
74         int srt_port = DEFAULT_SRT_PORT;  // -1 for none.
75         bool enable_srt = true;  // UI toggle; not settable from the command line. See also srt_port.
76         bool display_timecode_in_stream = false;
77         bool display_timecode_on_stdout = false;
78         bool enable_quick_cut_keys = false;
79         int bit_depth = 8;  // 8 or 10. 10 implies x264_video_to_disk == true.
80         YCbCrInterpretation ycbcr_interpretation[MAX_VIDEO_CARDS];
81         bool transcode_video = true;  // Kaeru only.
82         bool transcode_audio = true;  // Kaeru only.
83         bool enable_audio = true;  // Kaeru only. If false, then transcode_audio is also false.
84         bool use_zerocopy = false;  // Not user-settable.
85         bool fullscreen = false;
86         std::map<unsigned, unsigned> card_to_mjpeg_stream_export;  // If a card is not in the map, it is not exported.
87         std::string srt_destination_host;
88         std::string srt_destination_port;
89         std::string srt_streamid;
90         std::string srt_passphrase;
91         int srt_output_latency_ms = DEFAULT_SRT_OUTPUT_LATENCY_MS;
92 };
93 extern Flags global_flags;
94
95 enum Program {
96         PROGRAM_NAGERU,
97         PROGRAM_KAERU
98 };
99 void usage(Program program);
100 void parse_flags(Program program, int argc, char * const argv[]);
101
102 #endif  // !defined(_FLAGS_H)