summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--DOCS/man/en/mplayer.13
-rw-r--r--Makefile11
-rw-r--r--bin_to_header.py43
-rw-r--r--bstr.c38
-rw-r--r--bstr.h20
-rw-r--r--cfg-mplayer.h18
-rw-r--r--codec-cfg.c1
-rw-r--r--command.c27
-rwxr-xr-xconfigure21
-rw-r--r--defaultopts.c4
-rw-r--r--etc/input.conf2
-rw-r--r--fmt-conversion.c1
-rw-r--r--input/input.c68
-rw-r--r--input/input.h2
-rw-r--r--input/keycodes.h19
-rw-r--r--libao2/ao_dsound.c70
-rw-r--r--libao2/ao_openal.c30
-rw-r--r--libmpcodecs/img_format.c1
-rw-r--r--libmpcodecs/img_format.h2
-rw-r--r--libmpcodecs/mp_image.c7
-rw-r--r--libmpcodecs/mp_image.h2
-rw-r--r--libmpcodecs/vd.c6
-rw-r--r--libmpcodecs/vf.c2
-rw-r--r--libmpcodecs/vf_ass.c50
-rw-r--r--libmpcodecs/vf_gradfun.c56
-rw-r--r--libmpcodecs/vf_scale.c20
-rw-r--r--libmpcodecs/vf_scale.h1
-rw-r--r--libmpcodecs/vf_screenshot.c12
-rw-r--r--libmpcodecs/vf_vo.c44
-rw-r--r--libmpdemux/demux_cue.c65
-rw-r--r--libmpdemux/demux_lmlm4.c1
-rw-r--r--libmpdemux/demuxer.c29
-rw-r--r--libmpdemux/demuxer.h1
-rw-r--r--libvo/cocoa_common.h5
-rw-r--r--libvo/cocoa_common.m76
-rw-r--r--libvo/d3d_shader_yuv.h142
-rw-r--r--libvo/d3d_shader_yuv.hlsl44
-rw-r--r--libvo/d3d_shader_yuv_2ch.h170
-rw-r--r--libvo/eosd_packer.c254
-rw-r--r--libvo/eosd_packer.h71
-rw-r--r--libvo/filter_kernels.c279
-rw-r--r--libvo/filter_kernels.h45
-rw-r--r--libvo/gl_common.c860
-rw-r--r--libvo/gl_common.h342
-rw-r--r--libvo/gl_header_fixes.h231
-rw-r--r--libvo/mga_template.c2
-rw-r--r--libvo/video_out.c32
-rw-r--r--libvo/video_out.h1
-rw-r--r--libvo/vo_direct3d.c2157
-rw-r--r--libvo/vo_directfb2.c14
-rw-r--r--libvo/vo_directx.c1789
-rw-r--r--libvo/vo_gl.c348
-rw-r--r--libvo/vo_gl3.c2418
-rw-r--r--libvo/vo_gl3_shaders.glsl316
-rw-r--r--libvo/vo_png.c15
-rw-r--r--libvo/vo_svga.c4
-rw-r--r--libvo/vo_vdpau.c255
-rw-r--r--libvo/w32_common.c679
-rw-r--r--libvo/w32_common.h57
-rw-r--r--libvo/x11_common.c3
-rw-r--r--m_option.c24
-rw-r--r--m_option.h5
-rw-r--r--mp_core.h3
-rw-r--r--mp_msg.c2
-rw-r--r--mpcommon.c2
-rw-r--r--mplayer.c49
-rw-r--r--options.h6
-rw-r--r--osdep/getch2.c27
-rw-r--r--osdep/io.c25
-rw-r--r--osdep/io.h2
-rw-r--r--osdep/mplayer.rc6
-rw-r--r--playtree.c54
-rw-r--r--screenshot.c431
-rw-r--r--screenshot.h3
-rw-r--r--stream/stream_file.c9
-rw-r--r--sub/ass_mp.c3
-rw-r--r--sub/subreader.c10
-rw-r--r--timeline/tl_cue.c436
-rw-r--r--timeline/tl_matroska.c51
-rwxr-xr-xversion.sh2
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.
diff --git a/Makefile b/Makefile
index d1ce8dd532..ffec492a44 100644
--- a/Makefile
+++ b/Makefile
@@ -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()
diff --git a/bstr.c b/bstr.c
index bb407a10d8..036cf69d42 100644
--- a/bstr.c
+++ b/bstr.c
@@ -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);
+}
diff --git a/bstr.h b/bstr.h
index 09b1fda489..d3434cfa13 100644
--- a/bstr.h
+++ b/bstr.h
@@ -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},
diff --git a/command.c b/command.c
index d511e52c4a..a7446cb855 100644
--- a/command.c
+++ b/command.c
@@ -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) !=
diff --git a/configure b/configure
index 5c1e288c42..4fb2de3d8e 100755
--- a/configure
+++ b/configure
@@ -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"
+
echocheck "Nemesi Streaming Media libraries"
if test "$_nemesi" = auto && test "$networking" = yes ; then
_nemesi=no
@@ -6322,6 +6340,7 @@ LIBDV = $_libdv
LIBDVDCSS_INTERNAL = $_libdvdcss_internal
LIBMAD = $_mad
LIBNEMESI = $_nemesi
+LCMS2 = $_lcms2
LIBNUT = $_libnut
LIBPOSTPROC = $libpostproc
LIBSMBCLIENT = $_smb
@@ -6671,6 +6690,8 @@ $def_smb
$def_socklen_t
$def_vstream
+$def_lcms2
+
/* libvo options */
$def_3dfx
diff --git a/defaultopts.c b/defaultopts.c
index da19528838..d9485c24bf 100644
--- a/defaultopts.c
+++ b/defaultopts.c
@@ -31,13 +31,15 @@ void set_default_mplayer_options(struct MPOpts *opts)
.edition_id = -1,
.user_correct_pts = -1,
.initial_audio_sync = 1,
- .term_osd = 1,
+ .term_osd = 2,
.consolecontrols = 1,