Commit Graph

1746 Commits

Author SHA1 Message Date
wm4 ce9a854d54 core: add playback resume feature (manual/opt-in)
A "watch later" command is now mapped to Shift+Q. This quits the player
and stores the playback state in a config file in ~/.mpv/watch_later/.
When calling the player with the same file again, playback is resumed
at that time position.

It's also possible to make mpv save playback state always on quit with
the --save-position-on-quit option. Likewise, resuming can be disabled
with the --no-resume-playback option.

This also attempts to save some playback parameters, like fullscreen
state or track selection. This will unconditionally override config
settings and command line options (which is probably not what you would
expect, but in general nobody will really care about this). Some things
are not backed up, because that would cause various problems. Additional
subtitle files, video filters, etc. are not stored because that would be
too hard and fragile. Volume/mute state are not stored because it would
mess up if the system mixer is used, or if the system mixer was
readjusted in the meantime.

Basically, the tradeoff between perfect state restoration and
complexity/fragility makes it not worth to attempt to implement
it perfectly, even if the result is a little bit inconsistent.
2013-05-05 20:08:11 +02:00
wm4 81a1d07b81 manpage: fix option description 2013-05-05 18:44:21 +02:00
wm4 012d297bb1 video: add --hwdec-codecs option to whitelist codecs for hw decoding 2013-05-04 01:38:27 +02:00
reimar daee1a04e7 stream_bluray: remove the broken -bluray-chapter option
Remove the broken -bluray-chapter option.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36175 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	DOCS/man/en/mplayer.1
	cfg-common.h
2013-04-27 15:28:57 +02:00
wm4 56efcc7b7f manpage: fix references to --slave 2013-04-26 20:44:18 +02:00
wm4 28a971e26f options: allow using [ ] for quoting in sub-options
This is an attempt to make quoting of sub-option values less awkward,
even if it works only with some shells. This is needed mainly for
vf_lavfi. Also update the vf_lavfi manpage section.
2013-04-26 20:44:18 +02:00
wm4 55262a4427 manpage: remove broken example
Weird video size presets have been removed.
2013-04-24 21:39:28 +02:00
wm4 4873c798b6 manpage: document --native-keyrepeat
Forgotten in commit d853aba.
2013-04-24 21:37:10 +02:00
wm4 ff549a2f6a core: add backstep support
Allows stepping back one frame via the frame_back_step inout command,
bound to "," by default.

This uses the precise seeking facility, and a perfect frame index built
on the fly. The index is built during playback and precise seeking, and
contains (as of this commit) the last 100 displayed or skipped frames.
This index is used to find the PTS of the previous frame, which is then
used as target for a precise seek. If no PTS is found, the core attempts
to do a seek before the current frame, and skip decoded frames until the
current frame is reached; this will create a sufficient index and the
normal backstep algorithm can be applied.

This can be rather slow. The worst case for backstepping is about the
same as the worst case for precise seeking if the previous frame can be
deduced from the index. If not, the worst case will be twice as slow.

There's also some minor danger that the index is incorrect in case
framedropping is involved. For framedropping due to --framedrop, this
problem is ignored (use of --framedrop is discouraged anyway). For
framedropping during precise seeking (done to make it faster), we try
to not add frames to the index that are produced when this can happen.
I'm not sure how well that works (or if the logic is sane), and it's
sure to break with some video filters. In the worst case, backstepping
might silently skip frames if you backstep after a user-initiated
precise seek. (Precise seeks to do indexing are not affected.)

Likewise, video filters that somehow change timing of frames and do not
do this in a deterministic way (i.e. if you seek to a position, frames
with different timings are produced than when the position is reached
during normal playback) will make backstepping silently jump to the
wrong frame. Enabling/disabling filters during playback (like for
example deinterlacing) will have similar bad effects.
2013-04-24 20:27:12 +02:00
wm4 d638a8eda8 manpage: remove references to --no-slices
Background: slice support has been completely removed, because it
doesn't work with multithreading, and provides a rather bad complexity
to performance tradeoff otherwise.
2013-04-23 14:16:06 +02:00
wm4 c8df1799d9 m_option: allow quoted positional parameters for -vf
This allows things like:

    '--vf=lavfi="gradfun=20:30"'

