Commit Graph

10895 Commits

Author SHA1 Message Date
wm4 9d8afcf79e demux: add another stream recording feature
--record-file is nice, but only sometimes. If you watch some sort of
livestream which you want to record, it's actually much nicer not to
record what you're currently "seeing", but anything you're receiving.
2018-12-06 10:31:10 +01:00
wm4 4dfaa37384 demux, stream: readd cache-speed in some other form
it's more like an input speed rather than a cache speed, but who cares.
2018-12-06 10:30:41 +01:00
Anton Kindestam 8b83c89966 Merge commit '559a400ac36e75a8d73ba263fd7fa6736df1c2da' into wm4-commits--merge-edition
This bumps libmpv version to 1.103
2018-12-05 19:19:24 +01:00
Niklas Haas 5bcac8580d spirv: remove --spirv-compiler=nvidia
This option has been deprecated upstream for a long time, probably
doesn't even work anymore, and won't work moving forwards as we replace
the vulkan code by libplacebo wrappers.

I haven't removed the option completely yet since in theory we could
still add support for e.g. a native glslang wrapper in the future. But
most likely the future of this code is deletion.

As an aside, fix an issue where the man page didn't mention d3d11.
2018-12-01 15:50:23 +02:00
Anton Kindestam f0509d3738 drm: rename plane options to better, invariant, names
This commit bumps the libmpv version to 1.102

drm-osd-plane -> drm-draw-plane
drm-video-plane -> drm-drmprime-video-plane
drm-osd-size -> drm-draw-surface-size

"draw plane", as in the plane that OpenGL draws to, whether it be
video + OSD or just OSD.

"drmprime video plane", as in the plane used for hwdec video imported
via drmprime.

"draw surface size", as in the size of the surface used for the draw plane

The new names are invariant whether or not hwdec_drmprime_drm is being
used or not. The original naming was very confusing, as when doing
regular rendering (swdec or vaapi) the video would be displayed on the
"OSD plane", and the "Video plane" would remain unused.
2018-12-01 15:42:20 +02:00
Anton Kindestam c151fae054 drm_atomic: Add general primary/overlay plane option
Add general primary/overlay plane option to drm-osd-plane-id and
drm-video-plane-id, so that the user can just request any usable
primary or overlay plane for either of these two options. This should
be somewhat more user-friendly (especially as neither of these two
options currently have a useful help function), as usually you would
only be interested in the type of the plane, and not exactly which
plane gets picked.
2018-12-01 15:42:20 +02:00
TheAMM b6a431ec55 man: fix --watch-later-directory formatting
Extra line prevents the sub-title formatting.
Removing it, the option is formatted like the others.
2018-11-28 18:02:45 +01:00
Philip Langdale da1073c247 vo_gpu: vulkan: hwdec_cuda: Add support for Vulkan interop
Despite their place in the tree, hwdecs can be loaded and used just
fine by the vulkan GPU backend.

In this change we add Vulkan interop support to the cuda/nvdec hwdec.

The overall process is mostly straight forward, so the main observation
here is that I had to implement it using an intermediate Vulkan buffer
because the direct VkImage usage is blocked by a bug in the nvidia
driver. When that gets fixed, I will revist this.

Nevertheless, the intermediate buffer copy is very cheap as it's all
device memory from start to finish. Overall CPU utilisiation is pretty
much the same as with the OpenGL GPU backend.

Note that we cannot use a single intermediate buffer - rather there
is a pool of them. This is done because the cuda memcpys are not
explicitly synchronised with the texture uploads.

In the basic case, this doesn't matter because the hwdec is not
asked to map and copy the next frame until after the previous one
is rendered. In the interpolation case, we need extra future frames
available immediately, so we'll be asked to map/copy those frames
and vulkan will be asked to render them. So far, harmless right? No.

All the vulkan rendering, including the upload steps, are batched
together and end up running very asynchronously from the CUDA copies.

The end result is that all the copies happen one after another, and
only then do the uploads happen, which means all textures are uploaded
the same, final, frame data. Whoops. Unsurprisingly this results in
the jerky motion because every 3/4 frames are identical.

The buffer pool ensures that we do not overwrite a buffer that is
still waiting to be uploaded. The ra_buf_pool implementation
automatically checks if existing buffers are available for use and
only creates a new one if it really has to. It's hard to say for sure
what the maximum number of buffers might be but we believe it won't
be so large as to make this strategy unusable. The highest I've seen
is 12 when using interpolation with tscale=bicubic.

