summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* player: print used number of threads in verbose modewm42015-01-051-1/+1
| | | | Also, don't use av_log() for mpv output.
* vo_opengl: remove obsolete comment in shaderwm42015-01-041-1/+1
|
* x11: make display-names property stricterwm42015-01-041-1/+3
| | | | | | | | | | | | | | Returning the property before the window is mapped could lead to confusing behavior, and in particular strange differences between vo_vdpau and vo_opengl. (vo_opengl creates the window right at the start, while vdpau waits until the first reconfigure event.) It might even be possible that for vo_opengl random results were returned, because the hidden window can have different placement than the actual, final one on initial video reconfig. Fix this by returning the property only if the window is considered mapped. command.c handles this case specifically, and makes the property unavailable, instead of returning an empty list.
* video: batch query_format callswm42015-01-032-6/+8
| | | | | | | There are currently 568 pixel formats (actually fewer, but the namespace is this big), and for each format elaborate synchronization was done to call it synchronously on the VO. This is completely unnecessary, and we can do with just a single call.
* vf_vapoursynth: fix Lua backendwm42015-01-031-0/+3
| | | | It couldn't handle the newly added float variable.
* vf_vapoursynth: pass through container FPS valuewm42015-01-032-0/+3
| | | | | | | | This is basically a hack; but apparently a needed one, since many vapoursynth filters insist on having a FPS set. We need to apply the FPS override before creating the filters. Also change some terminal output related to the FPS value.
* x11: make display-names property observablewm42015-01-031-0/+2
| | | | Reuse MP_EVENT_WIN_STATE for this.
* video: better pipelining with vf_vapoursynthwm42015-01-033-8/+73
| | | | | | | | | | Most of this is explained in the code comments. This change should improve performance with vapoursynth, especially if concurrent requests are used. This should change nothing if vf_vapoursynth is not in the filter chain, since non-threaded filters obviously can not asynchronously finish filtering of frames.
* cocoa: fix build on 10.9Stefano Pigozzi2015-01-021-1/+1
| | | | Use -isInFullScreenMode instead of the property introduced with the 10.10 SDK.
* cocoa: fix NSMapGet errorStefano Pigozzi2015-01-021-2/+4
| | | | regression from 64b6b2ea45
* vo_opengl_old: remove ancient ATI-specific YUV conversionswm42015-01-024-231/+5
| | | | | | | | | | While there's no actual need to get rid of these, I want to make sure nobody actually needs this stuff, and removing it is the best way to get to know this. We still can revert this commit if it turns out there is a significant need for this stuff. The final goal is removing vo_opengl_old entirely. Add a warning, which basically announces this intention.
* cocoa: fix uninitialization while in fullscreenStefano Pigozzi2015-01-013-2/+36
| | | | | | | | This is only needed for switching video track with `_`, since Cocoa automatically handles cleaning up the application's presentation options when quitting the process. Fixes #1399
* gl_hwdec_vda: refuse to work with old OpenGL versionswm42014-12-311-0/+5
| | | | | | | | | | | | The way we use rectangle textures (required by VDA for no reason) works onl in OpenGL 3.0 or higher. Below that, the shader will fail to compile. We could add support for older OpenGL versions, but that would be a major pain. This normally doesn't matter; mpv itself always creates OpenGL 3.2 contexts on OSX. But it could matter if a client API user uses vo_opengl_cb, and gives it a 2.1 context (which OSX also allows you to create).
* vo_opengl_cb: simplify API uninitializationwm42014-12-311-6/+30
| | | | | | | | | | | Until now, calling mpv_opengl_cb_uninit_gl() at a "bad moment" could make the whole thing to explode. The API user was asked to avoid such situations by calling it only in "good moments". But this was probably a bit too subtle and could easily be overlooked. Integrate the approach the qml example uses directly into the implementation. If the OpenGL context is to be unitialized, forcefully disable video, and block until this is done.
* vo_opengl_cb: pass context directlywm42014-12-312-59/+42
| | | | | This is simpler than setting the context after VO creation, which requires the code to check for the context on every entrypoint.
* video: pass some VO params as structwm42014-12-312-18/+18
| | | | | Not particularly elegant, but better than adding more and more stuff to the relevant function signatures.
* command: make empty vf-metadata not an errorwm42014-12-301-3/+4
| | | | | | | | If a filter exists, but has no metadata, just return success. This allows the user to distinguish between no metadata available, and filter not inserted. See #1408.
* vf: fix crash if filter doesn't provide control entrypointwm42014-12-301-1/+1
| | | | | | | | This input command crashed: vf add @mf:format=yuv420p ; show_text "${vf-metadata/mf}" Fixes #1408.
* w32_common: allow window resizing with --no-borderJames Ross-Gowan2014-12-291-0/+58
|
* vo_opengl: Ignore approx-gamma for BT.2020-CLNiklas Haas2014-12-291-2/+9
| | | | | | The details of the non-linear transformation from/to BT.2020's constant luminance system don't really make sense with any other gamma curve, since changing the gamma curve completely breaks the chroma channels.
* cocoa: move the gl function loader to gl_cocoa.cStefano Pigozzi2014-12-283-17/+15
|
* screenshots: set AVFrame parameterswm42014-12-281-0/+3
| | | | | | | Currently, libavcodec is rather lenient, but it might get stricter in the future. Fixes #1398.
* vo_opengl: don't use 10 bit video on Intel GPUswm42014-12-242-0/+31
| | | | | | | | | | | | vo_opengl was originally written against OpenGL 3 core, and it seems GPUs/drivers supporting this are mostly sane. Later, it was made to work with OpenGL 2.1 too. Lately we removed the requirement for RG textures, and look, someone reported a problem with "lesser" Intel GPUs. This commit does the same in vo_opengl what was added to vo_opengl_old a long time ago. Fixes #1383.
* vo_opengl_cb: use VAOs even in OpenGL 2.1wm42014-12-231-5/+15
| | | | | | | | Using them reduces state change, since now at least vo_opengl_cb has to setup/break the vertex array bindings on every frame if no VAOs are available. This reverts the VAO related change in commit f64665e7.
* vo_opengl_cb: always setup/break vertex array bindingswm42014-12-231-3/+13
| | | | | | | | | | | Originally, this code was written to have full control over the OpenGL state, rather than having to cooperate with unknown components by being embeded like vo_opengl_cb is meant to be. As a consequence, it was thought to be ok to setup a global binding (if the context is below OpenGL 3.0, which guarantees VAOs). This could break badly. Fix it by setting up and breaking the bindings on entry/exit.
* 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 textureswm4