Adjust the documentation for vf_lavfi to make the example less verbose.
As an unrelated change, add a general description to vf_lavfi.
2013-04-23 14:10:43 +02:00
wm4 7979718159 vf_lavfi: add libavfilter bridge
Requires recent FFmpeg/Libav git versions. Earlier versions will not
be supported, as the API is different. (A libavfilter version that
uses AVFrame instead of AVFilterBuffer is needed.)

Note that this is sort of useless, because the option parser prevents
you from making use of the full libavfilter graph syntax. This has to be
fixed later.

Most of the filter creation code (half of the config() function) has
been taken from avplay.c.

This code is not based on MPlayer's vf_lavfi. The MPlayer code doesn't
compile as it hasn't been updated through multiple libavfilter API
changes, making it completely useless as a starting point.
2013-04-21 04:39:58 +02:00
wm4 6d66a547a4 manpage: clarify --cache behavior 2013-04-20 23:25:55 +02:00
Ellis Berner 4beedec44d Fix typo for opengl dither-depth default 2013-04-18 14:41:32 -07:00
wm4 df8a481eba sub: add --osd-blur and --sub-text-blur options
These require bleeding edge libass (latest git version), and will be
ignored otherwise.

I'm not sure about the blur factor and scaling. The ASS/VSFilter
semantics for blur scaling are a bad mess. Might require further
investigation.
2013-04-13 18:53:03 +02:00
wm4 a5916f5d1d core: remove dead --vsync leftovers 2013-04-12 14:36:26 +02:00
wm4 9df2260506 core: add --reset-on-next-file option
This option can be used to selectively reset settings when playing the
next file in the playlist (i.e. restore mplayer and mplayer2 behavior).

Might remove this option again should it turn out that nobody uses it.
2013-04-10 21:32:46 +02:00
wm4 4e55a6e828 Remove some apple remote leftovers
The options and key names don't do anything anymore.
2013-04-05 23:59:39 +02:00
wm4 75afa370b9 demux_mkv: try to show current subtitle when seeking
Makes sure that seeking to a given time position shows the subtitle at
that position. This can fail if the subtitle packet is not close enough
to the seek target. Always enabled for hr-seeks, and can be manually
enabled for normal seeks with --mkv-subtitle-preroll.

This helps displaying subtitles correctly with ordered chapters. When
switching ordered chapter segments, a seek is performed. If the subtitle
is timed slightly before the start of the segment, it normally won't be
demuxed. This is a problem with all seeks, but in this case normal
playback is affected. Since switching segments always uses hr-seeks,
the code added by this commit is always active in this situation.

If no subtitles are selected or the subtitles come from an external
file, the demuxer should behave exactly as before this commit.
2013-04-04 14:45:29 +02:00
wm4 ccc213fdac core: add --heartbeat-interval option
This closely follows MPlayer commit 36099, with some changes.

Move a mutable static variable into MPContext.
2013-04-04 14:24:42 +02:00
wm4 c80c6fa270 manpage: fix a typo 2013-03-31 22:00:56 +02:00
Stefano Pigozzi c8fd9e50e4 remove Apple Remote related code
The OSX part of the Apple Remote was unmaintained for a long time and was not
working anymore. I tried to update the cookies to what the current versions of
OS X expect without much luck. I decided to remove it since Apple is not
including the IR receiver anymore in new hardware and it's clear that wifi
based remotes are the way to go.

A third party iOS app should be used in it's place. In the future we could look
into having a dedicated iOS Remote Control app like VLC and XBMC do.

The Linux side (`appleir.c`) was relatively tidy but it looks like LIRC can be
configured to work with any version of Apple Remote [1] and is more maintained.

