summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* win32: don't resize when window is minimizedwm42015-02-031-5/+6
| | | | | | | | At least the opengl-hq VO allocates additional resources when downscaling a lot, which is just a waste. Also see #1547 (although I doubt that this is the cause; if it is, a real fix will be required).
* vo_opengl: improve terminal messages with lscale suboption errorswm42015-01-251-5/+13
| | | | Make it more apparent what the hell the user did wrong.
* vo_opengl: guarantee correct reinitialization on setting optionswm42015-01-251-0/+1
| | | | | | At least the scale_sep_fbo could have been uninitialized or initialized incorrectly when switching between scalers (e.g. from bilinear to lanczos). Calling check_resize() should take care of this.
* vo_vdpau: don't render to an output surface if it could be busywm42015-01-251-6/+6
| | | | | | There was a case when we could have rendered to an output surface while it's still used for display. Not sure why the API doesn't do this automatically.
* vo_direct3d: disable shaders if unavailablewm42015-01-251-23/+24
| | | | | | | | | | | | | Apparently, extremely crappy graphics drivers don't allow you to use shaders. Simply disable use of shaders if this happens, and use the "old" method instead. One unexpectedly tricky thing is that you need a d3d_device to create a shader, which in turn requires a window, so the initialization order changes. Conflicts: video/out/vo_direct3d.c
* vo: never autoselect vo_nullwm42015-01-251-0/+2
| | | | | | | Same deal as with commit d44b4ccb. Conflicts: video/out/vo.c
* vf_scale: replace ancient fallback image format selectionwm42015-01-253-141/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If video output and VO don't support the same format, a conversion filter needs to be insert. Since a VO can support multiple formats, and the filter chain also can deal with multiple formats, you basically have to pick from a huge matrix of possible conversions. The old MPlayer code had a quite naive algorithm: it first checked whether any conversion from the list of preferred conversions matched, and if not, it was falling back on checking a hardcoded list of output formats (more or less sorted by quality). This had some unintended side- effects, like not using obvious "replacement" formats, selecting the wrong colorspace, selecting a bit depth that is too high or too low, and more. Use avcodec_find_best_pix_fmt_of_list() provided by FFmpeg instead. This function was made for this purpose, and should select the "best" format. Libav provides a similar function, but with a different name - there is a function with the same name in FFmpeg, but it has different semantics (I'm not sure if Libav or FFmpeg fucked up here). This also removes handling of VFCAP_CSP_SUPPORTED vs. VFCAP_CSP_SUPPORTED_BY_HW, which has no meaning anymore, except possibly for filter chains with multiple scale filters. Fixes #1494.
* vo_opengl: fix typowm42015-01-251-1/+1
|
* vo: restore framedropwm42015-01-251-1/+1
| | | | Fix inverted condition in commit 234d6329.
* video: fix waiting for last frame/format reconfigwm42015-01-251-0/+1
| | | | | | | | | | | We still need to send the VO a duration in these cases. Disabling framedrop has logically absolutely nothing to do with these cases; it was overlooked in commit 918b06c4. So we always send the frame duration (or a guess for it), and check whether framedropping is actually enabled in the VO code. (It would be cleaner to send framedrop as a flag, but I don't care about that right now.)
* cocoa: don't set application icon in libmpvStefano Pigozzi2015-01-251-2/+4
|
* wayland: implement key modifierswm42015-01-251-18/+24
| | | | Includes shift, ctrl, alt, meta.
* wayland: don't compute absurd window sizewm42015-01-251-3/+6
| | | | | | | | | For some reason, schedule_resize() can be called with everything set to 0. The code couldn't handle wl->window.aspect set to 0, converting NaNs to integers. Just work this around. (I have no idea what I'm doing. This is probably a corner case caused by my broken-ish wayland setup.)
* win32: request UTF-16 API variants, Vista+ APIs, and COM C macroswm42015-01-254-10/+4
| | | | | | | | | Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into the build system, instead of defining them over and over in the code. Conflicts: video/out/w32_common.c waftools/checks/custom.py
* player: print used number of threads in verbose modewm42015-01-251-1/+1
| | | | Also, don't use av_log() for mpv output.
* vf_vapoursynth: fix Lua backendwm42015-01-251-0/+3
| | | | It couldn't handle the newly added float variable.
* vf_vapoursynth: pass through container FPS valuewm42015-01-252-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-251-0/+2
| | | | Reuse MP_EVENT_WIN_STATE for this.
* video: better pipelining with vf_vapoursynthwm42015-01-253-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.
* gl_hwdec_vda: refuse to work with old OpenGL versionswm42015-01-251-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). Conflicts: video/out/gl_hwdec_vda.c
* w32_common: allow window resizing with --no-borderJames Ross-Gowan2015-01-251-0/+58
| | | | | Conflicts: video/out/w32_common.c
* vo_opengl: Ignore approx-gamma for BT.2020-CLNiklas Haas2015-01-251-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 Pigozzi2015-01-253-17/+15
|
* Do not call strerror()wm42015-01-252-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | ...because everything is terrible. strerror() is not documented as having to be thread-safe by POSIX and C11. (Which is pretty much bullshit, because both mandate threads and some form of thread-local storage - so there's no excuse why implementation couldn't implement this in a thread-safe way. Especially with C11 this is ridiculous, because there is no way to use threads and convert error numbers to strings at the same time!) Since we heavily use threads now, we should avoid unsafe functions like strerror(). strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and gives the function different semantics than the POSIX one. It's a bit of work to convince this piece of shit to expose the POSIX standard function, and not the messed up GNU one. strerror_l() is also in POSIX, but only since the 2008 standard, and thus is not widespread. The solution is using avlibc (libavutil, by its official name), which handles the unportable details for us, mostly. We avoid some pain.
* vo_opengl_old: fix OSD regressionwm42015-01-254-7/+17
| | | | | | | | | | | | | | | | | | | | 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. Conflicts: video/out/gl_osd.c
* vo_opengl: remove pointless glFinish callswm42015-01-252-5/+0
|
* x11: fix mysterious issue with window embedding on OpenBoxwm42015-01-251-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: copy WinID optionwm42015-01-252-16/+22
| | | | For the purpose of making "--wid" setable at any time.
* vo_opengl: don't use 10 bit video on Intel GPUswm42015-01-252-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. Conflicts: video/out/gl_common.c video/out/gl_video.c
* vo_opengl: remove requirement for RG textureswm42015-01-254-41/+91
| | | | | | | | | | Features not supported are disabled (although with a misleading error message). Conflicts: video/out/gl_video.c video/out/vo_opengl.c video/out/vo_opengl_cb.c
* vo_opengl: never use 1D textures for lookup textureswm42015-01-252-48/+35
| | | | | | | | | This was a microoptimization for small filters which need 4 or less weights per sample point. When I originally wrote this code, using a 1D texture seemed to give a slight speed gain, but now I couldn't measure any difference. Remove this to simplify the code.
* vo_opengl: refactor: merge convolution function and sampler entrypointwm42015-01-251-67/+36
| | | | | | | | | There's not much of a reason to have the actual convolution code in a separate function. Merging them actually simplifies the code a bit, and gets rid of the repetitious macro invocations to define the functions for each filter size. There should be no changes in behavior or output.
* vo_opengl: extend filter size to 64wm42015-01-252-3/+9
| | | | | | For better downscaling. Maybe the list of filter sizes shouldn't be static...
* vo_opengl: extend filter size to 32wm42015-01-252-25/+25
| | | | | | Also replace the weights calculations for 8/12/16 with the generic weight function definition macro. (The weights 2/4/6 follow slightly different rules.)
* gl_video: minor simplificationwm42015-01-251-4/+0
| | | | Not needed anymore.
* player: respect --untimed on last framewm42015-01-251-2/+1
| | | | | | | | | | | | | | The last video frame is another case that has a separate code path, although it's pretty similar to the one in commit 73e5aa87. Fix this in a different way, which also takes care of the last frame case, although without context the code becomes slightly more tricky. As further cleanup, move the decision about framedropping itself to the same place, so the check in vo.c becomes much simpler. The check for the vo->driver->encode flag, which is remvoed completely, was redundant too. Fixes #1480.
* image_writer: check for conversion errorswm42015-01-253-11/+17
| | | | | This can happen when e.g. a VO returns a screenshot in an unsupported format.
* x11: always use glXGetProcAddressARB()wm42015-01-251-1/+1
| | | | | | | | | | glXGetProcAddress() is outdated, and as far as I know doesn't give all the guarantees the "new" ARB function gives. Probably doesn't matter too much, because until now it always appeared to work. On the other hand, since this function is (bogusly) used only on the gl3 code path, it could have happened that users hit this, and just reverted to vo_opengl_old instead.
* video/out/win_state.c: fix --monitoraspectSoeren D. Schulze2015-01-251-1/+1
|
* x11: make display-names property stricterwm42015-01-251-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.
* command: make empty vf-metadata not an errorwm42015-01-251-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 entrypointwm42015-01-251-1/+1
| | | | | | | | This input command crashed: vf add @mf:format=yuv420p ; show_text "${vf-metadata/mf}" Fixes #1408.
* vo_opengl, x11: make legacy context warning not an errorwm42015-01-251-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.
* vo_opengl: fix broken rejection of extended scalingwm42015-01-251-3/+2
| | | | | Possibly explains why some users got mysterious FBO errors on crappy hardware.
* mp_image: reject invalid display aspect ratiowm42015-01-251-1/+1
| | | | | | | | | | Having any of these set to 0 makes no sense. I think some code might still be using 0/0 aspect ratio to signal unset aspect ratio, but I didn't find it. If there is still code like this, it should be fixed instead. Fixes #1467.
* gl_video.c: invalidate image_params in uninit_video()xylosper2015-01-251-0/+4
| | | | | | | | | | | | | When the given mp_image_params does not match with that of gl_video, gl_video_config() always calls uninit_video() but calls init_video() only if valid format is given. Since uninit_video() does not change image_params of gl_video, when the same params as the previous one is given to gl_video_config() after gl_video is unitialized with invalid format, gl_video_config() never calls init_video(). To prevent this, invalidate image_params of gl_video in uninit_video().
* dxva2: copy mp_image attributes to sw_imgJames Ross-Gowan2015-01-251-0/+1
|
* mp_image: copy missing attributesJames Ross-Gowan2015-01-251-0/+2
| | | | | This adds a couple of missing fields to mp_image_copy_attributes so things like rotation metadata work.
* cocoa: fix build on 10.9Stefano Pigozzi2015-01-251-1/+1
| | | | Use -isInFullScreenMode instead of the property introduced with the 10.10 SDK.
* cocoa: fix NSMapGet errorStefano Pigozzi2015-01-251-2/+4
| | | | regression from 64b6b2ea45
* cocoa: fix uninitialization while in fullscreenStefano Pigozzi2015-01-253-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
* screenshots: set AVFrame parameterswm42015-01-251-0/+3
| | | | | | | Currently, libavcodec is rather lenient, but it might get stricter in the future. Fixes #1398.
* cocoa: mark window for redraw after title changeStefano Pigozzi2015-01-141-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: clamp filters to their sizewm42014-12-191-1/+2
| | | | | | | | | | | This gives better results with fancy-downscaling. The issue here is that fancy-downscalign "extends" the filter radius by some amount, which requires using a larger filter size and shader. Then most of the filter is "unused", but some filters still return non-0 coefficients, which create heavy artifacts. Just clamp them off. I'm not sure if this is the right solution, but at least it's better than before.
* cocoa: don't change app activation policy in libmpvStefano Pigozzi2014-12-171-3/+4
| | | | /cc @mpv-player/stable
* vo_x11: don't attempt to resize when unconfiguredwm42014-12-171-2/+3
| | | | | | Fixes #1347. The previous commit actually fixes the crash.
* vo_x11: check allocation errorswm42014-12-171-3/+10
| | | | Avoids a crash if allocation fails.
* vd_lavc: fix error handling pathwm42014-12-171-11/+12
| | | | The ctx->pic check must uninitialize the decoder.
* mp_image: check for malloc failurewm42014-12-171-0/+2
| | | | | Or rather, the only reason av_buffer_create() can fail is a malloc failure.
* Check some mallocswm42014-12-171-0/+4
| | | | Fixes #1337.
* vo_opengl: fix linkage typewm42014-12-171-1/+1
| | | | Can happen on Windows, I suppose.
* vo_opengl: don't crash if framebuffers are not availablewm42014-12-171-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.
* w32_common: fix GUID linking in CygwinJames Ross-Gowan2014-12-171-0/+1
|
* cocoa: don't create Dock icon for audio only filesStefano Pigozzi2014-12-081-0/+21
| | | |</