A future optimisation here is to synchronise the CUDA copies with
respect to the vulkan uploads. This can be done with shared semaphores
that would ensure the copy of the second frames only happens after the
upload of the first frame, and so on. This isn't trivial to implement
as I'd have to first adjust the hwdec code to use asynchronous cuda;
without that, there's no way to use the semaphore for synchronisation.
This should result in fewer intermediate buffers being required.
2018-10-22 21:35:48 +02:00
Niklas Haas 7ad60a7c5e vo_gpu: split --linear-scaling into two separate options
Since linear downscaling makes sense to handle independently from
linear/sigmoid upscaling, we split this option up. Now,
linear-downscaling is its own option that only controls linearization
when downscaling and nothing more. Likewise, linear-upscaling /
sigmoid-upscaling are two mutually exclusive options (the latter
overriding the former) that apply only to upscaling and no longer
implicitly enable linear light downscaling as well.

The old behavior was very confusing, as evidenced by issues such
as #6213. The current behavior should make much more sense, and only
minimally breaks backwards compatibility (since using linear-scaling
directly was very uncommon - most users got this for free as part of
gpu-hq and relied only on that).

Closes #6213.
2018-10-19 22:58:01 +02:00
Nicolas F ce27b17a65 man: mention stats in interactive control
Someone on IRC pointed out that the default stats bindings weren't
documented in the interactive control section of the manual, so
let's add them with a short mention and a reference to the STATS
section of the manual.
2018-10-14 21:56:34 +03:00
Akemi 8d2d0f0640 cocoa-cb: add Apple Software Renderer support
by default the pixel format creation falls back to software renderer
when everything fails. this is mostly needed for VMs. additionally one
can directly request an sw renderer or exclude it entirely.
2018-09-30 17:13:34 +03:00
Anton Kindestam f277f9f6d2 manpage: minor fix to --drm-format
Looking at other examples, a bar should be used when listing OPT_CHOICE options.
2018-09-30 14:22:49 +03:00
Ricardo Constantino 9c184078a6
man/options: emphasize ytdl_hook's script options 2018-09-26 22:25:06 +01:00
wm4 559a400ac3 demux, stream: rip out the classic stream cache
The demuxer cache is the only cache now. Might need another change to
combat seeking failures in mp4 etc. The only bad thing is the loss of
cache-speed, which was sort of nice to have.
2018-08-31 12:55:22 +02:00
Anton Kindestam d2d7dba6ee manpage: fix reference to --tone-mapping by old option name 2018-08-18 20:32:41 +02:00
sfan5 2e7f60c386 demux_edl: add title option to override title of chapters 2018-08-13 19:09:57 +02:00
jaseg cfecbac863 manpage: Correct show-text duration default value
duration is parsed as an integer, and the default value is used if ```-1``` is passed. Passing ```-``` as described here causes a parameter value error.
2018-08-05 23:02:01 +02:00
pavelxdd 759a6a259e manpage: fix --vf exclamation mark description
An exclamation mark disables the filter by default instead of
enabling it.
2018-08-05 23:01:45 +02:00
Tom Yan 93a57d4c8b ao_opensles: update interface-changes 2018-08-05 17:52:01 +02:00
Daniel M. Capella 45beb7073a manpage: fixup mistaken show playlist/track-list shortcuts
This was mistaken in 496b13227b and
not noticed in review.
2018-07-23 01:31:41 +03:00
Jan Ekström 1a893e8257 gpu: prefer 16bit floating point FBO formats to 16bit integer ones
According to earlier discussions, this can improve visual quality.
This only changes the preferred order of the formats, not the
formats themselves.
2018-07-08 16:49:23 +03:00
wm4 31bce1cbe7 demux_lavf: drop obscure genpts option
This code shouldn't even exist in libavformat. If you still need it, you
can enable it via --demuxer-lavf-o.
2018-05-31 01:24:51 +03:00
wm4 ca97239cb6 options: add --http-proxy
Often requested, trivial.
2018-05-31 01:24:51 +03:00
wm4 935846fc40 player: remove deprecated vo/ao auto profiles
These were deprecated almost 2 years ago. Now they happen to be in the
way.
2018-05-31 01:24:51 +03:00
wm4 3ca9598d5c manpage: update --demuxer-thread option
Be a bit more detailed, and discourage disabling it.
2018-05-31 01:24:51 +03:00
wm4 9428294634 player: simplify edition switching
The player fully restarts playback when the edition or disk title is
changed. Before this, the player tried to reinitialized playback
partially. For example, it did not print a new "Playing: <file>"
message, and did not send playback end to libmpv users (scripts or
applications).

