summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Take care of libavcodec convergence_duration deprecationwm42015-09-294-1/+17
| | | | | | 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.
* Revert "vd_lavc: do not abort hardware decoding on errors"wm42015-09-281-0/+1
| | | | | | | | | | 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.
* vo_opengl: videotoolbox: cleanupswm42015-09-281-43/+26
| | | | Get rid of the VDA specifics like naming or ancient pixel formats.
* vo_opengl: rename hwdec_vda.c to hwdec_osx.cwm42015-09-282-1/+1
| | | | | | | 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.)
* video: remove VDA supportwm42015-09-2814-177/+4
| | | | | | | | | 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.
* vd_lavc: remove some ancient cargo-cultingwm42015-09-281-1/+0
| | | | | | | | 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.)
* ao_alsa: improve handling of device disconnectionwm42015-09-281-3/+20
| | | | | | | 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.
* ao_coreaudio_utils: fix error handling in device listing codewm42015-09-281-3/+10
| | | | | | | | 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.
* vo_opengl: vaapi: add Wayland supportwm42015-09-274-2/+31
| | | | | | Pretty trivial with the new EGL interop. Fixes #478.
* vo_opengl: refactor EGL context information callbackwm42015-09-275-17/+36
| | | | | Move the ugliness from x11egl.c to common.c, so that the ugliness doesn't have to be duplicated in wayland.c.
* vaapi: remove dependency on X11wm42015-09-278-28/+103
| | | | | | | | | | | | | 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).
* manpage: fix broken examplewm42015-09-271-1/+1
| | | | Fixes #2353.
* vo_opengl: vaapi: provide symbols for missing extensionswm42015-09-271-0/+14
| | | | | We also could just check at build time, but since it's not much, just redefine them inline if not present.
* vo_opengl: vaapi: redo how EGL extensions are loadedwm42015-09-277-66/+35
| | | | | | | 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.
* vo_opengl: rpi: fix EGL commentwm42015-09-271-4/+2
| | | | | | 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.
* vo_opengl: probe for EGL by defaultwm42015-09-262-5/+6
| | | | | | | | | | | 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.
* vo_opengl: x11egl: cleanup uninit pathwm42015-09-261-30/+26
| | | | Get rid of the config_window_x11_egl() indirection.
* vo_opengl: vaapi: probe the surface formatwm42015-09-261-2/+68
| | | | | | | | | | | | | | | | 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.
* wscript: add missing entry to help outputwm42015-09-251-1/+1
| | | | Fixes #2344.
* vaapi: use GPU memcpy for reading back from HW surfacewm42015-09-253-2/+7
| | | | | | | | | 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.
* video: refactor GPU memcpy usagewm42015-09-2510-82/+112
| | | | | | | | | | | | | | | | | 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.
* vd_lavc: Fix recovery from vdpau preemptionPhilip Langdale2015-09-251-3/+3
| | | | | Flushing buffers, and thereby triggering decoder reinitialisation needs to happen before attempting, and failing, to decode.
* vo_rpi, wayland: fix buildwm42015-09-252-7/+7
| | | | | | 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.
* vo_opengl: vaapi: undo vaAcquireBufferHandle() correctly on errorwm42015-09-251-2/+4
| | | | | | | 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.
* vaapi: cosmetics, minor fixeswm42015-09-251-3/+3
| | | | | | | | | | 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.
* vo_opengl: vaapi: handle YV12 correctlywm42015-09-251-0/+3
| | | | This specific FourCC has its planes swapped compared to FFmpeg yuv420p.
* vo_opengl: vaapi: document DRM fourcc upstream defineswm42015-09-251-3/+4
| | | | | | | | | | | Add the upstream symbolic names as comments. Normally, these should be defined in libdrm's drm_fourcc.h header. But DRM_FORMAT_R8 and DRM_FORMAT_GR88 are not defined anywhere, except in the kernel userland headers of Linux 4.3 (!). We don't want mpv to depend on bleeding-edge Linux kernel headers, so this will have to do. Also, just for completeness, add fourccs for the 3 and 4 channel formats. I didn't manage to test them, though.
* vo_opengl: vaapi: use dummy image to determine plane layoutwm42015-09-251-9/+8
| | | | | | | Reduces the amount of hardcoded assumptions about the layout drastically. (Now adding yuv420 support would be just adjusting an if, if you ignore the other problems, such as determining the hw format at all early enough.)
* vo_opengl: vaapi: remove unnecessary loopwm42015-09-251-2/+1
| | | | Not sure what I was thinking.
* vo_opengl: vaapi: fix cleanupwm42015-09-251-0/+2
| | | | | | | Don't call eglDestroyImageKHR() on the same ID possibly more than once. Clear the image reference on termination, or we would leak up to 1 image per VO recreation.
* vo_opengl: support new VAAPI EGL interopwm42015-09-256-0/+262
| | | | | | | | | | | | | | | | | | | | | | | Should work much better than the old GLX interop code. Requires Mesa 11, and explicitly selecting the X11 EGL backend with: --vo=opengl:backend=x11egl Should it turn out that the new interop works well, we will try to autodetect EGL by default. This code still uses some bad assumptions, like expecting surfaces to be in NV12. (This is probably ok, because virtually all HW will use this format. But we should at least check this on init or so, instead of failing to render an image if our assumption doesn't hold up.) This repo was a lot of help: https://github.com/gbeauchesne/ffvademo The kodi code was also helpful (the magic FourCC it uses for EGL_LINUX_DRM_FOURCC_EXT are nowhere documented, and EGL_IMAGE_INTERNAL_FORMAT_EXT as used in ffvademo does not actually exist). (This is the 3rd VAAPI GL interop that was implemented in this player.)
* vo_opengl: add mechanism to retrieve Display from EGL contextwm42015-09-253-1/+33
| | | | | | | | | | The VAAPI EGL interop code will need access to the X11 Display. While GLX could return it from the current GLX context, EGL has no such mechanism. (At least no standard one supported by all implementations.) So mpv makes up such a mechanism. For internal purposes, this is very rather awkward solution, but it's needed for libmpv anyway.
* vo_opengl: load certain EGL extensions needed for VAAPI EGL interopwm42015-09-256-1/+56
| | | | | | | | | These extensions use a bunch of EGL types, so we need to include the EGL headers in common.h to use our GL function loader with this. In the future, we should probably require presence of the EGL headers to reduce the hacks. This might be not so simple at least with OSX, so for now this has to do.
* vo_opengl: enable X11 EGL backend by defaultwm42015-09-241-1/+0
| | | | | Originally, this was disabled, because it was useless and I was afraid it could possibly break autodetection and proper fallback.
* vo_opengl: actually set hardware decoder mapped texture formatwm42015-09-244-3/+6
| | | | | | | | | | | Surfaces used by hardware decoding formats can be mapped exactly like a specific software pixel format, e.g. RGBA or NV12. p->image_params is supposed to be set to this format, but it wasn't. (How did this ever work?) Also, setting params->imgfmt in the hwdec interop drivers is pointless and redundant. (Change them to asserts, because why not.)
* client API: rename GL_MP_D3D_interfaceswm42015-09-246-15/+46
| | | | | | | | | | | | | This is a pseudo-OpenGL extension for letting libmpv query native windowing system handles from the API user. (It uses the OpenGL extension mechanism because I'm lazy. In theory it would be nicer to let the user pass them with mpv_opengl_cb_init_gl(), but this would require a more intrusive API change to extend its argument list.) The naming of the extension and associated function was unnecessarily Windows specific (using "D3D"), even though it would work just fine for other platforms. So deprecate the old names and introduce new ones. The old ones still work.
* vo_opengl: remove sharpen scalers, add sharpen sub-optionwm42015-09-237-53/+49
| | | | | | | | | | | | This turns the old scalers (inherited from MPlayer) into a pre- processing step (after color conversion and before scaling). The code for the "sharpen5" scaler is reused for this. The main reason MPlayer implemented this as scalers was perhaps because FBOs were too expensive, and making it a scaler allowed to implement this in 1 pass. But unsharp masking is not really a scaler, and I would guess the result is more like combining bilinear scaling and unsharp masking.
* vo_opengl: move deband_opts declaration to where it's usedwm42015-09-232-8/+8
| | | | At least one thing the current option code can do right.
* vo_opengl: remove unsued chroma_location fieldwm42015-09-232-2/+0
| | | | | This was redundant to forcing the value with vf_format, so the vo_opengl sub-option was removed. This field is just a leftover.
* vo_opengl: move shader file caching to video.cwm42015-09-234-50/+44
| | | | | | It's just about loading and cachign small files, not does not necessarily have anything to do with shaders. Move it to video.c where it's used.
* player: fix another --force-window bugwm42015-09-231-1/+1
| | | | | | Will this shit ever actually work? Fixes #2339.
* vd_lavc: do not abort hardware decoding on errorswm42015-09-231-8/+7
| | | | | | | | | | Usually, libavcodec ignores errors reported by the hardware decoding API, so it's not like we can actually escape if the hardware is somehow acting up. For normal fallback purposes, or if parts of the hw decoding API which we actually check fails, we do this by setting and checking the hwdec_failed flag anyway.
* vf_vavpp: allocate output surfaces with the same size as inputwm42015-09-233-1/+15
| | | | | | | | | | | | | This can happen if the hw decoder allocates padded surfaces (e.g. mod16), but the VPP output surface was allocated with the exact size. Apparently VPP requires matching input and output sizes, or it will add artifacts. In this case, it added mirrored pixels to the bottom few pixels. Note that the previous commit should have fixed this. But it didn't work, while this commit does. Fixes #2320.
* va_vavpp: set input/output processing regionwm42015-09-231-2/+2
| | | | | | | | If not set, VPP will use the whole surface. This is a problem if the surfaces are padded, and especially if the surfaces are padded by different amounts. This is an attempt to fix #2320, but it appears to do nothing at all.
* vd_lavc: minor cleanup to hwdec fallback codewm42015-09-231-15/+8
| | | | | | | | | The comment was largely outdated, and described the old situation when we used a "violent" fallback by making get_buffer2 fail completely. Also, for the case when the hw decoder initialization succeeded (in get_format), but get_buffer2 for some reason requests something unexpected, we also can fallback more gracefully and in the same way.
* DOCS: update client API changes for releaseMartin Herkt2015-09-231-1/+1
|
* DOCS: update release policyMartin Herkt2015-09-231-27/+69
|
* win32: allow multiple windows at the same timewm42015-09-221-6/+1
| | | | | | | | | | | | | | | | Window classes are process-wide (or at least DLL-wide), so you can't have 2 classes with the same name. Our code attempted to do this when for example 2 libmpv instances were created within the same process. This failed, because RegisterWindowEx() fails if the class already exists. Fix this by ignoring RegisterWindowEx() errors. If the class can really not be registered, we will fail on CreateWindowEx() instead. Of course we also can't unregister the class, as another thread might be using it. Windows will free the class automatically if the DLL is unloaded or the process terminates. Fixes #2319 (hopefully).
* build: allow disabling vapoursynth completelywm42015-09-221-7/+8
| | | | | | | | | | | It's possible to build vf_vapoursynth with either the Python or Lua backend (or both or none). The check for the vapoursynth core itself was hidden away and couldn't be disabled, which would link mpv with vapoursynth even if all backends were disabled. Rearrange the checks so that the core will be disabled if no backend is found (or both are disabled). This duplicates the check for vapoursynth.pc, but since it's trivial, this is not that bad.
* player: fix excessive CPU usage in audio-only modewm42015-09-221-3/+4
| | | | | | | | | Caused by one of the --force-window commits. The unconditional uninit_video_out() call (which normally should be idempotent) raised sporadic MPV_EVENT_VIDEO_RECONFIG events. This is ok, except for the fact that clients (like a Lua script or libmpv users) would cause the event loop to run again after receiving it, triggering a feedback loop. Fix it by sending the events really only on a change.
* player: some more --force-window fixeswm42015-09-212-12/+17
| | | | | | | | | | | | | Sigh... After the recent changes, another regression appeared. This time, the VO window wasn't cleared when changing from video to a non- video file (such as audio-only with no cover art). Fix this by properly taking the handle_force_window() bool parameter into account. Also, the info message could be printed twice, which is harmless but ugly. So just remove the message. Also, do some more minor cleanups (like fixing the comment, which was completely outdated).
* player: do not destroy VO prematurely when initializing playbackwm42015-09-201-1/+2
| | | | | | | | | | If --force-window wasn't used, this would destroy the VO while a file is still being loaded, resulting in flicker and other interruptions when switching from one playlist entry to another. Recent regression. The condition used here is pretty tricky, but it boils down to that it should trigger either in idle mode, or when loading has been fully done (at these points we definitely know whether the VO will be needed).
* player: rename and move find_subfiles.cwm42015-09-206-5/+5
| | | | | | This was in sub/, because the code used to be specific to subtitles. It was extended to automatically load external audio files too, and moving the file and renaming it was long overdue.
* player: add opus to list of external audio file extensionswm42015-09-201-1/+1
| | | | Fixes #2336.
* player: make force-window in auto-profiles actually workwm42015-09-204-29/+36
| | | | | | | | | | | The previous commit was incomplete (and I didn't notice due to a broken test procedure). The annoying part is that actually creating the VO was separate; redo this and merge the code for this into handle_force_window() as well. This will also make implementing proper reaction to runtime option changes easier. (Only the part for actually listening to option changes is missing.)
* player: make force-window=immediate work in auto-profileswm42015-09-201-0/+3
| | | | | | This is a bad hack; the correct way to handle this would be implementing profiles differently, and then listen to option changes and act on them dynamically.
* vf_yadif: add hack for Libav compatibilitywm42015-09-201-3/+12
| | | | | | Libav accepts slightly different options compared to FFmpeg. Sigh... This was "broken" in 25755f5f. Fixes #2335.
* audio/filter: remove reentrancy flagwm42015-09-205-22/+1
| | | | | | | | | | This flag was used by some filters and made sure none of these filters were inserted twice. This triggers only if the user explicitly tries to add multiple filters (and not e.g. due to auto-insertion), so at best this warned the user from doing something potentially pointless. At worst, it blocked some (mildly) legitimate use-cases. Get rid of it. Also see #2322.
* TOOLS/zsh.pl: only check the actual exit code when calling mpvPhilip Sequeira2015-09-201-2/+2
| | | | | Ignore the other bits of $?. Apparently they can be set even if the command succeeded.
* vf_vdpaurb: query_format is still requiredPhilip Langdale2015-09-181-0/+6
| | | | | | | I took this out because I thought the filter chain would auto-negotiate using nv12 without the explicit hint, and it does in the basic case with no intermediate filter, but once you start adding filters, it can end up negotiating a different format and then failing.
* vf_vdpaurb: Pass through non-hardware-decoded contentPhilip Langdale2015-09-151-9/+8
| | | | | | | | | | Today, vdpaurb will fail if it's used with non-hardware-decoded content. This created work for the user as they have to explicitly add or not add it, depending on the content. As an improvement, we can make vd