[1] LIRC Apple Remote configs: http://lirc.sourceforge.net/remotes/apple/
2013-03-31 12:15:40 +02:00
wm4 042ac56226 changes.rst: mention -afm hwac3 replacement 2013-03-30 20:27:12 +01:00
wm4 ef3c0e6eda osd: draw the OSD bar with ASS vector drawings
Drawing the bar with vector drawings (instead with characters from the
OSD font) offers more flexibility and looks better. This also adds
chapter marks to the OSD bar, which are visible as small triangles on
the top and bottom inner border of the bar.

Change the default position of the OSD bar below the center of the
screen. This is less annoying than putting the bar directly into the
center of the view, where it obscures the video. The new position is
not quite on the bottom of the screen to avoid collisions with
subtitles.

The old centered position can be forced with ``--osd-bar-align-y=0``.

Also make it possible to change the OSD bar width/height with the new
--osd-bar-w and --osd-bar-h options.

It's possible that the new OSD bar renders much slower than the old
one. There are two reasons for this: 1. the character based bar
allowed libass to cache each character, while the vector drawing forces
it to redraw every time the bar position changes. 2., the bar position
is updated at a much higher granularity (the bar position is passed
along as float instead of as integer in the range 0-100, so the bar
will be updated on every single video frame).
2013-03-30 20:23:45 +01:00
wm4 2585baa649 gl_video: use choice option type for dither-depth suboption
Replaces the numeric magic values -1 and 0 with "no" and "auto". The
numeric values are still allowed for compatibility.
2013-03-28 21:46:18 +01:00
wm4 a0e2f7113b gl_video: add some alpha FBO formats 2013-03-28 21:46:17 +01:00
wm4 8099cbe9dd vo_opengl: add alpha output
Allows playing video with alpha information on X11, as long as the video
contains alpha and the window manager does compositing. See vo.rst.

Whether a window can be transparent is decided by the choice of the X
Visual used for window creation. Unfortunately, there's no direct way to
request such a Visual through the GLX or the X API, and use of the
XRender extension is required to find out whether a Visual implies a
framebuffer with alpha used by XRender (see for example [1]). Instead of
depending on the XRender wrapper library (which would require annoying
configure checks, even though XRender is virtually always supported),
use a simple heuristics to find out whether a Visual has alpha. Since
getting it wrong just means an optional feature will not work as
expected, we consider this ok.

[1] http://stackoverflow.com/questions/4052940/how-to-make-an-opengl-
rendering-context-with-transparent-background/9215724#9215724
2013-03-28 21:46:17 +01:00
wm4 790df511c4 core: output --playing-msg message only after at least one frame is shown
This way it's possible to retrieve correct information about video, like
actual width/height, which in general are available only after at least
one frame has been sent to the video output, such as dwidth/dheight.

mpv_identify.sh becomes a bit slower, because we let it decode enough
audio and video to fill the audio buffers and to send one frame to the
video output. Also, --playing-msg isn't shown anymore with --frames=0
(could be fixed by special-casing it, should this break any use cases).

Note that in some corner cases, like when the demuxer for some reason
returns lots of audio packets but no video packets at the start, but
video actually starts later, the --playing-msg will still be output
before video starts.
2013-03-26 01:29:53 +01:00
wm4 54e8e0a502 mplayer: make --frames=1 work for audio
This has the same (useless) definition as frame stepping in audio-only
mode: one frame means one playloop iteration. (It's relatively useless,
because one playloop iteration has a random duration. But it makes
--frames=1 work, which is useful again.)
2013-03-26 01:29:53 +01:00
wm4 d080d1d39a command: export VO video width/height as properties
Add new properties "dwidth" and "dheight", which contain the video
size as known by the VO (not necessarily what the VO makes out of them,
i.e. without window scaling and panscan).
2013-03-26 01:29:53 +01:00
Stefano Pigozzi 048ceef655 af_lavrresample: add new resampling filter to replace the old ones
Remove `af_resample` and `af_lavcresample`. The former is a mess while the
latter uses an API that was long deprecated in libavcodec and is now removed.

`af_lavrresample` rougly has the same features and structure of
`af_lavcresample`.