This playback restart code was a bit messy and could have unforeseen
interactions with various state. There have been bugs before. Since it's
a mostly cosmetic thing for an obscure feature, just change it to a full
restart. This works well, though since it may have consequences for
scripts or client API users, mention it in interface-changes.rst.
2018-05-31 01:24:51 +03:00
wm4 a832624af9 manpage: mention that fd:// file descriptors may be modified
For example, we call setmode() to switch a FD from text to binary mode
on garbage OSes.
2018-05-25 10:53:41 +02:00
wm4 fba98cfb05 manpage: remove a reference to a removed option 2018-05-25 10:47:23 +02:00
wm4 40ebedabcf ipc: alias set_property_string to set_property
The only effective difference is that the former explicitly checks
whether the JSON value type is string, and errors out if not. The rest
is exactly the same (mpv_set_property_string is mpv_set_property with
MPV_FORMAT_STRING).

It seems silly to keep this, so just remove it.
2018-05-25 10:45:59 +02:00
wm4 1d46368404 manpage: mention that --no-correct-pts can break seeking too 2018-05-25 10:45:46 +02:00
wm4 982416266c demux_lavf: drop obscure genpts option
This code shouldn't even exist in libavformat. If you still need it, you
can enable it via --demuxer-lavf-o.
2018-05-24 19:56:35 +02:00
wm4 b2e24f42d5 options: add --http-proxy
Often requested, trivial.
2018-05-24 19:56:35 +02:00
wm4 160e5c8377 player: remove deprecated vo/ao auto profiles
These were deprecated almost 2 years ago. Now they happen to be in the
way.
2018-05-24 19:56:35 +02:00
wm4 dbcd654e61 player: make playback termination asynchronous
Until now, stopping playback aborted the demuxer and I/O layer violently
by signaling mp_cancel (bound to libavformat's AVIOInterruptCB
mechanism). Change it to try closing them gracefully.

The main purpose is to silence those libavformat errors that happen when
you request termination. Most of libavformat barely cares about the
termination mechanism (AVIOInterruptCB), and essentially it's like the
network connection is abruptly severed, or file I/O suddenly returns I/O
errors. There were issues with dumb TLS warnings, parsers complaining
about incomplete data, and some special protocols that require server
communication to gracefully disconnect.

We still want to abort it forcefully if it refuses to terminate on its
own, so a timeout is required. Users can set the timeout to 0, which
should give them the old behavior.

This also removes the old mechanism that treats certain commands (like
"quit") specially, and tries to terminate the demuxers even if the core
is currently frozen. This is for situations where the core synchronized
to the demuxer or stream layer while network is unresponsive. This in
turn can only happen due to the "program" or "cache-size" properties in
the current code (see one of the previous commits). Also, the old
mechanism doesn't fit particularly well with the new one. We wouldn't
want to abort playback immediately on a "quit" command - the new code is
all about giving it a chance to end it gracefully. We'd need some sort
of watchdog thread or something equally complicated to handle this. So
just remove it.

The change in osd.c is to prevent that it clears the status line while
waiting for termination. The normal status line code doesn't output
anything useful at this point, and the code path taken clears it, both
of which is an annoying behavior change, so just let it show the old
one.
2018-05-24 19:56:35 +02:00
wm4 dee84be222 manpage: update --demuxer-thread option
Be a bit more detailed, and discourage disabling it.
2018-05-24 19:56:35 +02:00
wm4 562d8e6d32 player: simplify edition switching
The player fully restarts playback when the edition or disk title is
changed. Before this, the player tried to reinitialized playback
partially. For example, it did not print a new "Playing: <file>"
message, and did not send playback end to libmpv users (scripts or
applications).

This playback restart code was a bit messy and could have unforeseen
interactions with various state. There have been bugs before. Since it's
a mostly cosmetic thing for an obscure feature, just change it to a full
restart. This works well, though since it may have consequences for
scripts or client API users, mention it in interface-changes.rst.
2018-05-24 19:56:35 +02:00
wm4 0a7a4779a3 input: slightly improve --input-cmdlist output
Output argument names, whether varargs are used, and indicate optional
arguments correctly (instead of only half of them).
2018-05-24 19:56:34 +02:00
wm4 332907e1d7 command: give named arguments to almost all commands
Before this change, only 1 command or so had named arguments. There is
no reason why other commands can't have them, except that it's a bit of
work to add them.

