Commit Graph

225 Commits

Author SHA1 Message Date
xylosper 242558bec1 command.c: new subproperties for video-params: bpp and depth
bpp(bits-per-pixel) and depth(bit-depth for color component) can
be calculated from pixelformat technically but it requires massive
informations to be implemented in client side.

These subproperties are provided for convenience.
2015-01-10 18:53:03 +01:00
wm4 4c3f042777 command: make the "run" command work on Windows too
Do so by using mp_subprocess(). Although this uses completely different
code on Unix too, you shouldn't notice a difference. A less ncie thing
is that this reserves an entire thread while the command is running
(which wastes some memory for stack, at least). But this is probably
still the simplest way, and the fork() trick is apparently not
implementable with posix_subprocess().
2015-01-01 20:37:49 +01:00
wm4 97ab40290e command: add filtered-metadata property
Goes in hand with the previous commit; the main purpose is to easily
show on OSD what is shown on terminal.
2014-12-29 23:03:39 +01:00
wm4 adf7f0661e command: overlay_add: more flexible treatment of offset parameter
Essentially, don't make it the mmap() argument, and just add it to the
memory address. This hides tricky things like alignment reequirements
from the user.

Strictly speaking, this is not entirely backwards compatible: this adds
the regression that you can't access past 2 or 4 GB of a file on 32 bit
systems anymore. But I doubt anyone cared about this.

In theory, we could be clever, and just align the offset manually and
pass that to mmap(). This would also be transparent to the user, but
minimally more effort, so this is left as exercise to the reader.
2014-12-26 18:11:22 +01:00
wm4 3fdb6be316 win32: add mmap() emulation
Makes all of overlay_add work on windows/mingw.

Since we now don't explicitly check for mmap() anymore (it's always
present), this also requires us to make af_export.c compile, but I
haven't tested it.
2014-12-26 17:30:10 +01:00
wm4 c721948efe command: extend revert_seek command
"revert_seek mark" basically forces the seekback point. It's basically a
one-way bookmark.
2014-12-17 22:56:45 +01:00
wm4 5b618ef629 command, dvd: add property which returns list of DVD titles
This was requested.

It seems libdvdread can't get the duration for titlesets other than the
currently opened title. The data structures contain dangling pointers
for these, and MPlayer works this around by opening every title
separately for the purpose of dumping the title list.
2014-12-13 20:25:56 +01:00
wm4 d17c3b63c3 command: add properties for current bitrate
Fixes #1192.
2014-12-12 01:00:58 +01:00
wm4 c6dc0c6d99 command: add "idle" property
Yes, it's redundant with events.
2014-12-10 14:42:57 +01:00
wm4 09e5d7c1e6 manpage: rename input.conf supersection
By now, input.conf is actually just a small part of input handling.
Rename the section to something else ("command interface" was the
first reasonable thing that came to mind).

Also fix a minor typo further down.
2014-11-29 20:53:24 +01:00
wm4 ae5df9be98 input, lua: redo input handling
Much of it is the same, but now there's the possibility to distinguish
key down/up events in the Lua API.
2014-11-23 15:13:35 +01:00
wm4 0a78a61d89 input: add a prefix to make any binding act on key repeat
The fact that it's a generic command prefix that is parsed even when
using the client API is a bit unclean (because this flag makes sense
for actual key-bindings only), but it's less code this way.
2014-11-20 23:41:01 +01:00
wm4 2d039e691f command: add drop_buffers
This command was actually requested on IRC ages ago, but I forgot about
it.

The main purpose is that the decoding state can be reset without issuing
a seek, in particular in situations where you can't seek.

This restarts decoding from the middle of the packet stream; since it
discards the packet buffer intentionally, and the decoder will typically
not output "incomplete" frames until it has recovered, it can skip a
large amount of data.

It doesn't clear the byte stream cache - I'm not sure if it should.
2014-11-20 22:41:50 +01:00
wm4 d51a032fd7 demux_mkv: add an option for compatibility with Haali
This was requested on IRC.
2014-11-18 23:07:20 +01:00
wm4 cc84f73a95 manpage: document vo_cmdline command 2014-11-18 21:40:30 +01:00
wm4 534b08e6ba command: add an ab_loop command
As suggested in #1241; to make using the feature easier.

