Commit Graph

326 Commits

Author SHA1 Message Date
Filip Milivojevic 5c3a6ca96e vf_vavpp: fix deinterlacing
Add filter parameters to VAAPI deinterlacing filter to actually process
bottom fields instead of deinterlacing top field twice.

Signed-off-by: wm4 <wm4@nowhere>
2015-03-08 21:44:18 +01:00
wm4 24e7280178 vf: fix indentation level of verbose output
Just so that it has the same indentation as the extremely similar audio
filter output.
2015-02-23 16:12:03 +01:00
wm4 6e50e59386 vf_vapoursynth: replace a hack with a newer VS API function
The new function does exactly what we need. Replaces the old hack, which
created the vscore by running an empty script.
2015-02-16 20:56:00 +01:00
Julian 349067a6ab vf_vapoursynth: add display refresh rate property
This value is not necessarily trustworthy (it might change) and can be
0.
2015-02-13 22:35:47 +01:00
wm4 5c5e38fc0e vf_lavfi: drop useless option from wrapper filters
Filters which merely wrap libavfilter (for user-compatibility) like
vf_gradfun had a "lavfi-enable" suboption, which could disable
libavfilter usage. Since none of these filters has an internal
implementation anymore, this was completely useless.
2015-02-12 11:53:40 +01:00
wm4 2522bff565 video/filters: simplify libavfilter bridge
Remove the confusing crap that allowed a filter using the libavfilter
bridge to be compiled without libavfilter. Instead, compile the wrappers
only if libavfilter is enabled at compile time.