libswresample fallback by wm4.
2013-03-13 23:51:30 +01:00
wm4 a1a9dc9c85 options: remove --no-vsync
Latest nvidia drivers ignore the application setting, so this switch
makes even less sense than before. It's still possible to control this
with VO specific suboptions.
2013-03-06 00:24:34 +01:00
wm4 6ef1a1cddd manpage: fix --no-dts typo 2013-03-04 22:20:54 +01:00
Wessel Dankers 879ebe0655 Add a --dtshd option
The spdif decoder was hardcoded to assume that the spdif output is
capable of accepting high (>1.5Mbps) bitrates. While this is true
for modern HDMI spdif interfaces, the original coax/toslink system
cannot deal with this and will fail to work.

This patch adds an option --dtshd which can be enabled if you use
a DTS-capable receiver behind a HDMI link.
2013-03-04 21:18:20 +01:00
Alexander Preisinger 6944f2e8bb wayland: fix typo in manpage 2013-03-02 12:17:56 +01:00
wm4 4722446805 input.conf: change default bindings of 5/6 from hue to gamma
I doubt anyone needs to adjust hue on a frequent basis, and gamma is
much more useful.

Suggestions for more radical changes of key bindings are welcome
(there's a lot of useless crap mapped).
2013-03-01 14:56:24 +01:00
wm4 d7af9b9bcd manpage: remove reference to subtitle alignment 2013-03-01 14:52:51 +01:00
wm4 d511ef79a0 core: simplify OSD capability handling, remove VFCAP_OSD
VFCAP_OSD was used to determine at runtime whether the VO supports OSD
rendering. This was mostly unused. vo_direct3d had an option to disable
OSD (was supposed to allow to force auto-insertion of vf_ass, but we
removed that anyway). vo_opengl_old could disable OSD rendering when a
very old OpenGL version was detected, and had an option to explicitly
disable it as well.

Remove VFCAP_OSD from everything (and some associated logic). Now the
vo_driver.draw_osd callback can be set to NULL to indicate missing OSD
support (important so that vo_null etc. don't single-step on OSD
redraw), and if OSD support depends on runtime support, the VO's
draw_osd should just do nothing if OSD is not available.

Also, do not access vo->want_redraw directly. Change the want_redraw
reset logic for this purpose, too. (Probably unneeded, vo_flip_page
resets it already.)
2013-03-01 11:16:01 +01:00
Alexander Preisinger bf9b9c3bd0 wayland: add wayland support
All wayland only specific routines are placed in wayland_common.
This makes it easier to write other video outputs.

The EGL specific parts, as well as opengl context creation, are in gl_common.

This backend works for:
    * opengl-old
    * opengl
    * opengl-hq

To use it just specify the opengl backend
    --vo=opengl:backend=wayland
or disable the x11 build.

Don't forget to set EGL_PLATFORM to wayland.

Co-Author: Scott Moreau
(Sorry I lost the old commit history due to the file structure changes)
2013-02-28 20:01:33 +01:00
wm4 70346d3be6 video/out: remove video mode switching (--vm)
This allowed making the player switch the monitor video mode when
creating the video window. This was a questionable feature, and with
today's LCD screens certainly not useful anymore. Switching to a random
video mode (going by video width/height) doesn't sound too useful
either.

I'm not sure about the win32 implementation, but the X part had several
bugs. Even in mplayer-svn (where x11_common.c hasn't been receiving any
larger changes for a long time), this code is buggy and doesn't do the
right thing anyway. (And what the hell _did_ it do when using multiple
physical monitors?)

If you really want this, write a shell script that calls xrandr before
and after calling mpv.

vo_sdl still can do mode switching, because SDL has native support for
it, and using it is trivial. Add a new sub-option for this.
2013-02-26 02:01:48 +01:00
wm4 b23dce6d7c x11_common: always create a window, even with --wid
The --wid switch (for embedding the player into other applications)
didn't create a new window, and instead tried to use the window that
was passed via --wid directly. This made the code more complex, caused
strange X errors (mpv and host application fighting for exclusive X
resources), and actually could cause issues if the --wid window wasn't
created with the X Visual needed for OpenGL.

Always create a window instead. This makes it always possible to embed
the player into foreign windows. --geometry doesn't work anymore - the
controlling application should always create a new window to place the
player inside it, and can control the video window by moving and
resizing this window.

w32_common.c actually did this right, and always creates a new window.
2013-02-26 02:01:48 +01:00
wm4 af54ff826b Remove --rootwin option and rootwin property
You can just use --wid=0 if you really want this.

This only worked/works for X11, and even then it might interact badly
with most desktop environments. All the option did was setting --wid to
0, and the property did nothing.
2013-02-24 17:00:52 +01:00
wm4 edddf81232 demux_rawvideo: allow setting video codec
Can be used to decode some obscure image formats and similar stuff.
2013-02-24 16:46:35 +01:00
wm4 2e1063d781 vf_yadif: switch to option parser, allow disabling by default
Use the option parser instead of sscanf. Remove the parameter changing
the field dominance (it has been marked deprecated for ages). Add a new
suboption "enabled", which can be used to disable the filter by default,
until it's enabled at runtime:

    mpv -vf yadif=enabled=no
2013-02-23 00:12:45 +01:00
wm4 bfaebd26ee vf_scale: remove video dimension presets ("presize" suboption)
This wasn't really useful, and the option preset mechanism is awfully
complex.
2013-02-23 00:07:11 +01:00
wm4 67df52ae73 demux_rawvideo: remove ancient video dimension presets
I can't see much value in them. Just specify the size manually.
2013-02-23 00:07:11 +01:00
wm4 9b7fb867f7 options: drop --opt:subopt option names
For all suboptions, "flat" options were available by separating the
parent option and the sub option with ":", e.g. "--rawvideo:w=123". Drop
this syntax and use "-" as separator. This means even suboptions are
available as normal options now, e.g. "--rawvideo-w=123". The old syntax
doesn't work anymore.

Note that this is completely separate from actual suboptions. For
example, "-rawvideo w=123:h=123" still works. (Not that this syntax is
worth supporting, but it's needed anyway, for for other things like vf
and vo suboptions.)

As a consequence of this change, we also have to add new "no-" prefixed
options for flag suboptions, so that "--no-input-default-bindings"
works. ("--input-no-default-bindings" also works as a consequence of
allowing "-input no-default-bindings" - they are handled by the same
underlying option.)

For --input, always use the full syntax in the manpage. There exist
suboptions other than --input (like --tv, --rawvideo, etc.), but since
they might be handled differently in the future, don't touch these yet.

M_OPT_PREFIXED becomes the default, so remove it. As a minor unrelated
cleanup, get rid of M_OPT_MERGE too and use the OPT_SUBSTRUCT() macro in
some places.

Unrelated: remove the duplicated --tv:buffersize option, fix a typo in
changes.rst.
2013-02-23 00:07:11 +01:00
Stefano Pigozzi e540e5d4da core: add fs-screen option for fullscreen display selection
`--fs-screen` allows to decide what display to go fullscreen into. The
semantics of `--screen` changed and now it is only used to select the windowed
display when starting the application.

This is useful for people using mpv with an external TV. They will start
windowed on their laptop's screen and switch to fullscreen on the TV.

@wm4 worked on the x11 and w32 parts of the code. All is squashed in one
commit for history clarity.
2013-02-21 22:23:08 +01:00
wm4 0bad744d68 options: parse C-style escapes for some options
Being able to insert newline characters ("\n") is useful for
--osd-status-msg, and possibly also for anything that prints to the
terminal. Espcially --term-osd-esc looks relatively useless without
being able to specify escapes.

Maybe parsing escapes should happen during command line / config parsing
instead (for all options).
2013-02-20 23:45:56 +01:00
wm4 e5f3b8da26 manpage: improve configuration file section a bit 2013-02-17 21:06:34 +01:00