Commit Graph

42025 Commits

Author SHA1 Message Date
wm4 3ccac74de2 video: remove codec delay estimation
This was used only by the timestamp sorting code, which is a fallback
for avi files (as well as avi-muxed mkv files). This was supposed to
prevent accumulating timestamps in case the decoder consumes more
packets than it outputs frames (i.e. frames are dropped). This didn't
work very well (timestamps could be off by a large amount), the
estimation of the delay was fragile, and the interdependencies with the
decoder were annoying, so kill it.
2015-10-03 22:10:44 +02:00
wm4 ee283843fa video: cosmetics: remove trailing whitespace 2015-10-03 21:21:27 +02:00
wm4 291f301c10 video/out: remove an unused parameter
This parameter has been unused for years (the last flag was removed in
commit d658b115). Get rid of it.

This affects the general VO API, as well as the vo_opengl backend API,
so it touches a lot of files.

The VOFLAGs are still used to control OpenGL context creation, so move
them to the OpenGL backend code.
2015-10-03 18:20:16 +02:00
wm4 e448e10fd7 vo: change some defines to enums
Why not.
2015-10-02 18:49:35 +02:00
wm4 e72ca08554 vo_opengl: drop old backend API 2015-10-02 18:49:35 +02:00
wm4 e87f705497 vo_opengl: rpi: switch to new internal API 2015-10-02 18:33:09 +02:00
wm4 93db4233af win32: cleanup: remove some unneeded things 2015-10-02 18:14:00 +02:00
wm4 fe993a6712 vo_opengl: w32: switch to new internal API 2015-10-02 18:10:58 +02:00
wm4 69bc7e34b9 vo_opengl: refactor DwmFlush crap
Get it out of the way in the common code. MPGLContext.dwm_flush_opt can
be removed as well as soon as the option system gets overhauled.
2015-10-02 17:59:05 +02:00
Emmanuel Gil Peyrot a9ed9e329c vo_opengl: remove leftover variable from vaglx in vaegl
This was preventing compilation on systems without X11 headers.
2015-10-02 03:49:02 +01:00
Emmanuel Gil Peyrot 8a21cb1cd3 vo: fix compilation failure when vaapi is enabled and x11 disabled
This was previously trying to use the video_output_vaapi symbol despite
vo_vaapi.c being guarded by the vaapi-x11 option.
2015-10-02 03:21:51 +01:00
wm4 bd87598af9 vo_opengl: wayland: switch to new internal API 2015-10-01 22:57:02 +02:00
wm4 f4d62da8f0 vo_opengl: cocoa: switch to new internal API 2015-10-01 22:42:25 +02:00
wm4 ae7212963e cue: read more metadata
Make handling of metadata slightly more generic, and add reading of the
"PERFORMER" fields. There are some more fields, but for now let's leave
it at this.

TRACK-specific PERFORMER fields have to be read from the per-chapter
metadata (somewhat obscure).

Fixes #2328.
2015-10-01 21:57:35 +02:00
wm4 24f34c9e8e player: print tags under different log prefix
A minor, but apparently common feature request. Fixes #2360.
2015-10-01 21:10:59 +02:00
wm4 98c4ab6d13 vo_opengl: make sw suboption work without explicit backend selection
You needed to select a GL backend with the backend suboption. This was
confusing.

Fixes #2361.
2015-10-01 20:57:29 +02:00
wm4 4a07205963 vo_opengl: debanding requires GLSL 1.30
We have to disable it, or shader compilation will fail.

Fixes #2362.
2015-10-01 20:44:39 +02:00
wm4 7c5f41ff5f x11: separate window creation and configuration
This gets rid of an old hack, VOFLAG_HIDDEN. Although handling of it has
been sane for a while, it used to cause much pain, and is still
unintuitive and weird even today.

The main reason for this hack is that OpenGL selects a X11 Visual for
you, and you're supposed to use this Visual when creating the X window
for the OpenGL context. Which means the X window can't be created early
in the common X11 init code, but the OpenGL code needs to do something
before that. API-wise you need separate functions for X11 init and X11
window creation. The VOFLAG_HIDDEN hack conflated window creation and
the entrypoint for resizing on video resolution change into one
function, vo_x11_config_vo_window(). This required all platform backends
to handle this flag, even if they didn't need this mechanism.

Wayland still uses this for minor reasons (alpha support?), so the
wayland backend must be changed before the flag can be entirely removed.
2015-09-30 23:31:34 +02:00
wm4 a2a2cdb5bc vo_opengl: cosmetics: coding style 2015-09-30 23:05:42 +02:00
wm4 41bf41e416 vo_opengl: do not reset video queue when changing video equalizer
If interpolation is enabled, then this causes heavy artifacts if done
while unpaused. It's preferable to allow a latency of a few frames for
the change to take full effect instead. If this is done paused, the
frame is fully redrawn anyway.
2015-09-30 22:59:34 +02:00
wm4 ebb43f5176 Revert "vo_x11: remove this video output"
This reverts commit d11184a256.