Also add better OSD-formatting for the ab-loop-a/b properties.
2014-11-18 21:34:57 +01:00
wm4 4bd6c91d9b command: implement A-B loops
Probably needs to be polished a bit more. Also, might require a key
binding that can set/clear the loop points in a more intuitive way.

For now, something like this can be put into input.conf to use it:

ctrl+y set ab-loop-a ${time-pos}    # set A
ctrl+x set ab-loop-b ${time-pos}    # set B
ctrl+c set ab-loop-a no             # clear (mostly)

Fixes #1241.
2014-11-18 01:36:35 +01:00
wm4 469eb321e8 command: adjust previous commit
Due to the current code structure, the "current" entry and the entry
which is playing can be different. This is probably silly, but still
try to mark the entries correctly.

Refs #1260.
2014-11-17 22:48:38 +01:00
wm4 ebd41bdf6c command: playlist property: return if an entry is currently playing
This actually doesn't even write/return the new sub-property, because
I dislike the idea of dumping that field for every single playlist
entry, even though it's "needed" only for one.

Fixes #1260.
2014-11-17 22:16:52 +01:00
wm4 5d12a2696e command: export some option metadata
This might be interesting for GUIs and such.

It's probably still a little bit insufficient. For example, the filter
and audio/video output lists are not available through this.
2014-11-13 18:01:27 +01:00
wm4 71168e740e command: rename "option-flags" property to "option-info" 2014-11-13 17:27:31 +01:00
wm4 23e0682dd4 command: export mpv configure arguments as property
It seems strange that a client API user can't get this string, other
than analyzing the mpv log output.
2014-11-13 16:18:40 +01:00
wm4 1a5650b628 command: export the flag whether an option was set on commandline
Can be useful for certain scripts; I think someone requested this.
2014-11-07 16:33:41 +01:00
Kevin Mitchell 351608e5cc command: add display-names property
Call VOCTRL_GET_DISPLAY_NAMES it when the property is
requested. The vo should return the names of the displays that the mpv
window is covering.  For example, with x11 vos, xrandr names LVDS1,
HDMI1, etc.
2014-11-07 01:14:03 -08:00
wm4 416c86f3cb command: add window-minimized property (X11 only)
More or less requested by #1237.

Should be simple to extend this to other backends.
2014-11-02 20:55:07 +01:00
wm4 3a95a0887c command: expose mpv version as property
A client API user has no other way to know the version.
2014-11-02 17:44:24 +01:00
wm4 dab6cbca16 player: update meaning of drop_frame_cnt
Rename the variable, update comments, and update the documentation of
the property which returns its value.
2014-11-01 01:07:21 +01:00
wm4 0f70d0e927 manpage: clarify loadfile append-play mode
Documents the behavior introduced with the previous commit.
2014-10-28 10:18:46 +01:00
wm4 dced2aa81b command: add audio-device property
Meant for changing the --audio-device at runtime.
2014-10-27 12:18:25 +01:00
wm4 d5b081152a audio: add command/function to reload audio output
Anticipated use: simple solution for dealing with audio APIs which
request configuration changes via events.
2014-10-27 11:52:42 +01:00
wm4 9b45b48c46 Drop libquvi support
No development activity (or even any sign of life) for almost a year.

A replacement based on youtube-dl will probably be provided before the
next mpv release. Ask on the IRC channel if you want to test.

Simplify the Lua check too: libquvi linking against a different Lua
version than mpv was a frequent issue, but with libquvi gone, no
direct dependency uses Lua, and such a clash is rather unlikely.
2014-10-25 20:18:22 +02:00
wm4 f1481df0b6 command: add vo-configured property
So a client API user can know when a window is created or destroyed.

Also might be useful for the OSC: it could disable itself if video is
disabled.

Before this commit, there were only indirect ways of detecting this.
2014-10-24 15:34:53 +02:00
wm4 7e27663b7b command: add a "cached" mode to sub_add
This avoids reloading a subtitle if it was already added. In all cases,
the subtitle is selected.
2014-10-23 13:13:23 +02:00
wm4 7eb047b241 command: make reverse cycle_values match up with forward one
The behavior of reverse cycling (with the "!reverse" magic value) was a
bit weird and acted with a "delay". This was because the command set the
value the _next_ command should use. Change this and make each command
invocation select and use the next command directly. This requires an
"uninitialized" special index in the counter, but that is no problem at
all.
2014-10-21 23:55:32 +02:00
wm4 bc1893e036 command: add cursor-autohide property
Allows properly changing/updating the cursor state. Useful for client
API window embedding, because the host application may not want the mpv
window to grab mouse input, and this has to manually handle the cursor.
Changing the cursor of foreign windows is usually not sane.