The only filter which still requires it is vf_stereo3d (unfortunately).
Special-case this one. (The whole filter and how it interacts with lavfi
is pure braindeath anyway.)
2015-02-11 17:35:58 +01:00
wm4 73d23a9405 vf_noise: remove internal implementation
It requires libavfilter now, just like many other filters. Not sure if
it even makes sense to keep this wrapper.
2015-02-11 17:20:22 +01:00
wm4 547fd2a229 vf_vapoursynth: load Lua stdlib in Lua mode
If you can call this a "stdlib".
2015-01-29 19:57:40 +01:00
wm4 b473477fc5 vf_ilpack: remove this filter
This was apparently useful for correct interlaced scaling (although I
don't know anyone who used this). It was rarely used (if at all), had an
inconvenient output format (packed YUV), and now has a better solution
in libavfilter (using the libavfilter "scale" filter via vf_lavfi).
There is no reason to keep this filter any longer.
2015-01-27 19:13:51 +01:00
wm4 86bba0dc5b vf_divtc: remove this filter
Better solutions are available in vf_vapoursynth and vf_lavfi. The only
user I know who used this is now using vf_vapoursynth.
2015-01-27 19:10:13 +01:00
wm4 97f32fdb23 vf_phase: remove this filter
If you really want it, it's in libavfilter and can be used via vf_lavfi.
2015-01-27 19:06:59 +01:00
wm4 82e3d06f09 vf_swapuv: remove this filter
It's entirely useless. I left it in for a while, because the analog TV
code had a transitional bug that could switch chroma planes, but it was
fixed long ago. It's also available in libavfilter.
2015-01-27 19:04:02 +01:00
wm4 c92f4a1126 vf_softpulldown: remove this filter
Apparently it was completely broken and essentially did nothing. This
was broken sometime in early mpv or mplayer2 times.

Get rid of it. If you _really_ need it, wait until FFmpeg ports it from
MPlayer, which will happen very soon.
2015-01-27 18:58:16 +01:00
wm4 69e5dd9bce vf_pullup: remove builtin implementation
Now it requires libavfilter. The wrapper is left in place, so FFmpeg
users will not notice any change. On Libav, the filter stops working.
2015-01-27 18:53:28 +01:00
Ben Boeckel 2bbad06bfc ta: rename MP_TALLOC_ELEMS to MP_TALLOC_AVAIL
The macro actually returns the *available* space in the array, not how
much is actually filled in.
2015-01-27 18:09:36 +01:00
wm4 5e9f791667 video: separate screenshot modes
Use different VOCTRLs for "window" and normal screenshot modes. The
normal one will probably be removed, and replaced by generic code in
vo.c, and this commit is preparation for this. (Doing it the other way
around would be slightly simpler, but I haven't decided yet about the
second one, and touching every VO is needed anyway in order to remove
the unneeded crap. E.g. has_osd has been unused for a long time.)
2015-01-23 22:08:20 +01:00
wm4 e5bceb061b vf_vavpp: add more deinterlacing algorithms
These are untested due to lack of hardware. From what I've heard, the
drivers are pretty buggy, so it's not clear how well this works, if at
all.
2015-01-23 13:26:41 +01:00
wm4 aae9af348e video: have a generic context struct for hwdec backends
Before this commit, each hw backend had their own specific struct types
for context, and some, like VDA, had none at all. Add a context struct
(mp_hwdec_ctx) that provides a somewhat generic way to pass the hwdec
context around. Some things get slightly better, some slightly more
verbose.

mp_hwdec_info is still around; it's still needed, but is reduced to its
role of handling delayed loading of the hwdec backend.
2015-01-22 15:32:23 +01:00
wm4 b2149f7fe1 vaapi: minor simplification 2015-01-21 22:12:30 +01:00
wm4 a1ed13869c video: remove vfcap.h
And remove all uses of the VFCAP_CSP_SUPPORTED* constants. This is
supposed to reduce conversions if many filters are used (with many
incompatible pixel formats), and also for preferring the VO's natively
supported pixel formats (as opposed to conversion).

This is worthless by now. Not only do the main VOs not use software
conversion, but also the way vf_lavfi and libavfilter work mostly break
the way the old MPlayer mechanism worked. Other important filters like
vf_vapoursynth do not support "proper" format negotation either.

Part of this was already removed with the vf_scale cleanup from today.

While I'm touching every single VO, also fix the query_format argument
(it's not a FourCC anymore).
2015-01-21 22:08:24 +01:00
wm4 30ca30c0a1 vf_scale: replace ancient fallback image format selection
If video output and VO don't support the same format, a conversion
filter needs to be insert. Since a VO can support multiple formats, and
the filter chain also can deal with multiple formats, you basically have
to pick from a huge matrix of possible conversions.

The old MPlayer code had a quite naive algorithm: it first checked
whether any conversion from the list of preferred conversions matched,
and if not, it was falling back on checking a hardcoded list of output
formats (more or less sorted by quality). This had some unintended side-
effects, like not using obvious "replacement" formats, selecting the
wrong colorspace, selecting a bit depth that is too high or too low, and
more.

Use avcodec_find_best_pix_fmt_of_list() provided by FFmpeg instead. This
function was made for this purpose, and should select the "best" format.

Libav provides a similar function, but with a different name - there is
a function with the same name in FFmpeg, but it has different semantics
(I'm not sure if Libav or FFmpeg fucked up here).

This also removes handling of VFCAP_CSP_SUPPORTED vs.
VFCAP_CSP_SUPPORTED_BY_HW, which has no meaning anymore, except possibly
for filter chains with multiple scale filters.

Fixes #1494.
2015-01-21 18:33:47 +01:00
wm4 206cfd964c vf: make message less confusing
Well, probably still not very good, but now at least accounts for the
case the decoder or a filter outputs nonsense values.
2015-01-13 14:40:37 +01:00
wm4 f61b8b312d win32: request UTF-16 API variants, Vista+ APIs, and COM C macros
Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into
the build system, instead of defining them over and over in the code.
2015-01-07 21:42:44 +01:00
wm4 589e70e17d vf_vapoursynth: autodetect CPU count
This adds an "auto" choice to the concurrent-frames suboption, and makes
it the default.

I'm not so sure about making this the default, though. It could lead to
excessive buffering with large CPU counts. But we'll see.
2015-01-05 12:49:13 +01:00
wm4 d5f1170679 vf_vapoursynth: fix Lua backend
It couldn't handle the newly added float variable.
2015-01-03 14:44:20 +01:00
wm4 bfac1e81a6 vf_vapoursynth: pass through container FPS value
This is basically a hack; but apparently a needed one, since many
vapoursynth filters insist on having a FPS set.

We need to apply the FPS override before creating the filters. Also
change some terminal output related to the FPS value.
2015-01-03 03:37:05 +01:00
wm4 f5ed13bcd4 video: better pipelining with vf_vapoursynth
Most of this is explained in the code comments. This change should
improve performance with vapoursynth, especially if concurrent requests
are used.

This should change nothing if vf_vapoursynth is not in the filter chain,
since non-threaded filters obviously can not asynchronously finish
filtering of frames.
2015-01-03 03:01:58 +01:00
wm4 63a414c708 command: make empty vf-metadata not an error
If a filter exists, but has no metadata, just return success. This
allows the user to distinguish between no metadata available, and filter
not inserted.

See #1408.
2014-12-30 14:04:53 +01:00
wm4 a5832ba019 vf: fix crash if filter doesn't provide control entrypoint
This input command crashed:

    vf add @mf:format=yuv420p ; show_text "${vf-metadata/mf}"

Fixes #1408.
2014-12-30 13:21:41 +01:00
wm4 185e95ee3d video: remove internal QP passing
This was required by vf_pp, which was just removed.

vf_dlopen has this stuff in its API. This API is considered stable, so
the related fields are not removed from it. But the fields are always 0
now, so there's no point in keeping the example program around.

vf_pullup.c did some extremely awkward passthrough of this information,
but didn't actually use it.
2014-12-03 23:01:20 +01:00
wm4 809936fdb9 video/filter: kill vf_pp (libpostproc)
This is an ancient filter, and we assume it's not useful anymore.

If you really want this, it's still available in libavfilter (e.g. via
--vf=lavfi=[pp...]). The disadvantage is that mpv doesn't pass through
QP information to libavfilter. (This was probably the reason vf_pp still
was part of mpv - it was slightly easier to pass QP internally.)
2014-12-03 23:01:19 +01:00
wm4 86b521f7df Silence some Coverity warnings
None of this really matters.
2014-11-21 09:59:58 +01:00
wm4 4136531343 video: move formatting of image parameters to separate function 2014-11-12 19:30:59 +01:00
wm4 509997ec12 vf: minor simplification
Remove the extra vf_chain.output field - there's absolutely no need for
it, because there is always a last filter which will buffer the output.

For some reason, vf_chain.last was never set, which we now need to fix
too.
2014-11-12 19:30:59 +01:00
wm4 481ab94c4e vf_sub: fix previous commit
The previous fix breaks another obscure case: if the second vf_sub adds
margins, the image is accidentally not extended, which would return in
an assertion failure when returning the bogus image.
2014-11-11 19:26:43 +01:00
wm4 599a4a8769 vf_sub: don't crash if no subtitle context is available
Happens with --vf=sub,sub (only the first one gets the context).
2014-11-11 18:47:21 +01:00
wm4 a7686e86ff video: remove swapped-endian image format aliases
Like the previous commit, this removes names only, not actual support
for these formats.
2014-11-05 01:52:20 +01:00
wm4 ceba1d446a vf_vapoursynth: add debug message when returning error from GetFrame
Some filters still (or will) behave badly on these errors, so explicitly
log when it happens.
2014-10-13 14:35:03 +02:00
wm4 385e1ccbce vf_vapoursynth: don't error if invoke() doesn't return a clip
Not all functions are for creating filters. Consider for example
LoadPlugin.
2014-10-12 20:25:25 +02:00
wm4 7b0c58ab49 vf_vapoursynth: resolve paths relative to home/config
This affects the script filename passed to the filter. Resolve "~" (and
some other variants) as described in the "Paths" section of mpv.rst.
2014-10-12 20:24:20 +02:00
wm4 3093d93e1f vf_vapoursynth: add standalone Lua scripting 2014-10-12 01:33:10 +02:00
wm4 1b4f51ae73 vf_vapoursynth: abstract scripting backend
In theory, vsscript should be doing it, but it's not there yet, neither
did there seem to be any interest in making it flexible enough to handle
more than 1 scripting language.
2014-10-12 01:33:09 +02:00
wm4 227e470ee2 vf_vapoursynth: return dummy frames if frames are requested during init
An attempt at fixing #1168.

I see black frames flashing, so it's certainly not perfect.
2014-10-11 18:17:20 +02:00
wm4 46b16cf206 vf_vapoursynth: factor stuff 2014-10-11 18:16:09 +02:00
wm4 54e2ca809c vf_vapoursynth: when seeking, recreate only if it's already created 2014-10-11 18:15:38 +02:00
wm4 ab41b8d27b vf_vapoursynth: fail gracefully if filter init requests frames
Some VS filters will requests frames from their parent filters while
they're initialized. Thy do this in a blocking manner, and
initialization will not succeed until the frame request is satisfied.
This deadlocked mpv, because we can feed frames to the filter only after
initialization is finished.

Return an error instead of deadlocking.

Note that we (probably) can handle frames being requested during init
fine, as long as the requests don't block initialization. But we can
distinguish this situation, and a simple test seems to indicate VS
usually doesn't do this.

See #1168.
2014-10-11 13:25:38 +02:00
wm4 fef9ea5f62 vf_lavfi: proper rounding for lavfi->mpv aspect ratio
Or so I think. Not like it matters anyway.
2014-10-09 18:18:05 +02:00
wm4 014547bdc2 vf_lavfi: fix compilation failure
Apparently this fails to compile with clang6. Patch by someone else.

CC: @mpv-player/stable
2014-10-08 12:44:47 +02:00
Alessandro Ghedini d02275d35a vf_stereo3d: fix "auto" input format with libav 2014-10-04 16:28:30 +02:00
wm4 aeaa1767e9 Fix build with libavfilter disabled
Although I'm not sure why we even support this.
2014-09-28 19:10:50 +02:00