diff options
81 files changed, 9551 insertions, 2886 deletions
diff --git a/.gitignore b/.gitignore index fd301449c2..c68c0fe2c4 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ /TAGS /locale /po +/libvo/vo_gl3_shaders.h /libmpdemux/ebml_defs.c /libmpdemux/ebml_types.h /libvo/vdpau_template.c diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 3575fb22a6..0e1ff45516 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3894,6 +3894,9 @@ Select the scaling function to use for chrominance scaling. For details see lscale. .IPs filter-strength=<value> Set the effect strength for the lscale/cscale filters that support it. +.IPs noise-strength=<value> +Set how much noise to add. 0 to disable (default), 1.0 for level suitable +for dithering to 6 bit. .IPs stereo=<value> Select a method for stereo display. You may have to use \-aspect to fix the aspect value. @@ -369,6 +369,7 @@ SRCS_COMMON = asxparser.c \ libmpdemux/demux_avi.c \ libmpdemux/demux_demuxers.c \ libmpdemux/demux_edl.c \ + libmpdemux/demux_cue.c \ libmpdemux/demux_film.c \ libmpdemux/demux_fli.c \ libmpdemux/demux_lavf.c \ @@ -403,6 +404,7 @@ SRCS_COMMON = asxparser.c \ libmpdemux/yuv4mpeg.c \ libmpdemux/yuv4mpeg_ratio.c \ libvo/osd.c \ + libvo/eosd_packer.c \ osdep/numcores.c \ osdep/io.c \ osdep/$(GETCH) \ @@ -427,6 +429,7 @@ SRCS_COMMON = asxparser.c \ sub/vobsub.c \ timeline/tl_edl.c \ timeline/tl_matroska.c \ + timeline/tl_cue.c \ $(SRCS_COMMON-yes) @@ -448,7 +451,7 @@ SRCS_MPLAYER-$(DXR3) += libvo/vo_dxr3.c SRCS_MPLAYER-$(FBDEV) += libvo/vo_fbdev.c libvo/vo_fbdev2.c SRCS_MPLAYER-$(GGI) += libvo/vo_ggi.c SRCS_MPLAYER-$(GIF) += libvo/vo_gif89a.c -SRCS_MPLAYER-$(GL) += libvo/gl_common.c libvo/vo_gl.c \ +SRCS_MPLAYER-$(GL) += libvo/gl_common.c libvo/vo_gl.c libvo/vo_gl3.c \ pnm_loader.c SRCS_MPLAYER-$(GL_SDL) += libvo/sdl_common.c SRCS_MPLAYER-$(GL_WIN32) += libvo/w32_common.c @@ -503,6 +506,7 @@ SRCS_MPLAYER = command.c \ libao2/audio_out.c \ libvo/aspect.c \ libvo/csputils.c \ + libvo/filter_kernels.c \ libvo/geometry.c \ libvo/old_vo_wrapper.c \ libvo/spuenc.c \ @@ -604,6 +608,11 @@ libmpdemux/ebml_types.h: TOOLS/matroska.py libmpdemux/ebml_defs.c: TOOLS/matroska.py ./$< --generate-definitions > $@ +libvo/vo_gl3_shaders.h: libvo/vo_gl3_shaders.glsl + python ./bin_to_header.py $^ $@ + +libvo/vo_gl3.c: libvo/vo_gl3_shaders.h + # ./configure must be rerun if it changed config.mak: configure @echo "############################################################" diff --git a/bin_to_header.py b/bin_to_header.py new file mode 100644 index 0000000000..137a5b3728 --- /dev/null +++ b/bin_to_header.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +# Script to embed arbitrary binary files in C header files. + +CHARS_PER_LINE = 19 + +import sys +import os + +if len(sys.argv) != 3: + print("Embed binary files in C headers.") + print("Usage: ") + print(" bin_to_header.py infile outfile.h") + print("outfile.h will be overwritten with the new contents.") + sys.exit(1) + +infile_name = sys.argv[1] +outfile_name = sys.argv[2] + +varname = os.path.splitext(os.path.basename(outfile_name))[0] + +infile = open(infile_name, "rb") +outfile = open(outfile_name, "w") + +outfile.write("// Generated with " + " ".join(sys.argv) + "\n") +outfile.write("\nstatic const unsigned char " + varname + "[] = {\n") + +while True: + data = infile.read(CHARS_PER_LINE) + if len(data) == 0: + break + outfile.write(" ") + for c in data: + # make it work both in Python 2.x (c is str) and 3.x (c is int) + if type(c) != int: + c = ord(c) + outfile.write("{0:3},".format(c)) + outfile.write("\n") + +outfile.write("};\n") + +infile.close() +outfile.close() @@ -195,6 +195,16 @@ struct bstr bstr_getline(struct bstr str, struct bstr *rest) return bstr_splice(str, 0, pos + 1); } +struct bstr bstr_strip_linebreaks(struct bstr str) +{ + if (bstr_endswith0(str, "\r\n")) { + str = bstr_splice(str, 0, str.len - 2); + } else if (bstr_endswith0(str, "\n")) { + str = bstr_splice(str, 0, str.len - 1); + } + return str; +} + bool bstr_eatstart(struct bstr *s, struct bstr prefix) { if (!bstr_startswith(*s, prefix)) @@ -251,3 +261,31 @@ int bstr_decode_utf8(struct bstr s, struct bstr *out_next) *out_next = s; return codepoint; } + +bool bstr_case_startswith(struct bstr s, struct bstr prefix) +{ + struct bstr start = bstr_splice(s, 0, prefix.len); + return start.len == prefix.len && bstrcasecmp(start, prefix) == 0; +} + +bool bstr_case_endswith(struct bstr s, struct bstr suffix) +{ + struct bstr end = bstr_cut(s, -suffix.len); + return end.len == suffix.len && bstrcasecmp(end, suffix) == 0; +} + +struct bstr bstr_strip_ext(struct bstr str) +{ + int dotpos = bstrrchr(str, '.'); + if (dotpos < 0) + return str; + return (struct bstr){str.start, dotpos}; +} + +struct bstr bstr_get_ext(struct bstr s) +{ + int dotpos = bstrrchr(s, '.'); + if (dotpos < 0) + return (struct bstr){NULL, 0}; + return bstr_splice(s, dotpos + 1, s.len); +} @@ -64,7 +64,6 @@ int bstrcspn(struct bstr str, const char *reject); int bstr_find(struct bstr haystack, struct bstr needle); struct bstr *bstr_splitlines(void *talloc_ctx, struct bstr str); -struct bstr bstr_getline(struct bstr str, struct bstr *rest); struct bstr bstr_lstrip(struct bstr str); struct bstr bstr_strip(struct bstr str); struct bstr bstr_split(struct bstr str, const char *sep, struct bstr *rest); @@ -87,11 +86,30 @@ int bstr_decode_utf8(struct bstr str, struct bstr *out_next); // On error, -1 is returned. On success, it returns a value in the range [1, 4]. int bstr_parse_utf8_code_length(unsigned char b); +// Return the text before the next line break, and return it. Change *rest to +// point to the text following this line break. (rest can be NULL.) +// Line break characters are not stripped. +struct bstr bstr_getline(struct bstr str, struct bstr *rest); + +// Strip one trailing line break. This is intended for use with bstr_getline, +// and will remove the trailing \n or \r\n sequence. +struct bstr bstr_strip_linebreaks(struct bstr str); + // If s starts with prefix, return true and return the rest of the string in s. bool bstr_eatstart(struct bstr *s, struct bstr prefix); +bool bstr_case_startswith(struct bstr s, struct bstr prefix); +bool bstr_case_endswith(struct bstr s, struct bstr suffix); +struct bstr bstr_strip_ext(struct bstr str); +struct bstr bstr_get_ext(struct bstr s); + static inline struct bstr bstr_cut(struct bstr str, int n) { + if (n < 0) { + n += str.len; + if (n < 0) + n = 0; + } if (n > str.len) n = str.len; return (struct bstr){str.start + n, str.len - n}; diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 5440de9946..6044b86645 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -486,6 +486,9 @@ const m_option_t common_opts[] = { {"sb", &seek_to_byte, CONF_TYPE_POSITION, CONF_MIN, 0, 0, NULL}, OPT_TIME("ss", seek_to_sec, 0), + // start paused + OPT_FLAG_ON("pause", start_paused, 0), + // stop at given position {"endpos", &end_at, CONF_TYPE_TIME_SIZE, 0, 0, 0, NULL}, @@ -911,7 +914,15 @@ const m_option_t mplayer_opts[]={ OPT_STRING("rtc-device", rtc_device, 0), #endif - OPT_MAKE_FLAGS("term-osd", term_osd, 0), + OPT_CHOICE("term-osd", term_osd, M_OPT_IMPLICIT_DEFAULT, + ({"force", 1}, + {"auto", 2}, + {"off", 0})), + + // set term_osd to 0 + // this is for compatibility + {"noterm-osd", NULL, &m_option_type_flag, 0, 1, 0, NULL, 1, offsetof(struct MPOpts, term_osd)}, + OPT_STRING("term-osd-esc", term_osd_esc, 0, OPTDEF_STR("\x1b[A\r\x1b[K")), OPT_STRING("playing-msg", playing_msg, 0), @@ -928,6 +939,11 @@ const m_option_t mplayer_opts[]={ {"tvscan", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, #endif /* CONFIG_TV */ + OPT_INTRANGE("screenshot-jpeg-quality", screenshot_jpeg_quality, 0, 0, 100), + OPT_INTRANGE("screenshot-png-compression", screenshot_png_compression, 0, 0, 9), + OPT_STRING("screenshot-filetype", screenshot_filetype, 0), + OPT_STRING("screenshot-template", screenshot_template, 0), + OPT_FLAG_ON("list-properties", list_properties, CONF_GLOBAL), {"identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_FLAG, CONF_GLOBAL, 0, MSGL_V, NULL}, {"help", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, diff --git a/codec-cfg.c b/codec-cfg.c index 0c25e73901..83d9f9e606 100644 --- a/codec-cfg.c +++ b/codec-cfg.c @@ -197,6 +197,7 @@ static const struct { {"BGR32", IMGFMT_BGR32}, {"RGB1", IMGFMT_RGB1}, {"BGR1", IMGFMT_BGR1}, + {"GBRP", IMGFMT_GBRP}, {"MPES", IMGFMT_MPEGPES}, @@ -21,6 +21,7 @@ #include <unistd.h> #include <string.h> #include <stdbool.h> +#include <assert.h> #include "config.h" #include "talloc.h" @@ -2783,6 +2784,28 @@ static void remove_subtitle_range(MPContext *mpctx, int start, int count) } } +static void do_clear_pt(struct play_tree *node, struct play_tree *exclude) +{ + while (node) { + do_clear_pt(node->child, exclude); + struct play_tree *next = node->next; + // do not delete root node, or nodes that could lead to "exclude" node + if (node->parent && !node->child && node != exclude) + play_tree_remove(node, 1, 1); + node = next; + } +} + +static void clear_play_tree(MPContext *mpctx) +{ + struct play_tree *exclude = NULL; + if (mpctx->playtree_iter) { + assert(mpctx->playtree == mpctx->playtree_iter->root); + exclude = mpctx->playtree_iter->tree; + } + do_clear_pt(mpctx->playtree, exclude); +} + void run_command(MPContext *mpctx, mp_cmd_t *cmd) { struct MPOpts *opts = &mpctx->opts; @@ -3112,6 +3135,10 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) break; } + case MP_CMD_PLAY_TREE_CLEAR: + clear_play_tree(mpctx); + break; + case MP_CMD_STOP: // Go back to the starting point. while (play_tree_iter_up_step(mpctx->playtree_iter, 0, 1) != @@ -336,6 +336,7 @@ Optional features: --enable-smb enable Samba (SMB) input [autodetect] --enable-live enable LIVE555 Streaming Media [disable] --enable-nemesi enable Nemesi Streaming Media [autodetect] + --enable-lcms2 enable LCMS2 support [autodetect] --disable-vcd disable VCD support [autodetect] --disable-bluray disable Blu-ray support [autodetect] --disable-dvdnav disable libdvdnav [autodetect] @@ -624,6 +625,7 @@ _xanim=auto _real=auto _live=no _nemesi=auto +_lcms2=auto _native_rtsp=yes _xinerama=auto _mga=auto @@ -965,6 +967,8 @@ for ac_option do --disable-live) _live=no ;; --enable-nemesi) _nemesi=yes ;; --disable-nemesi) _nemesi=no ;; + --enable-lcms2) _lcms2=yes ;; + --disable-lcms2) _lcms2=no ;; --enable-xinerama) _xinerama=yes ;; --disable-xinerama) _xinerama=no ;; --enable-mga) _mga=yes ;; @@ -5544,6 +5548,20 @@ else fi echores "$_qtx" +echocheck "LCMS2 support" +if test "$_lcms2" = auto ; then + _lcms2=no + if pkg_config_add lcms2 ; then + _lcms2=yes + fi +fi +if test "$_lcms2" = yes; then + def_lcms2="#define CONFIG_LCMS2 1" +else + def_lcms2="#undef CONFIG_LCMS2" +fi +echores "$_lcms2" |