It might make sense to allow changing the cursor icon, but that would be
much more complicated, so I won't add it unless someone actually
requests it.
2014-10-21 13:42:15 +02:00
wm4 0fa9e2bff0 command: add playback-abort property
Now this is obscure.
2014-10-21 13:38:41 +02:00
wm4 cdbc865ad0 command: add video-rotate property 2014-10-21 13:31:30 +02:00
Kevin Mitchell 599c510902 command: add field-dominance property 2014-10-21 00:55:15 +02:00
wm4 131633b4e5 command: extend sub_add command 2014-10-21 00:15:04 +02:00
shdown f7c76120c0 manpage: fix reference to a defunct option
The change was made with faad40aad9.
2014-10-16 21:17:01 +02:00
wm4 bc0ed90481 command: allow setting per-file options at runtime
The intended use-case is for doing this at load time, after the load
command was issued. (See following commit.)
2014-10-15 22:39:33 +02:00
wm4 2f28e071c8 command: make audio device list available to the client API 2014-10-10 19:49:10 +02:00
wm4 3cbd79b35b command: add cache-buffering-state property 2014-10-07 22:13:36 +02:00
wm4 128bb68d29 client API: clarify pause/unpause events, modify core-idle property
Whether you consider the semantics weird or not depends on your use
case, but I suppose it's a bit confusing anyway. At this point, we keep
MPV_EVENT_PAUSE/UNPAUSE for compatibility only.

Make the "core-idle" property somewhat more useful in this context.
2014-10-07 21:01:19 +02:00
Kevin Mitchell d4d37245a6 manpage: improve consistency with new ~/.config/mpv default
Signed-off-by: wm4 <wm4@nowhere>
2014-10-04 01:29:12 +02:00
wm4 4332105352 command: allow passing memory addresses to overlay_add
For the sake of libmpv. Might make things much easier for the user,
especially on Windows. On the other hand, it's a bit sketchy that a
command exists that makes the player access arbitrary memory regions.
(But do note that input commands are not meant to be "secure" and never
were - for example, there's the "run" command, which obviously allows
running random shell commands.)
2014-10-03 01:24:48 +02:00
wm4 44d5a26bd6 manpage: remove non-existing ratio-pos property
Use percent-pos instead, which is exactly the same, except with the
range 0.0-100.0.

I'm not sure how this got there; it was probably introduced and then
removed again as percent-pos got more precise.

CC: @mpv-player/stable
2014-10-02 18:37:22 +02:00
Kevin Mitchell 61ebe6137e man: fix to->too typo 2014-09-30 11:24:38 -07:00
wm4 6c3d25e6f5 command: allow using ASS tags on OSD messages
We don't allow this by default, because it would be silly if random
external data (like filenames or file tags) could accidentally trigger
them.

Add a property that magically disables this ASS tag escaping.

Note that malicious input could still disable ASS tag escaping by
itself. This would be annoying but harmless.
2014-09-18 00:49:55 +02:00
wm4 a522441bbe command: add osd-sym-cc property
This allows you to reproduce the OSD symbol.
2014-09-18 00:12:59 +02:00
Aleksey Andreev 9e1ea9b3cd manpage: fix typo in input.rst
Signed-off-by: wm4 <wm4@nowhere>
2014-09-15 23:23:26 +02:00
wm4 ac2047e02e manpage: clarify description of dwidth/dheight 2014-09-15 18:29:53 +02:00
wm4 2dd819705d input: "quit_watch_later" and "stop" are abort commands
This means they get special handling for asynchronously aborting
playback, even if the player is "stuck".

