From 2b0c620b22a85d73f2b39049ed92d9300ff194d9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 15 Sep 2016 13:45:23 +0200 Subject: player: move builtin profiles to a separate file Move the embedded string with the builtin profiles to a separate builtin.conf file. This makes it easier to read and edit, and you can also check it for errors with --include=etc/builtin.conf. (Normally errors are hidden intentionally, because there's no way to output error messages this early, and because some options might not be present on all platforms or with all configurations.) --- .gitignore | 1 + etc/builtin.conf | 40 ++++++++++++++++++++++++++++++++++++++++ options/options.c | 2 ++ player/main.c | 54 ++++-------------------------------------------------- wscript_build.py | 4 ++++ 5 files changed, 51 insertions(+), 50 deletions(-) create mode 100644 etc/builtin.conf diff --git a/.gitignore b/.gitignore index 159e409d7d..81ef5cc7e1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /demux/ebml_types.h /sub/osd_font.h /player/lua/*.inc +/player/builtin_conf.inc /DOCS/man/mpv.1 /DOCS/man/mpv.aux /DOCS/man/mpv.log diff --git a/etc/builtin.conf b/etc/builtin.conf new file mode 100644 index 0000000000..08e00ef5d6 --- /dev/null +++ b/etc/builtin.conf @@ -0,0 +1,40 @@ +[pseudo-gui] +terminal=no +force-window=yes +idle=once +screenshot-directory=~~desktop/ + +[libmpv] +config=no +idle=yes +terminal=no +input-terminal=no +osc=no +ytdl=no +input-default-bindings=no +input-vo-keyboard=no +input-lirc=no +input-appleremote=no +input-media-keys=no +input-app-events=no +stop-playback-on-init-failure=yes + +[encoding] +vo=lavc +ao=lavc +keep-open=no +force-window=no +gapless-audio=yes +resume-playback=no +load-scripts=no +osc=no +framedrop=no + +[opengl-hq] +scale=spline36 +cscale=spline36 +dscale=mitchell +dither-depth=auto +correct-downscaling=yes +sigmoid-upscaling=yes +deband=yes diff --git a/options/options.c b/options/options.c index 509d738eb0..e4c334b45b 100644 --- a/options/options.c +++ b/options/options.c @@ -210,6 +210,7 @@ const struct m_sub_options vo_sub_opts = { .window_scale = 1.0, .x11_bypass_compositor = 2, .mmcss_profile = "Playback", + .fullscreen = HAVE_RPI ? 1 : 0, }, }; @@ -865,6 +866,7 @@ const struct MPOpts mp_default_opts = { .sub_fix_timing = 1, .screenshot_template = "mpv-shot%n", + .hwdec_api = HAVE_RPI ? HWDEC_RPI : 0, .hwdec_codecs = "h264,vc1,wmv3,hevc,mpeg2video,vp9", .videotoolbox_format = IMGFMT_NV12, diff --git a/player/main.c b/player/main.c index 8beb4f8b9a..b3a08082d8 100644 --- a/player/main.c +++ b/player/main.c @@ -62,6 +62,10 @@ #include "command.h" #include "screenshot.h" +static const char def_config[] = +#include "player/builtin_conf.inc" +; + #ifdef _WIN32 #include #endif @@ -99,56 +103,6 @@ const char mp_help_text[] = " --h= print options which match the given shell pattern\n" "\n"; -static const char def_config[] = -#if HAVE_RPI - "hwdec=rpi\n" - "fullscreen=yes\n" -#endif - "\n" - "[pseudo-gui]\n" - "terminal=no\n" - "force-window=yes\n" - "idle=once\n" - "screenshot-directory=~~desktop/\n" - "\n" - "[libmpv]\n" - "config=no\n" - "idle=yes\n" - "terminal=no\n" - "input-terminal=no\n" - "osc=no\n" - "ytdl=no\n" - "input-default-bindings=no\n" - "input-vo-keyboard=no\n" - "input-lirc=no\n" - "input-appleremote=no\n" - "input-media-keys=no\n" - "input-app-events=no\n" - "stop-playback-on-init-failure=yes\n" -#if HAVE_ENCODING - "\n" - "[encoding]\n" - "vo=lavc\n" - "ao=lavc\n" - "keep-open=no\n" - "force-window=no\n" - "gapless-audio=yes\n" - "resume-playback=no\n" - "load-scripts=no\n" - "osc=no\n" - "framedrop=no\n" -#endif - "\n" - "[opengl-hq]\n" - "scale=spline36\n" - "cscale=spline36\n" - "dscale=mitchell\n" - "dither-depth=auto\n" - "correct-downscaling=yes\n" - "sigmoid-upscaling=yes\n" - "deband=yes\n" -; - static pthread_mutex_t terminal_owner_lock = PTHREAD_MUTEX_INITIALIZER; static struct MPContext *terminal_owner; diff --git a/wscript_build.py b/wscript_build.py index c9960252fa..46f9882447 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -63,6 +63,10 @@ def build(ctx): source = "etc/input.conf", target = "input/input_conf.h") + ctx.file2string( + source = "etc/builtin.conf", + target = "player/builtin_conf.inc") + ctx.file2string( source = "sub/osd_font.otf", target = "sub/osd_font.h") -- cgit v1.2.3