vo_x11 had a clever trick to implement a video equalizer: it requested a
DirectColor visual. This is a X11 mechanism which allows you to specify
a lookup table for each color channel. Effectively, this is a safe
override for the graphic card's gamma ramp. If X thinks the window
deserves priority over other windows in the system, X would temporarily
switch the gamma ramp so that DirectColor visuals can be displayed as
the application intends. (I'm not sure what the exact policy is, but in
practice, this meant the equalizer worked when the mouse button was
inside the window.)
But all in all, this is just lots of useless code for a feature that is
rarely ever useful. Remove it and use the libswscale equalizer instead.
(This comes without a cost, since vo_x11 already uses libswscale.)
One worry was that using DirectColor could have made it work better in
8-bit paletted mode. But this is not the case: there's no difference,
and in both cases, the video looks equally bad.
Considering that we use version control, maintaining an AUTHORS file
doesn't make much sense, and indeed it was barely touched since the time
mplayer2 forked from MPlayer. None of the contributors to mplayer2 or
mpv are listed in this file (even uau's work is not appropriately
reflected, despite having an entry in this file).
I'm removing this file because it's obviously pointless to keep around,
and moreover it's misleading.
In theory removing this file might be questionable: the git log reaches
back into CVS and SVN times, which don't have separate committer and
author fields for each comment. The commit messages could be incomplete
and not mention the original author, while the AUTHORS file somehow
could. I doubt this is a real concern, since you can always reconstruct
the original AUTHORS file from git.
Another concern is that this could be interpreted as disrespectful to
the people mentioned in this file; but it isn't meant to be
disrespectful.
Also point out a slight irregularity in the Copyright file.
Commit 884c179 attempted to make it possible to skip backwards through
the playlist, even for files which fail to intitialize, or play for a
very short time. This was also used to prevent mpv from looping forever
and doing nothing if --loop=inf is used, and no file in the playlist is
playable.
This broke looping of very short files, because mpv was assuming that
this case happened. But there are legitimate use cases.
Fix this by making the looping case special. Instead of checking whether
playback was "very short", check whether something could be decoded and
displayed/played. If yes, allow looping.
After rebasing my dev branch it turned out that the code deadlocked on
recursive calls of `vo_control`. Make the locking code a little bit smarter
by making always skip locking/unlocking if we are executing a chunck of
code that is already synchronized with `dispatch_sync`.
Split the code to several files. The GUI elements now each have they own files
and private state. The original code was a mess to respect the retarded mplayer
convention of having everything in a single file.
This commit also seems to fix the long running bug of artifacts showing
randomly when going fullscreen using nVidia GPUs.
Don't allocate a VAImage and a mp_image every time. VAImage are cached
in the surfaces themselves, and for mp_image an explicit pool is
created. The retry loop runs only once for each surface now.
This also makes use of vaDeriveImage() if possible.
Until now, mouse positions were just passed to the core as-is, even if
the mouse coordinates didn't map to any useful coordinate space, like
OSD coordinates. Lua scripting (used by the OSC, the only current user
of mouse input) had to translate mouse coordinates manually to OSD space
using mp_get_osd_mouse_pos(). This actually didn't work correctly in
cases mouse coordinates didn't map to OSD (like vo_xv): the mouse
coordinates the OSC got were correct, but input.c was still expecting
"real" mosue coordinates for mouse areas.
Fix this by converting to OSD coordinates before passing the mouse
position to the core.
Do this so that MOUSE_LEAVE can't be combined with other keys. (E.g.
keep 'w' pressed, then move the mouse outside of the mpv window; it will
print a warning what w-MOUSE_LEAVE is not mapped.)
It appears the last run missed all mp_tmsg().
Since the command parser also prints messages, it needs a new parameter
to pass a log context. We go the easy way and just require the input_ctx
to be passed, and use its mp_log.
There is uninitialized memory access if the actual size isn't passed
along. In the worst case, this can cause a source to be loaded against
the uninitialized memory, causing a false count of found versus required
sources, preventing the "Failed to find ordered chapter part" message.
This is pretty much a hack for the OSC. It will allow it to rely on a
somewhat predictable style, instead of having to overwrite all user
OSD settings manually with override tags.
Nothing really accesses it. Subtitle initialization actually does in a
somewhat meaningful way, but there container size is probably fine, as
subtitles were always initialized before the first video frame was
decoded.
Now writing -1 to the 'aspect' property resets the video to the auto
aspect ratio. Returning the aspect from the property becomes a bit more
complicated, because we still try to return the container aspect ratio
if no frame has been decoded yet.
This function would probably be useful in other places too.
I'm not sure why vd.c doesn't apply the aspect if it changes size by
less than 4 pixels. Maybe it's supposed to avoid ugly results with bad
scalers if the difference is too small to be noticed normally.
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
This time it broke because I didn't actually test compiling vo_vaapi.c,
and it was using a macro from mp_image.h, which implicitly assumed
FFALIGN was available. Screw that too, and copy the definition of
ffmpeg's FFALIGN to MP_ALIGN_UP, and move these macros to mp_comnon.h.
The code using FFSWAP was moved from vo_vaapi.c to vaapi.c, which didn't
include libavutil/common.h anymore, just libavutil/avutil.h. The header
avutil.h doesn't include common.h recursively in Libav, so it broke
there.
Add FFSWAP as MPSWAP in mp_common.h (copy pasted from ffmpeg) to make
sure this doesn't happen again. (This kind of stuff happens all too
often, so screw libavutil.)
This code is actually quite inefficient: it reuses the (slow, simple)
screenshot code. It uses an inefficient method to read the image
(vaGetImage() instead of vaDeriveImage()), allocates new memory for
each frame that is read, and it tries all image formats again each
time.
Also, in my tests it always picked NV12 as image format, which is not
ideal if you actually want to filter the video, and vo_xv can't handle
this format without conversion either.
However, a user confirmed that it worked for him, so everything is fine.
This will allow GPU read-back with process_image.
We have to restructure how init_vo() works. Instead of initializing the
VO before process_image is called, rename init_vo() to
update_image_params(), and let it update the params only. Then we really
initialize the VO after process_image.
As a consequence of these changes, already decoded hw frames are
correctly unreferenced if creation of the filter chain fails. This
could trigger assertions on VO uninitialization, because it's not
allowed to reference hw frames past VO lifetime.
Merged from pull request #246 by xylosper. Minor cosmetic changes, some
adjustments (compatibility with older libva versions), and manpage
additions by wm4.
Signed-off-by: wm4 <wm4@nowhere>
This code was made inactive some months ago. At this time it wasn't
entirely clear whether this code was still needed, but now I'm pretty
sure it isn't. Even if it is, it didn't work anymore.
This wasn't enough and could lead to a cut off message shown on OSD.
Just make it dynamic, since we already use dynamic memory allocation
at this point anyway.
Moving the window was convenient but generates a MOUSE_LEAVE event
which it shouldn't. Now we remove it, because it is still possible
to move the window in weston with MOD+BTN0.