Unfortunately, there was a lot of unexpected resistance.

Do note that this is still extremely slow, crappy, etc.

Note that vo_x11.c was further edited. Compared to the removed vo_x11.c,
an additional ~200 lines of code was removed in order to simplify it. I
tried to strip it down as much as possible. In particular, support for
odd non-32 bit formats (24, 16, 15, 8 bit) is dropped.

Closes #2300.
2015-09-30 22:52:22 +02:00
wm4 aff6e8e8da stream: minor cleanup to verbose logging
Don't print the URL that is opened twice. stream.c and stream_lavf.c
each printed it once. Remove the logging from stream_lavf.c, and move
the log call to a more interesting point.
2015-09-30 22:51:37 +02:00
ChrisK2 1b7e8ff6c5 ytdl: Don't override user-set format in no-video mode 2015-09-30 22:28:01 +02:00
wm4 739452361f manpage: adjustments to hwdec remarks 2015-09-29 21:14:56 +02:00
wm4 ee63c9c210 video: replace vf_format outputlevels option with global option
The vf_format suboption is replaced with --video-output-levels (a global
option and property). In particular, the parameter is removed from
mp_image_params. The mechanism is moved to the "video equalizer", which
also handles common video output customization like brightness and
contrast controls.

The new code is slightly cleaner, and the top-level option is slightly
more user-friendly than as vf_format sub-option.
2015-09-29 21:12:26 +02:00
wm4 b4491c00c4 Take care of libavcodec convergence_duration deprecation
This AVPacket field was a hack against the fact that the duration field
was merely an int (too small for things like subtitle durations). Newer
libavcodec drops this field and makes duration 64 bit.
2015-09-29 18:43:28 +02:00
wm4 12cd48a8a9 Revert "vd_lavc: do not abort hardware decoding on errors"
This essentially reverts commit 009dfbe3. FFmpeg VideoToolbox support
is being wacky, and can cause major issues, such as not being able
to decode a single frame. (E.g. by playing a .ts file. This should be
fixed in FFmpeg eventually.)

This is not a straight revert of the commit; just a functional one. We
keep the slightly simpler code structure.
2015-09-28 22:31:47 +02:00
wm4 31316e9ca0 vo_opengl: videotoolbox: cleanups
Get rid of the VDA specifics like naming or ancient pixel formats.
2015-09-28 22:11:04 +02:00
wm4 853fe788f8 vo_opengl: rename hwdec_vda.c to hwdec_osx.c
It doesn't deal with VDA at all anymore. Rename it to hwdec_osx.c. Not
using hwdec_videotoolbox.c, because that would give it the longest
source path in this project yet. (Also, this code isn't even
VideoToolox-specific, other than the name of the pixel format used.)
2015-09-28 22:03:14 +02:00
wm4 1dd7b7bddc video: remove VDA support
VideoToolbox is preferred. Now that FFmpeg released 2.8, there's no
reason to support VDA anymore. In fact, we had a bug that made VDA not
useable with older FFmpeg versions in some newer mpv releases.

VideoToolbox is supported even on slightly older OSX versions, and if
not, you still can run mpv without hw decoding.
2015-09-28 22:03:14 +02:00
wm4 15ef9f9ee6 vd_lavc: remove some ancient cargo-culting
Definitely not needed anymore, and fixes a crash in some weird corner-
cases.

The extradata freeing is apparently still needed, though. (Because a
codec context can be opened again, which makes no sense, but ok.)
2015-09-28 22:03:14 +02:00
wm4 ad2ab5893e ao_alsa: improve handling of device disconnection
This can happen with USB audio. There was already code for this, but
something in mpv and ALSA changed - and now the old code is not
necessarily triggered anymore. It probably depends on the exact
situation.
2015-09-28 22:03:14 +02:00
wm4 144571da9b ao_coreaudio_utils: fix error handling in device listing code
This could sometimes cause crashes in hotplug events. (Apparently in
cases when CoreAudio changes its state asynchronously, or such.)

CA_GET_STR() does not set the string if there was an error, so errors
have to be strictly checked before using it.
2015-09-28 22:03:14 +02:00
wm4 8aa8417aa3 vo_opengl: vaapi: add Wayland support
Pretty trivial with the new EGL interop.

Fixes #478.
2015-09-27 21:38:45 +02:00
wm4 1fa674c109 vo_opengl: refactor EGL context information callback
Move the ugliness from x11egl.c to common.c, so that the ugliness
doesn't have to be duplicated in wayland.c.
2015-09-27 21:34:11 +02:00
wm4 710872bc22 vaapi: remove dependency on X11
There are at least 2 ways of using VAAPI without X11 (Wayland, DRM).
Remove the X11 requirement from the decoder part and the EGL interop.
This will be used by a following commit, which adds Wayland support.

