Commit Graph

119 Commits

Author SHA1 Message Date
wm4 dc2c7371f1 command: remove deprecated get_property command
This command has been deprecated in the 0.8.x and 0.9.x releases - get
rid of it. Its only point ever was MPlayer compatibility, which broke
years ago anyway.
2015-05-27 18:08:02 +02:00
wm4 289705daaf input: allow - as separator between commands, instead of _
Wnile it seems quite logical to me that commands use _ as word
separator, while properties use -, I can't really explain the
difference, and it tends to confuse users as well. So always
prefer - as separator for everything.

Using _ still works, and will probably forever. Not doing so would
probably create too much chaos and confusion.
2015-05-25 21:59:44 +02:00
wm4 6bfbd4ebdc command: change the hwdec properties
Another very minor step towards property/option unification.

Not bothering with interface compatibility here.
2015-05-25 21:44:48 +02:00
wm4 8054c034b8 command: add protocol-list property
Fixes #1972.
2015-05-23 15:26:55 +02:00
wm4 a7c831f36d command: deprecate audio-samplerate
Also replace their implementation with the recently introduced
properties. One significant difference is that audio-channels using OSD
formatting does not print the channel layout. The user can just use the
replacement property instead.
2015-05-22 20:28:20 +02:00
wm4 f9507fe927 command: add audio-params and audio-out-params properties 2015-05-22 20:23:47 +02:00
wm4 ff0b33ac9d command: rename audio-format property
Clashes with the option.
2015-05-22 20:05:36 +02:00
wm4 d26803cba0 command: deprecate the "length" property
It collides with the --length option.
2015-05-22 20:02:47 +02:00
wm4 68bbab0e42 audio: change range of volume option/property
Now --volume takes an absolute volume, meaning it doesn't depend on
--softvol-max. 0 is still silence, and 100 now always means unchanged
volume. The OSD and the "volume" property are changed accordingly.

Also raise the minimum value of --softvol-max. A value below 100 makes
no sense and breaks the OSD.
2015-05-22 18:35:03 +02:00
rrooij e17a8550c4 input: add relative percentage seek
Only absolute percentage seeking was permitted first. It is now also
possible to seek by relative percentage.

MPSEEK_FACTOR is used as seek_type.

Fixes #1950.

Signed-off-by: wm4 <wm4@nowhere>
2015-05-19 21:33:40 +02:00
wm4 f4c412a057 command: add playlist_shuffle command
Fixes #965.
2015-05-17 21:16:10 +02:00
wm4 0468a4ea47 manpage: explain some property expansion restrictions 2015-05-13 20:44:55 +02:00
wm4 a23a46c6ed manpage: remove stray newline 2015-05-13 20:44:55 +02:00
wm4 9795216d8a command: change the default action for rescan_external_files
Now the rescan_external_files command will by default reselect the audio
and subtitle streams. This should be more intuitive.

Client API users and Lua scripts might break, but can be fixed in a
backward-compatible way by setting the mode explicitly.
2015-04-28 22:05:07 +02:00
wm4 0c70f94c53 manpage: update colormatrix property description 2015-04-27 17:51:06 +02:00
wm4 b98949c72c manpage: document ff-index sub-property 2015-04-23 20:34:30 +02:00
xylosper dbeb105396 command: demuxer-cache-time property
Approximate time of video buffered in the demuxer, in seconds. Same as
`demuxer-cache-duration` but returns the last timestamp of bufferred
data in demuxer.

Signed-off-by: wm4 <wm4@nowhere>
2015-04-21 13:53:25 +02:00
wm4 a3680d1b2d client API: add a screenshot_raw command
Requested.

The wild code for setting up the mpv_node probably deserves to be
cleaned up later.

Fixes #1800.
2015-04-20 23:11:03 +02:00
wm4 c6d046414b player: change video-bitrate and audio-bitrate properties
Remove the old implementation for these properties. It was never very
good, often returned very innaccurate values or just 0, and was static
even if the source was variable bitrate. Replace it with the
implementation of "packet-video-bitrate". Mark the "packet-..."
properties as deprecated. (The effective difference is different
formatting, and returning the raw value in bits instead of kilobits.)

