summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* vo_opengl: fix build on OSXwm42014-12-231-0/+6
| | | | Missing modern OpenGL symbols again.
* vo_opengl: don't allow setting 3D LUT if unsupportedwm42014-12-231-1/+5
| | | | | The code was always uploading the 3D LUT (even of unused), as long as vo_opengl was setting a icc-profile. This could crash with GLES 2.
* vo_opengl: make use of newer OpenGL logging APIwm42014-12-235-2/+58
| | | | | | GL_ARB_debug_output provides a logging callback, which can be used to diagnose problems etc. in case the driver supports it. It's enabled only if the vo_opengl "debug" suboption is set.
* vo_opengl_cb: parse renderer parameterswm42014-12-221-5/+10
| | | | | | Now it accepts the same renderer arguments as vo_opengl. This also disables debug checks by default, and reverts the background color override. Both can now be controlled by the host application.
* vo_opengl, vo_opengl_cb: check GL version in rendererwm42014-12-223-5/+9
| | | | | | vo_opengl actually checks this in the context creation code already, but it still increases robustness in case the requirements are changed later.
* vo_opengl_cb: free context on exitwm42014-12-221-0/+8
| | | | | | | Minor memory leak. Actually, this also exposes some problems in the QtQuick example. This will have to be fixed in the example.
* vo_opengl: fix feature detectionwm42014-12-221-1/+1
| | | | Fixes #1373.
* vo_opengl: improve fallback handling with GLESwm42014-12-214-16/+30
| | | | | | | | | Whether we have texture_rg doesn't matter much anymore; the scaler should be fine with this. But on ES 2.0, 1st class arrays are missing, so even if filterable float textures should be available, it won't work. Dithering (at least the "fruit" variant) will not work either, because it uses floats.
* vo_opengl: silence an INVALID_ENUM error with GLES2James Ross-Gowan2014-12-211-1/+2
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: GLES does not support GL_BGRAwm42014-12-203-5/+5
| | | | | | | | | | | | | Apparently GLES 2 and 3 do not support this. (The implementations I tested with were derived from desktop OpenGL and were not overly strict with this.) This is no problem; just use GL_RGBA and mangle the channels in the shader. Also disable direct support for image formats like IMGFMT_RGB555 with GLES; at least some of them are not supported in this form, and the formats aren't important anyway.
* vo_opengl_old: fix OSD regressionwm42014-12-204-7/+16
| | | | | | | | | | | | | | | | | Commit 0e8fbdbd removed the rg_texture requirement from vo_opengl; commit 541f6731 changed to a more convenient method. Both commits broke vo_opengl_old in some ways. vo_opengl_old always requires GL_ALPHA for single-channel texture, because it draws the OSD without shaders and by using certain blend modes. So we need to explicitly distinguish between vo_opengl and vo_opengl_old in the OSD renderer, and force fixed texture formats for vo_opengl_old. The other logic is specific to the internals of vo_opengl. (Although it might be possible to get the same result by playing with the old GL fixed-function functions in vo_opengl_old. But seems like a waste of time.) Fixes #1370.
* cocoa: mark window for redraw after title changeStefano Pigozzi2014-12-201-1/+3
| | | | | | | This used to work correctly without the call to displayIfNeeded. I think this may only be needed for Yosemite. Fixes #1330
* vo_opengl: remove pointless glFinish callswm42014-12-192-5/+0
|
* vo_opengl: skip GLES when autoprobingwm42014-12-191-0/+5
| | | | | | | | There are probably bugs with GLES support; also, if you somehow get GLES instead of desktop GL on a desktop computer, something else is probably wrong. So I see no point in using this automatically. We first need to find out whether the GLES support works on real hardware, and whether it is useful at all.
* vo_opengl, x11: add ES context creation via GLXwm42014-12-194-8/+34
| | | | | | | | Apparently GLX can do this, so using EGL is not strictly required. This code tries to create an ES context if creating a desktop GL context fails. Also, a "x11es" backend for forcing ES (instead of desktop GL) is added, mostly for testing and debugging.
* vo_opengl: fail if required functions are missingwm42014-12-191-5/+10
| | | | | | | Before this, missing additional but required functions were ignored. ("Main" functions still made it error out.) But we pretty much expect that these are present on a given version level, and only an extremely buggy OpenGL implementation would not do this.
* vo_opengl: better probe handlingwm42014-12-196-63/+55
| | | | | | | | | | | | | Involve detection of software renderers in the probing properly. Other VOs could handle probing also more gracefully, and e.g. produce less noise if an API is unavailable. (Although other than the OpenGL VOs, only vo_wayland will.) Now the "sw" suboption for vo_opengl[_old] is strictly speaking not needed anymore. Doing "--vo=opengl" disables the probing logic, and will always force it, if possible. Includes some simplifications as well.
* vo_opengl: minor simplificationwm42014-12-191-5/+5
| | | | The parameter to default_tex_params() is always the same.
* vo_opengl: unborkwm42014-12-191-2/+2
| | | | | | | | Probably. The version handling schema is a bit strange (and led to a tricky and obvious bug), but it's quite similar to what OpenGL does at some places, so I blame the OpenGL standard.
* vo_opengl: add GLES 2 supportwm42014-12-195-16/+44
| | | | | | | | Rather basic support. Almost nothing works, and even if it does, it's bound to be inefficient (due to texture upload). This was tested with the nVidia desktop binary drivers, which provide GLES 2 support only. However, nVidia is not known to be very strict about OpenGL, and the driver is very new too, so the vo_opengl code will have bugs too.
* vo_opengl: mess with PixelStorei state managementwm42014-12-193-44/+49
| | | | | | | | | | | | | | | | This is needed for GLES 2 support. GLES 2 doesn't support GL_UNPACK_ROW_LENGTH, and we shouldn't even use this constant, since a GLES implementation could raise an error. So set it only if neccessary, and leave it in the default state otherwise. This also smuggles in a ES 2 fallback for glUploadTex(), and querying an extension relevant for ES 2. For the alignment state (GL_[UN]PACK_ALIGNMENT) do the same for symmetry. All 4 states (alignment/rows x pack/unpack) are now assumed to be in their initial states by default. Also redo the PixelStorei handling in the function table. I could rebase this, but look at the commit time.
* vo_opengl: disable some unavailable features under ESwm42014-12-192-3/+9
| | | | There are probably many more which I overlooked.
* vo_opengl: clean up GL ES function loadingwm42014-12-181-86/+114
| | | | | | | | | | | | | | | | | | Previously, this was sort of messed together with desktop OpenGL loading. Add explicit support for ES, and clean up the mess. Also sort the function arrays alphabetically (at least most of them). In some cases, add functions to multiple sections. This keeps the number of sections down. Don't check for GL_ARB_vertex_array_object. This feature must be used in OpenGL 3 core, while it may be not available at all in earlier versions, and not using it if it's available as extension only has no advantages. This commit also considers GLES 2, because actual support for it will be added with a later commit. Also get rid of some MPGL_VER() uses (see some commits ago).
* vo_opengl: do not use 4x3 matrixwm42014-12-184-16/+15
| | | | | | | | | | | This was a nice trick to get the mpv colormatrix directly into OpenGL, because the memory representation happened to match. Unfortunately, OpenGL ES 2 doesn't have glUniformMatrix4x3fv(). Even more unfortunately, the memory representation is now incompatible. It would be nice to change it, but that would mean getting into a big mess.
* vo_opengl: simplify some aspects of the GL function loaderwm42014-12-182-26/+23
|
* vo_opengl, x11: make legacy context warning not an errorwm42014-12-181-1/+1
| | | | | | Really, this doesn't actually matter. It's printed as error only because it was once thought to be an mostly unneeded fallback, but it turned out this is still frequently needed, and users are getting confused.
* x11: fix mysterious issue with window embedding on OpenBoxwm42014-12-181-1/+1
| | | | | | | | | | | | | | | | | | | For some reason, when using window embedding, and the window manager is OpenBox, calling XSetWMNormalHints() before the window is mapped, the initial window position will be off. It leaves some vertical space, instead of placing it on the top/left corner. Suspiciously, the vertical space is as much as a the height of normal window decoration. I don't know what kind of issue this is. Possibly an OpenBox bug, but then this happens even if the override-redirect flag is set. (This flag basically tells the X server to ignore the window manager. Normally we don't set it.) On other window managers, it works fine. So I don't know why this is happening. But this is easy to workaround. XSetWMNormalHints() isn't needed at all if embedding. Should fix #1235.
* x11: minor improvementswm42014-12-181-8/+7
| | | | | | Always include the window position in winrc, even if the window embedded. This should give the correct positions for things which still interact with global coordinates, such as the xrandr code.
* vo_opengl: minor simplification in function loaderwm42014-12-181-11/+5
| | | | Don't force every entries without functions to define a dummy array.
* vo_opengl: simplify the case without texture_rgwm42014-12-183-28/+18
| | | | | | | | | | | | If GL_RED was not available, we used GL_ALPHA. But this is an unnecessary complication, and it's easier to use GL_LUMINANCE instead. With the latter, a texture will return the .r component set, and as long as the shader doesn't look at the other components, the shader doesn't need any changes. Some of the changes added in 0e8fbdbd are now unneeeded. Also, realign the entire gl_byte_formats_legacy table.
* vo_opengl: don't assume legacy OpenGL is available with GLESwm42014-12-171-1/+1
| | | | | | OpenGL 3.0 has the weird situation that it's "hard" to detect whether legacy GL is really present. Since we pretend that we have OpenGL 3.0 if we use GLES, it was assuming legacy GL is available.
* vo_opengl: add some OpenGL standard symbols missing on OSXwm42014-12-171-0/+7
| | | | | | Older OSX versions are missing some OpenGL 3 symbols, apparently. At least there's some precedent in the headers. Just add the symbols manually for now to fix OSX (on travis-ci) compilation.
* vo_opengl: GLES 3 supportwm42014-12-176-24/+111
| | | | | | | | | | | | Tested with MESA on software emulation. Seems to work well, although the default FBO format in opengl-hq disables most interesting features. I have no idea how well it will work on real hardware (or if it does at all). Unfortunately, some features, including playback of 10 bit video, are not supported. Not sure what to do about this. GLES 2 or 1 do not work.
* vo_opengl: remove useless FBO testwm42014-12-171-34/+2
| | | | | | | | | Remove the readback stuff; it was a useless mess. Don't test GL_R16 as FBO. The intention was to measure the effective bitdepth of the texture, except that it was never actually done. (There's also a OpenGL function which is supposed to retrieve the bitdepth, but we don't use that either.)
* vo_opengl: cleanup dither texture creationwm42014-12-171-4/+9
| | | | Might be slightly more compatible too, and will make it work on GLES.
* vo_opengl: switch default FBO format to rgba, use GL_RGBAwm42014-12-171-3/+6
| | | | | | | | | | I'm hoping this is generally more compatible, and it works with GLES. This probably has not much of an effect on desktop GL. It also switches only the default format for --vo=opengl, not --vo=opengl-hq. "-hq" already uses GL_RGBA16, though since it's a sized format, the story is a bit different, and it won't work on GLES either.
* vo_opengl: glsl: stricter typingwm42014-12-171-20/+20
| | | | | | | | Older GLSL dialects as well as GLES3 do not support the following things in expressions: - implicit conversions of integer constants to float - arithmetic of float*vecN
* vo_opengl: remove icc profile options from runtime-settable optionswm42014-12-161-16/+14
| | | | | | | | | | | | | | | | | | Because of the icc-profile-auto option (which was added at a later point), supporting this would probably be slightly messy: the ICC profile can spontaneously update, and then it would overwrite the previously set options. Don't make icc-profile-auto fatal if unsupported. The "auto" indicates that it will use whatever it finds, even if it's nothing. Also add a warning; before this commit, it just refused to initialize without explanation. As a mostly unrelated cosmetic change, remove redundant parameters which had no point anymore. Probably fixes #1359 (or rather works it around by disallowing it).
* vo_opengl: remove requirement for RG textureswm42014-12-165-42/+92
| | | | | Features not supported are disabled (although with a misleading error message).
* vo_opengl: remove inactive codewm42014-12-161-1/+0
|
* vo_opengl: fix broken rejection of extended scalingwm42014-12-161-3/+2
| | | | | Possibly explains why some users got mysterious FBO errors on crappy hardware.
* Revert "vo/w32_common: use local definition of IID_ITaskbarList2"Kevin Mitchell2014-12-161-7/+1
| | | | | | This reverts commit 17067343eb10293beb61d3811680b9c59f4db311. Embarassingly, this turned out not to be necessary.
* vo/w32_common: use local definition of IID_ITaskbarList2Kevin Mitchell2014-12-151-1/+7
| | | | It is not defined in the current cygwin release.
* vo_opengl: remove quadbuffer/anaglyph stereo 3D renderingwm42014-12-156-135/+96
| | | | | | | | Obscure feature, and I've never heard of anyone using it. The anaglyph effects can be reproduced with vf_stereo3d. The only thing that can't be reproduced with it is "quadbuffer", which requires special and expensive hardware.
* vo_x11: don't attempt to resize when unconfiguredwm42014-12-141-2/+3
| | | | | | Fixes #1347. The previous commit actually fixes the crash.
* vo_x11: check allocation errorswm42014-12-141-3/+10
| | | | Avoids a crash if allocation fails.
* vd_lavc: fix error handling pathwm42014-12-131-11/+12
| | | | The ctx->pic check must uninitialize the decoder.
* mp_image: check for malloc failurewm42014-12-131-0/+2
| | | | | Or rather, the only reason av_buffer_create() can fail is a malloc failure.
* Check some mallocswm42014-12-121-0/+4
| | | | Fixes #1337.
* vo: fix some nonsensewm42014-12-104-11/+8
| | | | | | | | | Commit d38bc531 is incorrect: the 50ms queue-ahead value and the flip queue offset have different functions. The latter is about calling flip_page in advance, so the change attempted to show video frames 50ms in advance on all VOs. The change was for vo_opengl_cb, but that can be handled differently.
* vo_opengl: fix linkage typewm42014-12-091-1/+1
| | | | Can happen on Windows, I suppose.
* vo_opengl: make shader text output slightly nicerwm42014-12-091-2/+2
| | | | It was missing an indentation in some cases.
* vo_opengl: don't crash if framebuffers are not availablewm42014-12-091-0/+9
| | | | | | | | | | | In theory, vo_opengl supports operation without framebuffers. But this has been broken for a while now (commit cc00b3ff is a contender). It crashed because it unconditionally called gl->BindFramebuffer() (which is NULL if framebuffers are missing). Since this function is actually only called to set the default framebuffer, the simplest way to deal with this is to provide a dummy function, insteas of uglifying the code with additional if branches.
* vo_opengl_cb: simplify reconfigure, render transparent if unconfiguredwm42014-12-092-15/+15
| | | | | | | I think that's expected; mpv shouldn't draw anything while no video is active. This doesn't blend transparently, though. Also document the vo_opengl_cb thing.
* vo_opengl: make background color configurablewm42014-12-092-3/+11
| | | | | This mainly affects the black bars that are drawn if the window and video aspect ratios mismatch.
* w32: copy WinID optionwm42014-12-091-14/+14
| | | | See previous and next commit.
* x11: copy WinID optionwm42014-12-092-16/+22
| | | | For the purpose of making "--wid" setable at any time.
* client API: expose OpenGL rendererwm42014-12-0912-18/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds API to libmpv that lets host applications use the mpv opengl renderer. This is a more flexible (and possibly more portable) option to foreign window embedding (via --wid). This assumes that methods like context sharing and multithreaded OpenGL rendering are infeasible, and that a way is needed to integrate it with an application that uses a single thread to render everything. Add an example that does this with QtQuick/qml. The example is relatively lazy, but still shows how relatively simple the integration is. The FBO indirection could probably be avoided, but would require more work (and would probably lead to worse QtQuick integration, because it would have to ignore transformations like rotation). Because this makes mpv directly use the host application's OpenGL context, there is no platform specific code involved in mpv, except for hw decoding interop. main.qml is derived from some Qt example. The following things are still missing: - a way to do better video timing - expose GL renderer options, allow changing them at runtime - support for color equalizer controls - support for screenshots
* vo: include normal render-ahead time in flip_queue_offsetwm42014-12-093-9/+13
| | | | | | A small refactor; shouldn't change any behavior. Do this so immediate display can be achieved.
* w32_common: fix GUID linking in CygwinJames Ross-Gowan2014-12-091-0/+1
|
* cocoa: fix crashStefano Pigozzi2014-12-081-5/+0
| | | | | | fixes #1323 Doesn't leak unless we switch video tracks on and off while in fullscreen.
* vo_opengl: enable fancy-downscaling for opengl-hq againwm42014-12-081-1/+1
| | | | | | I guess most problems with it have been fixed. It's still slower than necessary, though.
* vo_opengl: use all filter sizes possible with the shaderswm42014-12-082-33/+21
| | | | | | | | | | | | | | Not all filter sizes the shaders could handle were in the filter_sizes list. The shader can handle any multiple of 4 (the sizes 2 and 6 are special-cased to keep it simple). Add all possible filter sizes, up to 64. 64 is ridiculously high anyway. Most of the larger filter sizes are completely useless for upscaling, but help with the fancy-downscaling option. (Although it would still be more efficient to use cascaded scalers to handle downscaling better.) I considered doing something less stupid than the hardcoded array, but it seems this is still the simplest solution.
* vo_opengl: refactor: instantiate scaler functions at runtimewm42014-12-082-44/+43
| | | | | | | | | | | | | | | | | Before this commit, the convolution scaler shader functions were pre- instantiated in the shader file. For every filter size, a corresponding function (with the filter size as suffix) had to be present. Change this, and make the C code emit the necessary bits. This means the shader code is much reduced. (Although hopefully it doesn't make shader compilation faster - it would require a really dumb compiler if it spends its time on dead code.) It also makes it more flexible, which is the main goal. The DEF_SCALER0 stuff is needed because the C code writes the