1 #ifndef MPLAYER_OPTIONS_H
2 #define MPLAYER_OPTIONS_H
3 
4 #include <stdbool.h>
5 #include <stdint.h>
6 #include "m_option.h"
7 #include "common/common.h"
8 
9 typedef struct mp_vo_opts {
10     struct m_obj_settings *video_driver_list;
11 
12     int taskbar_progress;
13     int snap_window;
14     int ontop;
15     int ontop_level;
16     bool fullscreen;
17     int border;
18     int fit_border;
19     int all_workspaces;
20     int window_minimized;
21     int window_maximized;
22     bool focus_on_open;
23 
24     int screen_id;
25     char *screen_name;
26     int fsscreen_id;
27     char *fsscreen_name;
28     char *winname;
29     char *appid;
30     int x11_netwm;
31     int x11_bypass_compositor;
32     int native_keyrepeat;
33 
34     float panscan;
35     float zoom;
36     float pan_x, pan_y;
37     float align_x, align_y;
38     float scale_x, scale_y;
39     float margin_x[2];
40     float margin_y[2];
41     int unscaled;
42 
43     struct m_geometry geometry;
44     struct m_geometry autofit;
45     struct m_geometry autofit_larger;
46     struct m_geometry autofit_smaller;
47     double window_scale;
48 
49     int keepaspect;
50     int keepaspect_window;
51     int hidpi_window_scale;
52     int native_fs;
53 
54     int64_t WinID;
55 
56     float force_monitor_aspect;
57     float monitor_pixel_aspect;
58     int force_window_position;
59 
60     char *mmcss_profile;
61 
62     double override_display_fps;
63     double timing_offset;
64 
65     // vo_drm
66     struct drm_opts *drm_opts;
67 
68     struct m_geometry android_surface_size;
69 
70     int swapchain_depth;  // max number of images to render ahead
71 } mp_vo_opts;
72 
73 // Subtitle options needed by the subtitle decoders/renderers.
74 struct mp_subtitle_opts {
75     int sub_visibility;
76     int sec_sub_visibility;
77     int sub_pos;
78     float sub_delay;
79     float sub_fps;
80     float sub_speed;
81     int forced_subs_only;
82     int forced_subs_only_current;
83     int stretch_dvd_subs;
84     int stretch_image_subs;
85     int image_subs_video_res;
86     int sub_fix_timing;
87     int sub_scale_by_window;
88     int sub_scale_with_window;
89     int ass_scale_with_window;
90     struct osd_style_opts *sub_style;
91     float sub_scale;
92     float sub_gauss;
93     int sub_gray;
94     int ass_enabled;
95     float ass_line_spacing;
96     int ass_use_margins;
97     int sub_use_margins;
98     int ass_vsfilter_aspect_compat;
99     int ass_vsfilter_color_compat;
100     int ass_vsfilter_blur_compat;
101     int use_embedded_fonts;
102     char **ass_force_style_list;
103     char *ass_styles_file;
104     int ass_style_override;
105     int ass_hinting;
106     int ass_shaper;
107     int ass_justify;
108     int sub_clear_on_seek;
109     int teletext_page;
110     int sub_past_video_end;
111 };
112 
113 struct mp_sub_filter_opts {
114     int sub_filter_SDH;
115     int sub_filter_SDH_harder;
116     int rf_enable;
117     int rf_plain;
118     char **rf_items;
119     char **jsre_items;
120     int rf_warn;
121 };
122 
123 struct mp_osd_render_opts {
124     float osd_bar_align_x;
125     float osd_bar_align_y;
126     float osd_bar_w;
127     float osd_bar_h;
128     float osd_scale;
129     int osd_scale_by_window;
130     struct osd_style_opts *osd_style;
131     int force_rgba_osd;
132 };
133 
134 typedef struct MPOpts {
135     int property_print_help;
136     int use_terminal;
137     char *dump_stats;
138     int verbose;
139     int msg_really_quiet;
140     char **msg_levels;
141     int msg_color;
142     int msg_module;
143     int msg_time;
144     char *log_file;
145 
146     char *test_mode;
147     int operation_mode;
148 
149     char **reset_options;
150     char **script_files;
151     char **script_opts;
152     int lua_load_osc;
153     int lua_load_ytdl;
154     char *lua_ytdl_format;
155     char **lua_ytdl_raw_options;
156     int lua_load_stats;
157     int lua_load_console;
158     int lua_load_auto_profiles;
159 
160     int auto_load_scripts;
161 
162     int audio_exclusive;
163     int ao_null_fallback;
164     int audio_stream_silence;
165     float audio_wait_open;
166     int force_vo;
167     float softvol_volume;
168     int rgain_mode;
169     float rgain_preamp;         // Set replaygain pre-amplification
170     int rgain_clip;             // Enable/disable clipping prevention
171     float rgain_fallback;
172     int softvol_mute;
173     float softvol_max;
174     int gapless_audio;
175 
176     mp_vo_opts *vo;
177     struct ao_opts *ao_opts;
178 
179     char *wintitle;
180     char *media_title;
181 
182     struct mp_csp_equalizer_opts *video_equalizer;
183 
184     int stop_screensaver;
185     int cursor_autohide_delay;
186     int cursor_autohide_fs;
187 
188     struct mp_subtitle_opts *subs_rend;
189     struct mp_sub_filter_opts *subs_filt;
190     struct mp_osd_render_opts *osd_rend;
191 
192     int osd_level;
193     int osd_duration;
194     int osd_fractions;
195     int osd_on_seek;
196     int video_osd;
197 
198     int untimed;
199     char *stream_dump;
200     char *record_file;
201     int stop_playback_on_init_failure;
202     int loop_times;
203     int loop_file;
204     int shuffle;
205     int ordered_chapters;
206     char *ordered_chapters_files;
207     int chapter_merge_threshold;
208     double chapter_seek_threshold;
209     char *chapter_file;
210     int merge_files;
211     int quiet;
212     int load_config;
213     char *force_configdir;
214     int use_filedir_conf;
215     int hls_bitrate;
216     int edition_id;
217     int initial_audio_sync;
218     int video_sync;
219     double sync_max_video_change;
220     double sync_max_audio_change;
221     int sync_max_factor;
222     int hr_seek;
223     float hr_seek_demuxer_offset;
224     int hr_seek_framedrop;
225     float audio_delay;
226     float default_max_pts_correction;
227     int autosync;
228     int frame_dropping;
229     int video_latency_hacks;
230     int term_osd;
231     int term_osd_bar;
232     char *term_osd_bar_chars;
233     char *term_title;
234     char *playing_msg;
235     char *osd_playing_msg;
236     char *status_msg;
237     char *osd_status_msg;
238     char *osd_msg[3];
239     int player_idle_mode;
240     int consolecontrols;
241     int playlist_pos;
242     struct m_rel_time play_start;
243     struct m_rel_time play_end;
244     struct m_rel_time play_length;
245     int play_dir;
246     int rebase_start_time;
247     int play_frames;
248     double ab_loop[2];
249     int ab_loop_count;
250     double step_sec;
251     int position_resume;
252     int position_check_mtime;
253     int position_save_on_quit;
254     int write_filename_in_watch_later_config;
255     int ignore_path_in_watch_later_config;
256     char *watch_later_directory;
257     char **watch_later_options;
258     int pause;
259     int keep_open;
260     int keep_open_pause;
261     double image_display_duration;
262     char *lavfi_complex;
263     int stream_id[2][STREAM_TYPE_COUNT];
264     char **stream_lang[STREAM_TYPE_COUNT];
265     int stream_auto_sel;
266     int subs_with_matching_audio;
267     int audio_display;
268     char **display_tags;
269 
270     char **audio_files;
271     char *demuxer_name;
272     int demuxer_thread;
273     double demux_termination_timeout;
274     int demuxer_cache_wait;
275     int prefetch_open;
276     char *audio_demuxer_name;
277     char *sub_demuxer_name;
278 
279     int cache_pause;
280     int cache_pause_initial;
281     float cache_pause_wait;
282 
283     struct image_writer_opts *screenshot_image_opts;
284     char *screenshot_template;
285     char *screenshot_directory;
286     bool screenshot_sw;
287 
288     int index_mode;
289 
290     struct m_channels audio_output_channels;
291     int audio_output_format;
292     int force_srate;
293     double playback_speed;
294     int pitch_correction;
295     struct m_obj_settings *vf_settings, *vf_defs;
296     struct m_obj_settings *af_settings, *af_defs;
297     struct filter_opts *filter_opts;
298     struct dec_wrapper_opts *dec_wrapper;
299     char **sub_name;
300     char **sub_paths;
301     char **audiofile_paths;
302     char **coverart_files;
303     char **external_files;
304     int autoload_files;
305     int sub_auto;
306     int audiofile_auto;
307     int coverart_auto;
308     int osd_bar_visible;
309 
310     int w32_priority;
311 
312     struct cdda_params *stream_cdda_opts;
313     struct dvb_params *stream_dvb_opts;
314     struct stream_lavf_params *stream_lavf_opts;
315 
316     char *cdrom_device;
317     char *bluray_device;
318 
319     double mf_fps;
320     char *mf_type;
321 
322     struct demux_rawaudio_opts *demux_rawaudio;
323     struct demux_rawvideo_opts *demux_rawvideo;
324     struct demux_lavf_opts *demux_lavf;
325     struct demux_mkv_opts *demux_mkv;
326     struct demux_cue_opts *demux_cue;
327 
328     struct demux_opts *demux_opts;
329     struct demux_cache_opts *demux_cache_opts;
330     struct stream_opts *stream_opts;
331 
332     struct vd_lavc_params *vd_lavc_params;
333     struct ad_lavc_params *ad_lavc_params;
334 
335     struct input_opts *input_opts;
336 
337     // may be NULL if encoding is not compiled-in
338     struct encode_opts *encode_opts;
339 
340     char *ipc_path;
341     char *ipc_client;
342 
343     int wingl_dwm_flush;
344 
345     struct mp_resample_opts *resample_opts;
346 
347     struct gl_video_opts *gl_video_opts;
348     struct angle_opts *angle_opts;
349     struct opengl_opts *opengl_opts;
350     struct vulkan_opts *vulkan_opts;
351     struct vulkan_display_opts *vulkan_display_opts;
352     struct spirv_opts *spirv_opts;
353     struct d3d11_opts *d3d11_opts;
354     struct d3d11va_opts *d3d11va_opts;
355     struct cocoa_opts *cocoa_opts;
356     struct macos_opts *macos_opts;
357     struct wayland_opts *wayland_opts;
358     struct dvd_opts *dvd_opts;
359     struct vaapi_opts *vaapi_opts;
360     struct sws_opts *sws_opts;
361     struct zimg_opts *zimg_opts;
362 
363     int cuda_device;
364 } MPOpts;
365 
366 struct dvd_opts {
367     int angle;
368     int speed;
369     char *device;
370 };
371 
372 struct filter_opts {
373     int deinterlace;
374 };
375 
376 extern const struct m_sub_options vo_sub_opts;
377 extern const struct m_sub_options dvd_conf;
378 extern const struct m_sub_options mp_subtitle_sub_opts;
379 extern const struct m_sub_options mp_sub_filter_opts;
380 extern const struct m_sub_options mp_osd_render_sub_opts;
381 extern const struct m_sub_options filter_conf;
382 extern const struct m_sub_options resample_conf;
383 extern const struct m_sub_options stream_conf;
384 extern const struct m_sub_options dec_wrapper_conf;
385 extern const struct m_sub_options mp_opt_root;
386 
387 #endif
388