Also extend the documentation a little.

It appears at least some decoders (sipr?) need the
AVCodecContext.bit_rate field set, so this one is still passed through.
2015-04-20 20:52:16 +02:00
xylosper c64e4e48d9 command: disc-mouse-on-button property
This property indicates whether mouse cursor is located on button
or not for disc naviation.
2015-04-21 00:54:29 +09:00
wm4 547976633f command: let screenshot_to_file command overwrite files
The old behavior does not make too much sense after all. If you don't
want to file to be overwritten, the user can check this manually.

This is a change in behavior - let's hope nobody actually relied on it.
2015-04-16 22:06:47 +02:00
Niklas Haas 4f84939310
command: new subproperty for video-params: gamma 2015-04-04 15:49:16 +02:00
wm4 36c4ac8464 command: add property returning current working directory
Requested; fixes #1717.
2015-03-24 22:00:01 +01:00
wm4 9a7fc55607 command: display-fps is the display FPS as assumed by the VO
Requested change in behavior.

Note that we set the assumed "infinite" display_fps to 1e6, which
conveniently lets vo_get_vsync_interval() return a dummy value of 1,
which can be easily checked against, and still avoids doing math with
float INFs.
2015-03-12 23:41:25 +01:00
wm4 574bd127ec command: add display-fps property
Requested. Untested; leaving that to the users.
2015-03-10 14:50:56 +01:00
wm4 963c92eea2 client API: mention the changes to the seek/screenshot commands
Also fix a typo in the manpage.
2015-03-05 12:41:43 +01:00
wm4 5c49fe97cb input: use flag option type for some input commands
This gets rid of the need for a second (or more) parameters; instead it
can be all in one parameter. The (now) redundant parameter is still
parsed for compatibility, though.

The way the flags make each other conflict is a bit tricky: they have
overlapping bits, and the option parser disallows setting already set
bits.
2015-03-04 17:31:36 +01:00
wm4 d26ba961d0 command: add rescan_external_files
Requested.

Hopefully will be useful for things that download and add external
subtitles on demand. Or something.

Closes #1586.
2015-02-16 22:08:16 +01:00
wm4 2308b3a2a6 sub: mess with styling defaults, change --ass-use-margins behavior
Now --ass-use-margins doesn't apply to normal subtitles anymore. This is
probably the inverse from the mpv behavior users expected so far, and
thus a breaking change, so rename the option, that the user at least has
a chance to lookup the option and decide whether the new behavior is
wanted or not.

The basic idea here is:
- plain text subtitles should have a certain useful defalt behavior,
  like actually using margins
- ASS subtitles should never be broken by default
- ASS subtitles should look and behave like plaintext subtitles if
  the --ass-style-override=force option is used

This also subtly changes --sub-scale-with-window and adds the --ass-
scale-with-window option. Since this one isn't so important, don't
bother with compatibility.
2015-02-16 20:04:29 +01:00
wm4 fd5403cb40 command: mark get_property as deprecated
Using it just makes no sense. But we're really being nice about this and
don't remove it immediately.
2015-02-13 21:48:11 +01:00
wm4 f061befb33 audio: add device change notification for hotplugging
Not very important for the command line player; but GUI applications
will want to know about this.

This only adds the internal API; support for specific audio outputs
comes later.

This reuses the ao struct as context for the hotplug event listener,
similar to how the "old" device listing API did. This is probably a bit
unclean and confusing. One argument got reusing it is that otherwise
rewriting parts of ao_pulse would be required (because the PulseAudio
API requires so damn much boilerplate). Another is that --ao-defaults is
applied to the hotplug dummy ao struct, which automatically applies such
defaults even to the hotplug context.

Notification works through the property observation mechanism in the
client API. The notification chain is a bit complicated: the AO notifies
the player, which in turn notifies the clients, which in turn will
actually retrieve the device list. (It still has the advantage that it's
slightly cleaner, since the AO stuff doesn't need to know about client
API issues.)