Commands with variable number of arguments are inherently incompatible
to named arguments, such as the "run" command. They still have dummy
names, but obviously you can't assign multiple values to a single named
argument (unless the argument has an array type, which would be
something different). For now, disallow using named argument APIs with
these commands. This might change later.

2 commands are adjusted to not need a separate default value by changing
flag constants. (The numeric values are C only and can't be set by
users.)

Make the command syntax in the manpage more consistent. Now none of the
allowed choice/flag names are in the command header, and all arguments
are shown with their proper name and quoted with <...>.

Some places in the manpage and the client.h doxygen are updated to
reflect that most commands support named arguments. In addition, try to
improve the documentation of the syntax and need for escaping etc. as
well.

(Or actually most uses of the word "argument" should be "parameter".)
2018-05-24 19:56:34 +02:00
wm4 d36b85cfdf json: add some non-standard extensions
Also clarify this and previously existing differences to standard JSON
in ipc.rst.
2018-05-24 19:56:34 +02:00
wm4 972989db7e manpage: mention that fd:// file descriptors may be modified
For example, we call setmode() to switch a FD from text to binary mode
on garbage OSes.
2018-05-24 19:56:34 +02:00
wm4 5f61892c42 manpage: remove a reference to a removed option 2018-05-24 19:56:34 +02:00
wm4 7428cc5149 client API: kill async commands on termination
This affects async commands started by client API, commands with async
capability run in a sync way by client API (think mpv_command_node()
with "subprocess"), and detached async work.

Since scripts might want to do some cleanup work (that might involve
launching processes, don't ask), we don't unconditionally kill
everything on exit, but apply an arbitrary timeout of 2 seconds until
async commands are aborted.
2018-05-24 19:56:34 +02:00
wm4 fc574ee563 ipc: some user-visible changes to prepare for making all commands async
I wanted to put all commands through mpv_command_node_async() instead of
mpv_command_node(). Using synchronous commands over a synchronous
transport doesn't make sense anyway.

This would have used the request_id field in IPC requests as reply ID
for the async commands. But the latter need to be [u]int64, while the
former can be any type. To avoid that we need an extra lookup table for
mapping reply IDs to request_id values, we now require that request_id
fields are integers.

Since this would be an incompatible change, just deprecate non-integers
for now, and plan the change for a later time.
2018-05-24 19:56:34 +02:00
wm4 b44ea70209 ipc: alias set_property_string to set_property
The only effective difference is that the former explicitly checks
whether the JSON value type is string, and errors out if not. The rest
is exactly the same (mpv_set_property_string is mpv_set_property with
MPV_FORMAT_STRING).

It seems silly to keep this, so just remove it.
2018-05-24 19:56:34 +02:00
wm4 dbe831bd02 lua: expose mpv_abort_async_command()
Also somewhat cleans up mp.command_native_async() error handling.
2018-05-24 19:56:34 +02:00
wm4 9c530c7ee9 command: make "subprocess" explicitly abortable
Now mpv_abort_async_command() can be used to stop the process.
2018-05-24 19:56:34 +02:00
wm4 e4fb23ed7d command: add a way to abort asynchronous commands
Many asynchronous commands are potentially long running operations, such
as loading something from network or running a foreign process.
Obviously it shouldn't just be possible for them to freeze the player if
they don't terminate as expected. Also, there will be situations where
you want to explicitly stop some of those operations explicitly. So add
an infrastructure for this.

Commands have to support this explicitly. The next commit uses this to
actually add support to a command.
2018-05-24 19:56:34 +02:00
wm4 7f91e2684e lua: reimplement mp.subprocess_detached() by invoking the "run" command
The "run" command is old. I'm not sure why the separate Lua
implementation was added. But maybe it as because the "run" command used
to be limited to a small number of arguments. This limit has been
removed a while ago. In any case, the old implementation is not needed
anymore.
2018-05-24 19:56:34 +02:00
wm4 548ef07864 lua: reimplement mp.subprocess() by invoking the new subprocess command
We keep mp.subprocess() with roughly the same semantics for
compatibility with scripts (including the internal ytdl script).

Seems to work with rhe ytdl wrapper. Not tested further.
2018-05-24 19:56:34 +02:00
wm4 d9bc97bda6 command: add a subprocess command
This supports named arguments. It benefits from the infrastructure of
async commands.

The plan is to reimplement Lua's utils.subprocess() on top of it.
2018-05-24 19:56:34 +02:00