diff options
Diffstat (limited to 'options/options.c')
-rw-r--r-- | options/options.c | 91 |
1 files changed, 69 insertions, 22 deletions
diff --git a/options/options.c b/options/options.c index 7c6ffa5..8640ecb 100644 --- a/options/options.c +++ b/options/options.c @@ -42,6 +42,7 @@ #include "input/event.h" #include "stream/stream.h" #include "video/csputils.h" +#include "video/filter/refqueue.h" #include "video/hwdec.h" #include "video/image_writer.h" #include "sub/osd.h" @@ -75,6 +76,7 @@ extern const struct m_sub_options input_config; extern const struct m_sub_options encode_config; extern const struct m_sub_options ra_ctx_conf; extern const struct m_sub_options gl_video_conf; +extern const struct m_sub_options gl_next_conf; extern const struct m_sub_options ao_alsa_conf; extern const struct m_sub_options demux_conf; @@ -111,7 +113,9 @@ static const m_option_t mp_vo_opt_list[] = { {"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list)}, {"taskbar-progress", OPT_BOOL(taskbar_progress)}, {"drag-and-drop", OPT_CHOICE(drag_and_drop, {"no", -2}, {"auto", -1}, - {"replace", DND_REPLACE}, {"append", DND_APPEND})}, + {"replace", DND_REPLACE}, + {"append", DND_APPEND}, + {"insert-next", DND_INSERT_NEXT})}, {"snap-window", OPT_BOOL(snap_window)}, {"ontop", OPT_BOOL(ontop)}, {"ontop-level", OPT_CHOICE(ontop_level, {"window", -1}, {"system", -2}, @@ -127,7 +131,8 @@ static const m_option_t mp_vo_opt_list[] = { {"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100)}, {"window-minimized", OPT_BOOL(window_minimized)}, {"window-maximized", OPT_BOOL(window_maximized)}, - {"focus-on-open", OPT_BOOL(focus_on_open)}, + {"focus-on-open", OPT_REMOVED("Replaced by --focus-on")}, + {"focus-on", OPT_CHOICE(focus_on, {"never", 0}, {"open", 1}, {"all", 2})}, {"force-render", OPT_BOOL(force_render)}, {"force-window-position", OPT_BOOL(force_window_position)}, {"x11-name", OPT_STRING(winname)}, @@ -236,7 +241,6 @@ const struct m_sub_options vo_sub_opts = { .auto_window_resize = true, .keepaspect = true, .keepaspect_window = true, - .hidpi_window_scale = true, .native_fs = true, .taskbar_progress = true, .border = true, @@ -251,7 +255,7 @@ const struct m_sub_options vo_sub_opts = { .ontop_level = -1, .timing_offset = 0.050, .swapchain_depth = 3, - .focus_on_open = true, + .focus_on = 1, }, }; @@ -262,6 +266,7 @@ const struct m_sub_options mp_sub_filter_opts = { .opts = (const struct m_option[]){ {"sub-filter-sdh", OPT_BOOL(sub_filter_SDH)}, {"sub-filter-sdh-harder", OPT_BOOL(sub_filter_SDH_harder)}, + {"sub-filter-sdh-enclosures", OPT_STRING(sub_filter_SDH_enclosures)}, {"sub-filter-regex-enable", OPT_BOOL(rf_enable)}, {"sub-filter-regex-plain", OPT_BOOL(rf_plain)}, {"sub-filter-regex", OPT_STRINGLIST(rf_items)}, @@ -271,6 +276,7 @@ const struct m_sub_options mp_sub_filter_opts = { }, .size = sizeof(OPT_BASE_STRUCT), .defaults = &(OPT_BASE_STRUCT){ + .sub_filter_SDH_enclosures = "([\uFF08", .rf_enable = true, }, .change_flags = UPDATE_SUB_FILT, @@ -281,18 +287,14 @@ const struct m_sub_options mp_sub_filter_opts = { const struct m_sub_options mp_subtitle_sub_opts = { .opts = (const struct m_option[]){ - {"sub-delay", OPT_FLOAT(sub_delay)}, {"sub-fps", OPT_FLOAT(sub_fps)}, {"sub-speed", OPT_FLOAT(sub_speed)}, - {"sub-visibility", OPT_BOOL(sub_visibility)}, - {"secondary-sub-visibility", OPT_BOOL(sec_sub_visibility)}, {"sub-forced-events-only", OPT_BOOL(sub_forced_events_only)}, {"stretch-dvd-subs", OPT_BOOL(stretch_dvd_subs)}, {"stretch-image-subs-to-screen", OPT_BOOL(stretch_image_subs)}, {"image-subs-video-resolution", OPT_BOOL(image_subs_video_res)}, {"sub-fix-timing", OPT_BOOL(sub_fix_timing)}, {"sub-stretch-durations", OPT_BOOL(sub_stretch_durations)}, - {"sub-pos", OPT_FLOAT(sub_pos), M_RANGE(0.0, 150.0)}, {"sub-gauss", OPT_FLOAT(sub_gauss), M_RANGE(0.0, 3.0)}, {"sub-gray", OPT_BOOL(sub_gray)}, {"sub-ass", OPT_BOOL(ass_enabled), .flags = UPDATE_SUB_HARD}, @@ -315,35 +317,29 @@ const struct m_sub_options mp_subtitle_sub_opts = { {"sub-ass-shaper", OPT_CHOICE(ass_shaper, {"simple", 0}, {"complex", 1})}, {"sub-ass-justify", OPT_BOOL(ass_justify)}, - {"sub-ass-override", OPT_CHOICE(ass_style_override, - {"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5}), - .flags = UPDATE_SUB_HARD}, {"sub-scale-by-window", OPT_BOOL(sub_scale_by_window)}, {"sub-scale-with-window", OPT_BOOL(sub_scale_with_window)}, {"sub-ass-scale-with-window", OPT_BOOL(ass_scale_with_window)}, {"sub", OPT_SUBSTRUCT(sub_style, sub_style_conf)}, {"sub-clear-on-seek", OPT_BOOL(sub_clear_on_seek)}, - {"teletext-page", OPT_INT(teletext_page), M_RANGE(1, 999)}, + {"teletext-page", OPT_INT(teletext_page), M_RANGE(-1, 999)}, {"sub-past-video-end", OPT_BOOL(sub_past_video_end)}, {"sub-ass-force-style", OPT_REPLACED("sub-ass-style-overrides")}, + {"sub-lavc-o", OPT_KEYVALUELIST(sub_avopts)}, {0} }, .size = sizeof(OPT_BASE_STRUCT), .defaults = &(OPT_BASE_STRUCT){ - .sub_visibility = true, - .sec_sub_visibility = true, - .sub_pos = 100, .sub_speed = 1.0, .ass_enabled = true, .sub_scale_by_window = true, .sub_use_margins = true, .sub_scale_with_window = true, - .teletext_page = 100, + .teletext_page = 0, .sub_scale = 1, .ass_vsfilter_aspect_compat = true, .ass_vsfilter_color_compat = 1, .ass_vsfilter_blur_compat = true, - .ass_style_override = 1, .ass_shaper = 1, .use_embedded_fonts = true, }, @@ -351,6 +347,36 @@ const struct m_sub_options mp_subtitle_sub_opts = { }; #undef OPT_BASE_STRUCT +#define OPT_BASE_STRUCT struct mp_subtitle_shared_opts + +const struct m_sub_options mp_subtitle_shared_sub_opts = { + .opts = (const struct m_option[]){ + {"sub-delay", OPT_FLOAT(sub_delay[0])}, + {"secondary-sub-delay", OPT_FLOAT(sub_delay[1])}, + {"sub-pos", OPT_FLOAT(sub_pos[0]), M_RANGE(0.0, 150.0)}, + {"secondary-sub-pos", OPT_FLOAT(sub_pos[1]), M_RANGE(0.0, 150.0)}, + {"sub-visibility", OPT_BOOL(sub_visibility[0])}, + {"secondary-sub-visibility", OPT_BOOL(sub_visibility[1])}, + {"sub-ass-override", OPT_CHOICE(ass_style_override[0], + {"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5}), + .flags = UPDATE_SUB_HARD}, + {"secondary-sub-ass-override", OPT_CHOICE(ass_style_override[1], + {"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5}), + .flags = UPDATE_SUB_HARD}, + {0} + }, + .size = sizeof(OPT_BASE_STRUCT), + .defaults = &(OPT_BASE_STRUCT){ + .sub_visibility[0] = true, + .sub_visibility[1] = true, + .sub_pos[0] = 100, + .ass_style_override[0] = 1, + .ass_style_override[1] = 5, + }, + .change_flags = UPDATE_OSD, +}; + +#undef OPT_BASE_STRUCT #define OPT_BASE_STRUCT struct mp_osd_render_opts const struct m_sub_options mp_osd_render_sub_opts = { @@ -359,6 +385,7 @@ const struct m_sub_options mp_osd_render_sub_opts = { {"osd-bar-align-y", OPT_FLOAT(osd_bar_align_y), M_RANGE(-1.0, +1.0)}, {"osd-bar-w", OPT_FLOAT(osd_bar_w), M_RANGE(1, 100)}, {"osd-bar-h", OPT_FLOAT(osd_bar_h), M_RANGE(0.1, 50)}, + {"osd-bar-border-size", OPT_FLOAT(osd_bar_border_size), M_RANGE(0, 1000.0)}, {"osd", OPT_SUBSTRUCT(osd_style, osd_style_conf)}, {"osd-scale", OPT_FLOAT(osd_scale), M_RANGE(0, 100)}, {"osd-scale-by-window", OPT_BOOL(osd_scale_by_window)}, @@ -370,6 +397,7 @@ const struct m_sub_options mp_osd_render_sub_opts = { .osd_bar_align_y = 0.5, .osd_bar_w = 75.0, .osd_bar_h = 3.125, + .osd_bar_border_size = 0.5, .osd_scale = 1, .osd_scale_by_window = true, }, @@ -412,10 +440,18 @@ const struct m_sub_options dvd_conf = { const struct m_sub_options filter_conf = { .opts = (const struct m_option[]){ - {"deinterlace", OPT_BOOL(deinterlace)}, + {"deinterlace", OPT_CHOICE(deinterlace, + {"no", 0}, {"yes", 1}, {"auto", -1})}, + {"deinterlace-field-parity", OPT_CHOICE(field_parity, + {"tff", MP_FIELD_PARITY_TFF}, + {"bff", MP_FIELD_PARITY_BFF}, + {"auto", MP_FIELD_PARITY_AUTO})}, {0} }, .size = sizeof(OPT_BASE_STRUCT), + .defaults = &(const struct filter_opts){ + .field_parity = MP_FIELD_PARITY_AUTO, + }, .change_flags = UPDATE_IMGPAR, }; @@ -562,7 +598,8 @@ static const m_option_t mp_opts[] = { {"slang", OPT_STRINGLIST(stream_lang[STREAM_SUB])}, {"vlang", OPT_STRINGLIST(stream_lang[STREAM_VIDEO])}, {"track-auto-selection", OPT_BOOL(stream_auto_sel)}, - {"subs-with-matching-audio", OPT_BOOL(subs_with_matching_audio)}, + {"subs-with-matching-audio", OPT_CHOICE(subs_with_matching_audio, {"no", 0}, + {"forced", 1}, {"yes", 2})}, {"subs-match-os-language", OPT_BOOL(subs_match_os_language)}, {"subs-fallback", OPT_CHOICE(subs_fallback, {"no", 0}, {"default", 1}, {"yes", 2})}, {"subs-fallback-forced", OPT_CHOICE(subs_fallback_forced, {"no", 0}, @@ -662,6 +699,7 @@ static const m_option_t mp_opts[] = { {"cover-art-whitelist", OPT_BOOL(coverart_whitelist)}, {"", OPT_SUBSTRUCT(subs_rend, mp_subtitle_sub_opts)}, + {"", OPT_SUBSTRUCT(subs_shared, mp_subtitle_shared_sub_opts)}, {"", OPT_SUBSTRUCT(subs_filt, mp_sub_filter_opts)}, {"", OPT_SUBSTRUCT(osd_rend, mp_osd_render_sub_opts)}, @@ -680,6 +718,10 @@ static const m_option_t mp_opts[] = { // values <0 for volume and mute are legacy and ignored {"volume", OPT_FLOAT(softvol_volume), .flags = UPDATE_VOL, M_RANGE(-1, 1000)}, + {"volume-gain-max", OPT_FLOAT(softvol_gain_max), M_RANGE(0, 150)}, + {"volume-gain-min", OPT_FLOAT(softvol_gain_min), M_RANGE(-150, 0)}, + {"volume-gain", OPT_FLOAT(softvol_gain), .flags = UPDATE_VOL, + M_RANGE(-150, 150)}, {"mute", OPT_CHOICE(softvol_mute, {"no", 0}, {"auto", 0}, @@ -794,7 +836,6 @@ static const m_option_t mp_opts[] = { {"term-osd-bar", OPT_BOOL(term_osd_bar), .flags = UPDATE_OSD}, {"term-osd-bar-chars", OPT_STRING(term_osd_bar_chars), .flags = UPDATE_OSD}, - {"term-remaining-playtime", OPT_BOOL(term_remaining_playtime), .flags = UPDATE_OSD}, {"term-title", OPT_STRING(term_title), .flags = UPDATE_OSD}, {"term-playing-msg", OPT_STRING(playing_msg)}, @@ -812,6 +853,7 @@ static const m_option_t mp_opts[] = { {"idle", OPT_CHOICE(player_idle_mode, {"no", 0}, {"once", 1}, {"yes", 2})}, + {"input-commands", OPT_STRINGLIST(input_commands)}, {"input-terminal", OPT_BOOL(consolecontrols), .flags = UPDATE_TERM}, {"input-ipc-server", OPT_STRING(ipc_path), .flags = M_OPT_FILE}, @@ -837,6 +879,7 @@ static const m_option_t mp_opts[] = { {"", OPT_SUBSTRUCT(ra_ctx_opts, ra_ctx_conf)}, {"", OPT_SUBSTRUCT(gl_video_opts, gl_video_conf)}, + {"", OPT_SUBSTRUCT(gl_next_opts, gl_next_conf)}, {"", OPT_SUBSTRUCT(spirv_opts, spirv_conf)}, #if HAVE_GL @@ -903,6 +946,9 @@ static const struct MPOpts mp_default_opts = { .msg_color = true, .softvol_max = 130, .softvol_volume = 100, + .softvol_gain_max = 12, + .softvol_gain_min = -96, + .softvol_gain = 0, .gapless_audio = -1, .wintitle = "${?media-title:${media-title}}${!media-title:No file} - mpv", .stop_screensaver = 1, @@ -946,7 +992,6 @@ static const struct MPOpts mp_default_opts = { .frame_dropping = 1, .term_osd = 2, .term_osd_bar_chars = "[-+-]", - .term_remaining_playtime = true, .consolecontrols = true, .playlist_pos = -1, .play_frames = -1, @@ -960,7 +1005,7 @@ static const struct MPOpts mp_default_opts = { [STREAM_VIDEO] = -2, [STREAM_SUB] = -2, }, }, .stream_auto_sel = true, - .subs_with_matching_audio = true, + .subs_with_matching_audio = 2, .subs_match_os_language = true, .subs_fallback = 1, .subs_fallback_forced = 1, @@ -1063,12 +1108,14 @@ static const struct MPOpts mp_default_opts = { "sub-delay", "sub-speed", "sub-pos", + "secondary-sub-pos", "sub-visibility", "sub-scale", "sub-use-margins", "sub-ass-force-margins", "sub-ass-vsfilter-aspect-compat", "sub-ass-override", + "secondary-sub-ass-override", "secondary-sub-visibility", "ab-loop-a", "ab-loop-b", |