Also document "stop". It seems somewhat useful for client API users
(although that will be implemented properly only in the following
commits.)
2014-09-13 14:10:10 +02:00
wm4 545c2d7206 manpage: fix sub_add description
It is in fact selected. The manpage wasn't updated when this was
changed.
2014-09-05 02:42:25 +02:00
wm4 8d92128f6b command: remove broken quvi-format property
Never really worked, and libquvi is probably a lost cause anyway.
2014-09-01 23:27:33 +02:00
Martin Herkt 27a065182c man: fix a whole bunch of typos 2014-09-01 04:27:13 +02:00
wm4 8956878448 manpage: be more explicit about "estimated-..." properties
In particular, use the note markup. The issue about rounded timestamps
is mostly with respect to Matroska (which usually rounds them to
milliseconds), which somewhat adds to the reliability issue.
2014-08-31 00:22:01 +02:00
wm4 ce93ee8bd0 manpage: fix minor grammar issue 2014-08-29 20:56:08 +02:00
wm4 e47a9bd721 command: export demuxer cache info properties 2014-08-28 17:49:10 +02:00
Andrey Morozov 1cb15316b0 command: add estimated-frame-count & estimated-frame-number properties
Signed-off-by: wm4 <wm4@nowhere>
2014-08-19 21:47:14 +02:00
wm4 543ba6c114 video: add VO framedropping mode
This mostly uses the same idea as with vo_vdpau.c, but much simplified.

On X11, it tries to get the display framerate with XF86VM, and limits
the frequency of new video frames against it. Note that this is an old
extension, and is confirmed not to work correctly with multi-monitor
setups. But we're using it because it was already around (it is also
used by vo_vdpau).

This attempts to predict the next vsync event by using the time of the
last frame and the display FPS. Even if that goes completely wrong,
the results are still relatively good.

On other systems, or if the X11 code doesn't return a display FPS, a
framerate of 1000 is assumed. This is infinite for all practical
purposes, and means that only frames which are definitely too late are
dropped. This probably has worse results, but is still useful.

"--framedrop=yes" is basically replaced with "--framedrop=decoder". The
old framedropping mode is kept around, and should perhaps be improved.
Dropping on the decoder level is still useful if decoding itself is too
slow.
2014-08-15 23:33:33 +02:00
wm4 3f353f1219 input.conf: make explanatory text more readable
Or at leats this is the intention. It's a bit hard to tell which
information is needed, and which not.
2014-08-11 23:32:37 +02:00
wm4 fa682af6ee command: add a "seeking" property
The client API exports this state via events already, but maybe it's
better to explicitly provide this property in order to facilitate use on
OSD and similar cases.
2014-08-08 00:16:20 +02:00
wm4 0f5aed9c62 player: some further playloop cleanups
Handle --term-playing-msg at a better place.

Move MPV_EVENT_TICK hack into a separate function. Also add some words
to the client API that you shouldn't use it. (But better leave breaking
it for later.)

Handle --frames and frame_step differently. Remove the mess from the
playloop, and do it after frame display. Give up on the weird semantics
for audio-only mode (they didn't make sense anyway), and adjust the
manpage accordingly.
2014-08-03 20:31:00 +02:00
wm4 27301ee691 manpage: be more explicit where input.conf is located 2014-08-02 06:57:36 +02:00
wm4 be337aa415 command: add a property that returns a list of all properties
Also remove the undocumented Lua mp.property_list() function.
2014-08-02 01:53:21 +02:00
wm4 16e5ec88e1 manpage: remove duplicated misplaced description of a command 2014-08-02 01:53:18 +02:00
wm4 c1b64cc693 command: add cache-idle property 2014-07-31 04:25:39 +02:00
wm4 843f5f4723 command: add append-play loadfile mode
"loadfile filename append-play" will now always append the file to the
playlist, and if nothing is playing yet, start playback. I don't want to
change the semantics of "append" mode, so a new mode is needed.

Probably fixes issue #950.
2014-07-23 00:20:53 +02:00
wm4 acd60736ef Remove stream_pts stuff
This was used by DVD/BD, but its usage was removed with one of the
previous commits.
2014-07-06 19:05:59 +02:00
wm4 0004aaf788 DOCS: add a file listing API changes for the client API 2014-07-03 01:26:19 +02:00
Andrey Morozov b1969c0eba command: change cache perentage to float, add cache-free and cache-used 2014-07-02 01:28:11 +02:00
Tsukasa OMOTO a73415584c player: make the time display relative to start PTS
This commit makes the playback start time always at time 0.

Signed-off-by: wm4 <wm4@nowhere>
2014-06-29 20:39:49 +02:00
Niklas Haas ef6db24366 options: Expose --colormatrix-primaries to the user
Signed-off-by: wm4 <wm4@nowhere>
2014-06-22 19:01:25 +02:00
wm4 f5e1756475 DOCS: remove en/ sub-directory
This additional sub-directory doesn't serve any purpose anymore. Get rid
of it.
2014-06-20 23:01:12 +02:00