The weird handling of atomic flags in ao.c is because we still don't
require real atomics from the compiler. Otherwise we'd just use atomic
bitwise operations.
2015-02-12 17:17:41 +01:00
wm4 f8dc5db315 manpage: document hook API
This shouldn't exist and for the most part is meant to be used by the
ytdl Lua script, but let's document it anyway. Since the Lua API handles
all the details, it's considered much more "stable" than the raw API,
which is why the raw API wasn't documented.
2015-02-04 23:04:21 +01:00
xylosper 95fd83a269 command: new commands audio_add/audio_remove/audio_reload
These commands are counterparts of sub_add/sub_remove/sub_reload which
work for external audio file.

Signed-off-by: wm4 <wm4@nowhere>
(minor simplification)
2015-02-03 13:53:39 +01:00
Stefano Pigozzi a3be14683a command: add property returning detected audio device
This can be useful to adjust some other audio related properties
at runtime depending on the audio device being used.
2015-02-03 00:40:02 +01:00
wm4 2a9534871d command: add property returning detected hwdec API
This is somewhat imperfect, because detection of hw decoding APIs is
mostly done on demand, and often avoided if not necessary. (For example,
we know very well that there are no hw decoders for certain codecs.)

This also requires every hwdec backend to identify itself (see hwdec.h
changes).
2015-02-02 22:43:13 +01:00
wm4 c8631b3b06 command: add properties returning the current VO and AO driver
This wasn't possible before.
2015-02-02 18:07:37 +01:00
wm4 00b2611352 command: export more details about file seekability
If a file is unseekable (consider e.g. a http server without resume
functionality), but the stream cache is active, the player will enable
seeking anyway. Until know, client API user couldn't know that this
happens, and it has implications on how well seeking will work. So add a
property which exports whether this situation applies.

Fixes #1522.
2015-01-26 13:46:33 +01:00
xylosper 4a1a0e98d8 input, player: new command for mouse event
New command `mouse <x> <y> [<button> [single|double]]` is introduced.
This will update mouse position with given coordinate (`<x>`, `<y>`),
and additionally, send single-click or double-click event if `<button>`
is given.
2015-01-23 22:07:47 +01:00
wm4 17e1e9f486 manpage: minor changes
Mostly related to vo_opengl.

Fix the opengl lscale option in the qml example too.
2015-01-23 17:41:50 +01:00
wm4 9681d42a94 command: export file format as property
Repurpose demuxer->filetype for this. It used to be used to print a
human readable format description; change it to a symbolic format name
and export it as property.

Unfortunately, libavformat has its own weird conventions, which are
reflected through the new property, e.g. the .mp4 case mentioned in the
manpage.

Fixes #1504.
2015-01-23 15:59:06 +01:00
wm4 eb5a83e1c1 x11: add --on-all-workspaces option and property
Fixes #1469.
2015-01-16 23:38:47 +01:00
wm4 0092ae8676 manpage: fix osd-ass-cc examples
The "\\" escape was rendered as "\" on the website. I'm hoping quoting
this in ``...`` will render it correctly.

Also add an example for show_text, which awkwardly does not require
escaping the "\".
2015-01-16 12:17:55 +01:00
wm4 e96c08ecb5 command: fix property naming convention
Use "-" instead of "_" as separator.
2015-01-10 21:16:34 +01:00
wm4 e5f2072364 command: change properties added in previous commit
Make their meaning more exact, and don't pretend that there's a
reasonable definition for "bits-per-pixel". Also make unset fields
unavailable.

average_depth still might be inconsistent: for example, 10 bit 4:2:0 is
identified as 24 bits, but RGB 4:4:4 as 12 bits. So YUV formats
seemingly drop the per-component padding, while RGB formats do not.
Internally it's consistent though: 10 bit YUV components are read as
16 bit, and the padding must be 0 (it's basically like an odd fixed-
point representation, rather than a bitfield).
2015-01-10 19:13:16 +01:00
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