summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vo_opengl: add optional hook pointsNiklas Haas2016-05-153-90/+140
| | | | | | | | | | | | | | These are "sequence points" where the image could be rendered out to an FBO, hooked, and re-loaded if any such hook exists. This is perfect for things like the current user shaders system, as well as optional effects like unsharp masking. Note that since we have to pick *some* FBO to store the optionally hooked texture, we just store it in an array indexed by an increasing counter. Since we only ever store as many as MAX_TEXTURE_HOOKS + all internal hook points entries, this is guaranteed to be enough space. This commit also removes some of the now unused FBOs.
* vo_opengl: add hooks and rework pass_read_videoNiklas Haas2016-05-152-232/+448
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hook mechanism allows arbitrary processing stages to get dispatched whenever certain named textures have been "finalized" by the code. This is mostly meant to serve as a change that opens up the internal processing in pass_read_video to user scripts, but as a side benefit all of the code dealing with offsets and plane alignment and other such confusing things has been rewritten. This hook mechanism is powerful enough to cover the needs of both debanding and prescaling (and more), so as a result they can be removed from pass_read_video entirely and implemented through hooks. Some avenues for optimization: - The prescale hook is currently somewhat distributed code-wise. It might be cleaner to split it into superxbr and NNEDI3 hooks which can each be self-contained. - It might be possible to move a large part of the hook code out to an external file (including the hook definitions for debanding and prescaling), which would be very much desired. - Currently, some stages (chroma merging, integer conversion) will *always* run even if unnecessary. I'm planning another series of refactors (deferred img_tex) to allow dropping unnecessary shader stages like these, but that's probably some ways away. In the meantime it would be doable to re-add some of the logic to skip these stages if we know we don't need them. - More hook locations could be added (?)
* vo_opengl: minor change to scaler_resizes_onlyNiklas Haas2016-05-151-3/+6
| | | | | | Instead of rounding down, we round to the nearest float. This reduces the maximum possible error introduced by this rounding operation. Also clarify the comment.
* vaapi: avoid forward declaration of variablewm42016-05-151-9/+7
| | | | Why is everything so horrible.
* lua: add timer:is_enabled() functionJulian2016-05-142-0/+8
| | | | | Allows to query if some timer is currently running or was stopped/killed.
* vo_opengl: remove some pointless compatibilitywm42016-05-142-4/+3
| | | | | | Remove non-texture_rg compatibility from LUT sampling. OpenGL without texture_rg support will always trigger dumb-mode, and dumb-mode does not use LUTs. It used not to, and that was when this made sense.
* ytdl_hook: Just check if protocol is rtmpRicardo Constantino2016-05-141-1/+1
| | | | Partial fix to #3090
* vo_opengl: partially fix 0bgr format supportwm42016-05-131-2/+6
| | | | | | | | | | | | | | | | | | | Fixes broken colors with --vf=format=0bgr (but only if deband is disabled). 0bgr means the first byte is padding, while the following three bytes are bgr. From the vo_opengl perspective, it has 4 physical components with 3 logical components. copy_img_tex() simply copied 3 components from the physical representation, which means the last component (r) was sliced off. Fix this by not using p->color_swizzle for packed formats, and instead let packed formats set the per-plane swizzle in texplane.swizzle. The latter applies the swizzle as part of operation in copy_img_tex(), which essentially moves physical to logical representations. Unfortunately, debanding (and thus with opengl-hq defaults) is still broken.
* vo_opengl: drop duplicate LUMINANCE_ALPHA handlingwm42016-05-131-10/+3
| | | | | | This was supposed to handle the absence of GL_ARB_texture_rg. But it's already handled elsewhere. (init_format() sets texplane.swizzle accordingly.)
* vo_opengl: minor simplificationwm42016-05-131-8/+8
| | | | | | | | Make the find_plane_format function take a bit count. This also makes the function's comment true for the first time the function and its comment exist. (It was commented as taking bits, but always took bytes.)
* vo_opengl: restrict ES2 FBO formatswm42016-05-131-4/+4
| | | | | | | | | Only a few very low bit depth internal formats can be rendered to in pure ES2 (GL_RGB565 is the "best" one). Seems like the only potentially reasonable renderable formats in ES2 could be provided via GL_OES_rgb8_rgba8, or half-floats, so don't bother with this at all.
* vo_opengl: angle: log extension stringwm42016-05-131-0/+4
|
* cache: simplify speed calculationswm42016-05-121-19/+7
| | | | | | | | | | Remove the attempted cleverness; keep it dumb. This strictly calculates the average speed over an at least 1 second window (longer if I/O blocks it). Since this doesn't reset the speed anymore when reading stops by going idle, the results might actually be more accurate now.
* travis: move travis-deps script to TOOLSwm42016-05-122-1/+1
| | | | Don't let it clutter the top level directory.
* vo_opengl: slightly better FBO format checkwm42016-05-121-9/+17
| | | | | | | | | | | Now that we know in advance whether an implementation should support a specific format, we have more flexibility when determining which format to use. In particular, we can drop the roundabout ES logic. I'm not sure if actually trying to create the FBO for probing still has any value. But it might, so leave it for now.
* vo_opengl: disable scalers on ES2wm42016-05-121-4/+6
| | | | | | | | Even if everything else is available, the need for first class arrays breaks it. In theory we could fix this since we don't strictly need them, but I guess it's not worth bothering. Also give the misnamed have_mix variable a slightly better name.
* vo_opengl: add detection for the ES texture_rg extensionwm42016-05-121-0/+6
|
* vo_opengl: reorganize texture format handlingwm42016-05-1210-311/+444
| | | | | | | | | | | | | This merges all knowledge about texture format into a central table. Most of the work done here is actually identifying which formats exactly are supported by OpenGL(ES) under which circumstances, and keeping this information in the format table in a somewhat declarative way. (Although only to the extend needed by mpv.) In particular, ES and float formats are a horrible mess. Again this is a big refactor that might cause regression on "obscure" configurations.
* vo_opengl: correctly disable interpolation if tscale can't be usedwm42016-05-121-0/+2
| | | | It'll fail with an assertion in the interpolation code otherwise.
* Add Appveyor CI integration for Windows buildsJames Ross-Gowan2016-05-123-0/+87
|
* vo_opengl: angle: dump translated shaderswm42016-05-124-0/+25
| | | | Helpful for debugging and such.
* manpage: document missing sub-propertieswm42016-05-111-0/+2
| | | | | This is the client-API part; the normal descriptions are present in the text above.
* vo_opengl: don't use dumb-mode with 10 bit integer texture hackwm42016-05-111-2/+3
| | | | | Recent regression. Caused it to use dumb-mode with integer textures, which on ANGLE leads to nearest scaling.
* vo_opengl: fix NULL deref on certain init failureswm42016-05-111-2/+4
|
* video: add --hwdec=auto-copy modewm42016-05-1110-7/+28
| | | | | | | | This uses the normal autoprobing rules like "auto", but rejects anything that isn't flagged as copying data back to system memory. The chunk in command.c was dead code, so remove it instead of updating it.
* manpage: unmark d3d11va as "experimental"wm42016-05-111-2/+3
| | | | Also add missing mediacodec entry.
* vo_opengl: d3d11egl: support full range YUVwm42016-05-111-3/+3
| | | | | | | | | MSDN documents this as "Introduced in Windows 8.1.". I assume on Windows 7 this field will simply be ignored. Too bad for Windows 7 users. Also, I'm not using D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235 and D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255, because these are apparently completely missing from the MinGW headers. (Such a damn pain.)
* vo_opengl: d3d11egl: don't require EGL_EXT_device_querywm42016-05-111-23/+46
| | | | | | | Older ANGLE builds don't export this. This change is really only for convenience, and I might revert it at some later point.
* build: merge d3d11va and dxva2 hwaccel checkswm42016-05-115-23/+11
| | | | | | We don't have any reason to disable either. Both are loaded dynamically at runtime anyway. There is also no reason why dxva2 would disappear from libavcodec any time soon.
* vo_opengl: angle: dynamically load ANGLEwm42016-05-117-3/+135
| | | | | | | | | | | | ANGLE is _really_ annoying to build. (Requires special toolchain and a recent MSVC version.) This results in various issues with people having trouble to build mpv against ANGLE (apparently linking it against a prebuilt binary doesn't count, or using binaries from potentially untrusted sources is not wanted). Dynamically loading ANGLE is going to be a huge convenience. This commit implements this, with special focus on keeping it source compatible to a normal build with ANGLE linked at build-time.
* build: also use the iconv check on freebsdq662016-05-101-1/+1
| | | | This is necessary to make mpv build out of box on FreeBSD.
* vo_opengl: fix passing along swizzle from hwdec interopwm42016-05-102-0/+4
| | | | | | | | | | In theory this was needed for the previous commit (but wasn't in practice, since for hwdec the LUMINANCE_ALPHA mangling is not applied anymore, and ANGLE uses RG textures in absence of GL_ARB_texture_rg for whatever crazy reasons). In practice this caused funky colors on OSX with the uyvy422 format, which is also fixed in this commit.
* vo_opengl: d3d11egl: native NV12 sampling supportwm42016-05-104-20/+251
| | | | | | | | | | | | | | | | | This uses EGL_ANGLE_stream_producer_d3d_texture_nv12 and related extensions to map the D3D textures coming from the hardware decoder directly in GL. In theory this would be trivial to achieve, but unfortunately ANGLE does not have a mechanism to "import" D3D textures as GL textures. Instead, an awkward mechanism via EGL_KHR_stream was implemented, which involves at least 5 extensions and a lot of glue code. (Even worse than VAAPI EGL interop, and very far from the simplicity you get on OSX.) The ANGLE mechanism so far supports only the NV12 texture format, which means 10 bit won't work. It also does not work in ES3 mode yet. For these reasons, the "old" ID3D11VideoProcessor code is kept and used as a fallback.
* vo_opengl: add an angle-es2 backendwm42016-05-102-1/+25
| | | | | | It forces es2 mode on ANGLE. Only useful for testing. Since the normal "angle" backend already falls back to es2 if es3 does not work, this new backend always exit when autoprobing it.
* vo_opengl: cosmetics: rename variableswm42016-05-101-17/+16
| | | | | "p" is used for the private context everywhere in the source file, but renaming it also requires renaming some local variables.
* vo_opengl: refactor how hwdec interop exports textureswm42016-05-1011-184/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename gl_hwdec_driver.map_image to map_frame, and let it fill out a struct gl_hwdec_frame describing the exact texture layout. This gives more flexibility to what the hwdec interop can export. In particular, it can export strange component orders/permutations and textures with padded size. (The latter originating from cropped video.) The way gl_hwdec_frame works is in the spirit of the rest of the vo_opengl video processing code, which tends to put as much information in immediate state (as part of the dataflow), instead of declaring it globally. To some degree this duplicates the texplane and img_tex structs, but until we somehow unify those, it's better to give the hwdec state its own struct. The fact that changing the hwdec struct would require changes and testing on at least 4 platform/GPU combinations makes duplicating it almost a requirement to avoid pain later. Make gl_hwdec_driver.reinit set the new image format and remove the gl_hwdec.converted_imgfmt field. Likewise, gl_hwdec.gl_texture_target is replaced with gl_hwdec_plane.gl_target. Split out a init_image_desc function from init_format. The latter is not called in the hwdec case at all anymore. Setting up most of struct texplane is also completely separate in the hwdec and normal cases. video.c does not check whether the hwdec "mapped" image format is supported. This should not really happen anyway, and if it does, the hwdec interop backend must fail at creation time, so this is not an issue.
* sd_lavc: work around bug in older ffmpeg releaseswm42016-05-101-2/+6
| | | | | | | | | | | | | | | Older ffmpeg releases don't have ffmpeg git commit 50401f5fb7d778583b03a13bc4440f71063d319d, which fixes ffmpeg's pkt_timebase check to reject its default "unset" timebase as invalid. The consequence was that all non-PGS bitmap subtitle timestamps were forced to 0. Of course this hit _only_ shitty distros using outdated/badly maintained ffmpeg releases, so this is not worth working around. I've already wasted a lot of time on analyzing this dumb issue, and it could be useful for bisecting, so don't drop pre-3.0 ffmpeg just yet. Fixes #3109.
* stream_cdda: enable cache by defaultwm42016-05-101-0/+2
| | | | Requested.
* manpage: document -- and some issues passing filenameswm42016-05-101-1/+12
|
* ass_process_chunk: Use llrint, not lrintRichard H Lee2016-05-101-2/+2
| | | | | | | | | libass's ass_process_chunk expects long long int for the timecode and durations arguments, thus should use llrint instead of lrint. This does not cause any problems on most platforms, but on cygwin, it causes strange subtitle behaviour, like subtitles not showing, getting stuck or old subtitles showing at the same time as new subtitles.
* player: restore usual seeking behaviorwm42016-05-091-16/+31
| | | | | | | | | | | | | | | | | | | | | | Commit 786f37ae accidentally changed seeking behavior such that continuous seeking (holding the seek button down) would use the previous seek target timestamp, instead of the new video timestamp. (This is for the default mode, seeking to keyframes.) The result is that the movement on the seekbar is smooth, but the way the video updates is awkward. Some might actually prefer the new behavior (and some players effectively show similar bahavior), but I don't. So restore the old behavior. This is done in two steps: First: strictly wait for the entire seek process to finish, which will effectively make the seeking code pick up the new video timestamp correctly. This would play audio immediately, which would result in noise during continuous seeking, which leads to second: explicitly abort the playback restarting process if this case is detected, and never play audio.
* x11: tell GNOME to use dark window decorationsMantas Mikulėnas2016-05-091-0/+1
|
* manpage: fix some script_message references to preferred namewm42016-05-093-9/+9
|
* video: refactor how VO exports hwdec device handleswm42016-05-0939-271/+352
| | | | | | | | | | | | | | | | | | | | | | | | | | The main change is with video/hwdec.h. mp_hwdec_info is made opaque (and renamed to mp_hwdec_devices). Its accessors are mainly thread-safe (or documented where not), which makes the whole thing saner and cleaner. In particular, thread-safety rules become less subtle and more obvious. The new internal API makes it easier to support multiple OpenGL interop backends. (Although this is not done yet, and it's not clear whether it ever will.) This also removes all the API-specific fields from mp_hwdec_ctx and replaces them with a "ctx" field. For d3d in particular, we drop the mp_d3d_ctx struct completely, and pass the interfaces directly. Remove the emulation checks from vaapi.c and vdpau.c; they are pointless, and the checks that matter are done on the VO layer. The d3d hardware decoders might slightly change behavior: dxva2-copy will not use the VO device anymore if the VO supports proper interop. This pretty much assumes that any in such cases the VO will not use any form of exclusive mode, which makes using the VO device in copy mode unnecessary. This is a big refactor. Some things may be untested and could be broken.
* vo_direct3d: remove passing device to decoderwm42016-05-091-18/+0
| | | | | This was never really used anyway. Removing it for the sake of the following commit.
* wayland: use the advertised size in fullscreenEmmanuel Gil Peyrot2016-05-081-7/+0
| | | | | | | | | | | | | | | When we receive the wl_shell_surface::configure event, it makes sense to respect the aspect ratio of the video in windowed mode, but in fullscreen it forces compositing and wastes resources (until atomic modesetting is available everywhere and we can stop having desynchronised planes). Weston mitigates a resolution mismatch by creating black surfaces and compositing them around the fullscreen surface, placed at the middle, while GNOME puts it at the top-left and leaves the rest of the desktop composited below, both of them producing a subpar experience. Fixes #3021, #2657.
* win32: make taskbar progress indication optionalmaniak13492016-05-088-5/+45
| | | | | | | | | | | Add --taskbar-progress command line option and property which controls taskbar progress indication rendering in Windows 7+. This option is on by default and can be toggled during playback. This option does not affect the creation process of ITaskbarList3. When the option is turned off the progress bar is just hidden with TBPF_NOPROGRESS. Closes #2535
* demux_lavf: fix a minor memory leakwm42016-05-081-1/+5
|
* manpage: document --x11-bypass-compositor=nowm42016-05-081-1/+4
| | | | Requested.
* x11: slightly safer X11 error handler behaviorwm42016-05-081-1/+4
| | | | | | | | | | | The X11 error handler is global, and not per-display. If another Xlib user exists in the process, they can conflict. In theory, it might happen that e.g. another library sets an error handler (overwriting the mpv one), and some time after mpv closes its display, restores the error handler to mpv's one. To mitigate this, check if the error log instance is actually set, instead of possibly crashing. The change in vo_x11_uninit() is mostly cosmetic.
* manpage: change gnome-screensaver-command exampleRahul Kalkani2016-05-071-1/+1
| | | | | | Correct options to deactivate is -d or --deactivate. Signed-off-by: wm4 <wm4@nowhere>
* x11: rename inappropriate --x11-bypass-compositor=never optionwm42016-05-072-3/+3
| | | | This obviously made no sense.
* x11: add --x11-bypass-compositor=alwayswm42016-05-063-3/+9
| | | | Also add missing documentation for fs-only, and correct the default.
* DOCS: update documentation related to color managementNiklas Haas2016-05-062-6/+12
| | | | | | Some of this documentation was left woefully inaccurate as color management in mpv evolved. This commit updates all of the wording and adds notes and comments where appropriate.
* ao_alsa: add more shitty workaroundswm42016-05-061-9/+25
| | | | | | | | | | | | | | | This reportedly makes it work on ODROID-C2. The idea for this hack is taken from kodi; they unconditionally set some or all of those flags. I don't trust ALSA enough to hope that setting these flags couldn't break something else, so we try without them first. It's not clear whether this is a driver bug or a bug in the ALSA libs. There is no ALSA bug tracker (the ALSA website has had a dead link to a deleted bug tracker fo years). There's not much we can do other than piling up ridiculous hacks. At least I think that at this point invalid API usage by mpv can be excluded as a cause. ALSA might be the worst audio API ever.
* manpage: minor fixes to --lavfi-complexwm42016-05-061-2/+3
|
* vo_opengl: angle: avoid fullscreen FBO copy for flippingwm42016-05-051-1/+23
| | | | | | | In order to honor the differences between OpenGL and Direct3D coordinate systems, ANGLE uses a full FBO copy merely to flip the final frame vertically. This can be avoided with the EGL_ANGLE_surface_orientation extension.
* vo_opengl: angle: call eglTerminate()wm42016-05-051-0/+2
| | | | | | | | | | | | I hope that this does what we expect it does: destroy the EGLDisplay specific to our HDC. (Some implementations will terminate all EGL contexts in the whole process.) eglReleaseThread() merely calls eglMakeCurrent(0, 0, 0, 0), which is not enough. This commit also fixes the problem fixed with the previous commit, but I think both changes are needed to make our API usage clean.
* vo_opengl: EGL: fix hwdec probingwm42016-05-053-1/+7
| | | | | | | | | | | | | If ANGLE was probed before (but rejected), the ANGLE API can remain "initialized", and eglGetCurrentDisplay() will return a non-NULL EGLDisplay. Then if a native GL context is used, the ANGLE/EGL API will then (apparently) keep working alongside native OpenGL API. Since GL objects are just numbers, they'll simply fail to interact, and OpenGL will get invalid textures. For some reason this will result in black textures. With VAAPI-EGL, something similar could happen in theory, but didn't in practice.
* command: use NBSP for spacing after current marker for OSD listswm42016-05-041-2/+2
| | | | | Requested. Will prevent odd layout for