The worst about this is the decoder part, which includes a bad hack for
using the decoder without any VO interop (also known as "vaapi-copy"
mode). Separate the X11 parts so that they're self-contained. For the
EGL interop code we do something similar (it's kept slightly simpler,
because it essentially only has to translate between our silly
MPGetNativeDisplay abstraction and the vaGetDisplay...() call).
2015-09-27 21:33:15 +02:00
wm4 1ff32236fa manpage: fix broken example
Fixes #2353.
2015-09-27 19:21:37 +02:00
wm4 2a7811176c vo_opengl: vaapi: provide symbols for missing extensions
We also could just check at build time, but since it's not much, just
redefine them inline if not present.
2015-09-27 16:25:03 +02:00
wm4 2e5df94f0f vo_opengl: vaapi: redo how EGL extensions are loaded
It looks like my hope that we can unconditionally include EGL headers in
the OpenGL code is not coming true, because OSX does not support EGL at
all. So I prefer loading the VAAPI EGL/GL specific extensions manually,
because it's less of a mess. Partially reverts commit d47dff3f.
2015-09-27 16:18:06 +02:00
wm4 0c494c238a vo_opengl: rpi: fix EGL comment
While EGL 1.4 seemed a bit ambiguous about this to me, it actually says
quite clearly that core functions are not supported with
eglGetProcAddress() in the following paragraph.
2015-09-27 16:07:18 +02:00
wm4 375886c777 vo_opengl: probe for EGL by default
Normally, we prefer GLX on X11. But for the VAAPI EGL interop, we
obviously want EGL. Since nvidia does not provide EGL with desktop GL
yet, we can leave it to the autoprobing. Just make sure some failure
messages don't unnecessarily show up in the nvidia case.

This breaks VAAPI GLX interop by default, but I don't care much. If
you use --hwdec=auto (which you should if you want hw decoding), this
should fallback to vaapi-copy instead.
2015-09-26 20:52:10 +02:00
wm4 0aa548457f vo_opengl: x11egl: cleanup uninit path
Get rid of the config_window_x11_egl() indirection.
2015-09-26 20:52:10 +02:00
wm4 e0cb65e8ac vo_opengl: vaapi: probe the surface format
Probe the surface format, and check whether it's really something we
support. This also does a complete check whether the EGL interop works
at all (the only way to find this out is actually running this code).
Also, support YV12. Under some circumstances, vaapi (with Intel
drivers) can be made to use this format.

Unfortunately, the Intel drivers show some very weird behavior, which
is hopefully a bug. insane_hack() provides a very evil workaround (see
comments). A proper solution might be passing the hw format as part of
mp_image_params, but as long as hw surfaces appear to be able to change
the format on the fly, attempting this is probably not worth the extra
complexity and likely fragility. The hack allows us to pretend that
there is sane behavior for now.
2015-09-26 20:52:10 +02:00
wm4 6875e6a779 wscript: add missing entry to help output
Fixes #2344.
2015-09-25 20:50:04 +02:00
wm4 ac5538c7df vaapi: use GPU memcpy for reading back from HW surface
This makes it much faster if the surface is really mapped from GPU
memory. It's slightly slower than system memcpy if used on system
memory. We don't really know definitely in which type of memory
it's located, so we use the GPU memcpy in all cases.

Fixes #2317.
2015-09-25 19:18:16 +02:00
wm4 0ae8aebb89 video: refactor GPU memcpy usage
Make the GPU memcpy from the dxva2 code generally useful to other parts
of the player.

We need to check at configure time whether SSE intrinsics work at all.
(At least in this form, they won't work on clang, for example. It also
won't work on non-x86.)

Introduce a mp_image_copy_gpu(), and make the dxva2 code use it. Do some
awkward stuff to share the existing code used by mp_image_copy(). I'm
hoping that FFmpeg will sooner or later provide a function like this, so
we can remove most of this again. (There is a patch, bit it's stuck in
limbo since forever.)

All this is used by the following commit.
2015-09-25 19:18:16 +02:00
Philip Langdale 361040f9d9 vd_lavc: Fix recovery from vdpau preemption
Flushing buffers, and thereby triggering decoder reinitialisation
needs to happen before attempting, and failing, to decode.
2015-09-25 17:29:44 +02:00
wm4 d2281935b3 vo_rpi, wayland: fix build
Broken by commit d47dff3f. If something is going to include EGL.h,
header_fixes.h has to know. This definitely affected vo_rpi, and
probably affects wayland builds (with x11egl didabled) as well.
2015-09-25 16:02:15 +02:00
wm4 0a6c334b59 vo_opengl: vaapi: undo vaAcquireBufferHandle() correctly on error
Checking and resetting the VAImage.buf field is non-sense, even if it
happened to work out in the normal case. buf is actually freed when
vaDestroyImage() is called (not quite intuitive), and we need an extra
field to know whether vaReleaseBufferHandle() has to be called.
2015-09-25 12:14:19 +02:00
wm4 38b747bb67 vaapi: cosmetics, minor fixes
Printing "Using vaDeriveImage()" every frame is too verbose, so raise
the log level.

mp_image strides are in int and not unsigned int; fix this. It's not
like it actually matters, though.

Finish a comment.
2015-09-25 12:10:43 +02:00