aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
Commit message (Collapse)AuthorAge
* vo_gpu: vulkan: fix strncpy truncation in spirv_compiler_initGravatar BtbN2018-10-21
| | | | | | Fixes GCC8 warning ../video/out/gpu/spirv.c: In function 'spirv_compiler_init': ../video/out/gpu/spirv.c:68:9: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
* x11: fix icc profile when the window goes near off screenGravatar slatchurie2018-10-21
| | | | | | | | On a multi monitor setup, when the center of the window was going off screen, the icc profile would always switch to the profile of the first screen. This fixes the issue by defaulting the value to the current screen.
* vo_gpu: vulkan: fix the buffer size on partial uploadGravatar Niklas Haas2018-10-19
| | | | | | | | | | | This was pased on the texture height, which was a mistake. In some cases it could exceed the actual size of the buffer, leading to a vulkan API error. This didn't seem to cause any problems in practice, since a too-large synchronization is just bad for performance and shouldn't do any harm internally, but either way, it was still undefined behavior to submit a barrier outside of the buffer size. Fix the calculation, thus fixing this issue.
* vo_gpu: split --linear-scaling into two separate optionsGravatar Niklas Haas2018-10-19
| | | | | | | | | | | | | | | | | | Since linear downscaling makes sense to handle independently from linear/sigmoid upscaling, we split this option up. Now, linear-downscaling is its own option that only controls linearization when downscaling and nothing more. Likewise, linear-upscaling / sigmoid-upscaling are two mutually exclusive options (the latter overriding the former) that apply only to upscaling and no longer implicitly enable linear light downscaling as well. The old behavior was very confusing, as evidenced by issues such as #6213. The current behavior should make much more sense, and only minimally breaks backwards compatibility (since using linear-scaling directly was very uncommon - most users got this for free as part of gpu-hq and relied only on that). Closes #6213.
* x11_common: replace atoi with strtoulGravatar Nicolas F2018-10-19
| | | | | | Using strtol and strtoul is allegedly better practice, and I'm going for strtoul here because I'm pretty sure X11 displays cannot be in the negative.
* vo_gpu: opengl: fix segfault when gl->DeleteSync is unavailableGravatar Niklas Haas2018-10-16
| | | | | | | This deinit code was never checked, so this line would always crash on implementations without support for sync objects. Fixes #6197.
* cocoa-cb: fix side by side Split ViewGravatar Akemi2018-10-02
| | | | | | | | | | when entering a Split View a windowDidEnterFullScreen event happens without a previous toggleFullScreen call. in that case it tries to stop an animation that was never initiated by us and basically breaks the system initiated fullscreen, or in this case the Split View. immediately after entering the fullscreen it tries top stop the animation and resizes the window, which causes the window to exit fullscreen. only try to stop an animation that was initiated by us and is safe to stop.
* {mac,cocoa}: trim trailing null out of macosx_icon when loading itGravatar Rodger Combs2018-10-02
| | | | | | This prevents crashes when loading the application icon image. Suggested-by: Akemi <der.richter@gmx.de>
* cocoa-cb: add Apple Software Renderer supportGravatar Akemi2018-09-30
| | | | | | by default the pixel format creation falls back to software renderer when everything fails. this is mostly needed for VMs. additionally one can directly request an sw renderer or exclude it entirely.
* cocoa-cb: move macOS option retrieval to the earliest point possibleGravatar Akemi2018-09-30
| | | | | | | moved the retrieval of the macOS specific options from the backend initialisation to the initialisation of the CocoaCB class, the earliest point possible. this way macOS specific options can be used for the opengl context creation for example.
* drm_atomic: Allow to create atomic context w/o drmprime video planeGravatar Anton Kindestam2018-09-30
| | | | | | | | | | | | | | | This is to improve the experience when running with default settings on a driver that doesn't have any overlay planes (or indeed only one plane), but still supports DRM atomic. Since the drmprime video plane is set to pick an overlay plane by default it would fail on these drivers due to not being able to create any atomic context. Users with such cards had to specify --drm-video-plane-id manually to some bogus value (it's not used after all). The "video" plane is only ever used by the drmprime-drm hwdec interop, which is not used at all in the typical usecase where everything is actually rendered on to the "OSD" plane using EGL, so having an atomic context without the "video" plane should be fine most of the time.
* vo_gpu: fix vec3 packing in UBOs/push_constantsGravatar Niklas Haas2018-09-29
| | | | | | | | | | | For vec3, the alignment and size differ. The current code will pack a struct like { vec3; float; vec2 } into 8 machine words, whereas the spec would only use 6. This actually fixes a real bug: The only place in the code I could find where it was conceivably possible that a vec3 is followed by a float was when using --gpu-dumb-mode in combination with --gamma-factor, and only when --gpu-api=vulkan. So it's no surprised nobody ran into it yet.
* vo_gpu: use explicit offsets for push constantsGravatar Niklas Haas2018-09-29
| | | | | | | | | These used to be unsupported long ago, but it seems glslang added support in the meantime. (I don't know which version, but I'm guessing it was long enough ago that we don't have to add a feature check) Should hopefully help make push constant layouts more robust against possible bugs either in our code or in the driver.
* vo_gpu: adjust PRNG variant used by GL shadersGravatar sfan52018-09-26
| | | | | | | | | | | Certain low-end Mali GPUs have a rather low precision and overflow during the PRNG calculations, thereby breaking e.g. deband-grain. Modify the permute() to avoid this, this does not impact the quality of PRNG output (noticeably). This problem was observed on: GL_VENDOR='ARM', GL_RENDERER='Mali-T720' GL_VERSION='OpenGL ES 3.1 v1.r15p0-00rel0.bdd9e62cdc8c88e0610a16b5901161e9'
* mp_image: strip all HDR peak information from SDR clipsGravatar Niklas Haas2018-09-05
| | | | | | | By overriding it with 1.0 (aka SDR). This prevents blowing up on mistagged clips. Fixes #6111
* vo_gpu: switch to optimization level performanceGravatar Niklas Haas2018-09-01
| | | | | | Upstream has this now. Didn't really make any different for me (except making the polar compute shader 2%-3% faster), but maybe it does for somebody else.
* vo_gpu: avoid overwriting compute shader block sizesGravatar Niklas Haas2018-08-26
| | | | | | | | | | When using multiple compute shaders as part of the same pass, there can be a conflict in the block sizes. In the problematic case, the HDR detection shader can collide with the polar sampling shader. In this case, the solution is clear - the passes that can handle any size should "give in" and not overwrite the block sizes. Fixes #6083.
* wscript: split egl-android from androidGravatar Tom Yan2018-08-20
|
* cocoa-cb: fix crash on macOS 10.10Gravatar Akemi2018-08-11
| | | | | | the colorspace of the layer is only available on 10.11 and upwards. Fixes #6041
* cocoa-cb: fix crash when no screen is availableGravatar Akemi2018-08-11
| | | | | | | | instead of force unwrapping and chaining the optional vars in our containsMouseLocation function, safely unwrap and guard the resulting var. Fixes #6062
* hwdec_vaegl: Fix VAAPI EGL interop used with gpu-context=drmGravatar Anton Kindestam2018-07-09
| | | | | | | | Add another parameter to mpv_opengl_drm_params to hold the FD to the render node, so that the fd can be passed to hwdec_vaegl. The render node is opened in context_drm_egl and inferred from the primary device fd using drmGetRenderDeviceNameFromFd.
* context_drm_egl: Fix CRTC setup and release code when using atomicGravatar Anton Kindestam2018-07-09
| | | | | | | | | | The previous code did not save enough information about the old state, and could end up changing what plane the fbcon:s FB got attached to, or in worse case causing a blank screen (observed in some multi-screen setups on Sandy Bridge). In addition refactor the handling of drmModeModeInfo property blobs to not leak, as well as enable reuse of already created blobs.
* context_drm_egl: Fix some memory leaks on error exitGravatar Anton Kindestam2018-07-09
| | | | | Fix some memory leaks on error exit in crtc_setup_atomic and crtc_release_atomic.
* gpu: prefer 16bit floating point FBO formats to 16bit integer onesGravatar Jan Ekström2018-07-08
| | | | | | According to earlier discussions, this can improve visual quality. This only changes the preferred order of the formats, not the formats themselves.
* cocoa-cb: fix building with Swift 4.2Gravatar Akemi2018-06-12
| | | | | | | | | init is a reserved keyword and Swift 4.2 got a bit stricter about using it. this could be fixed by adding apostrophes around init but makes the code uglier. hence i just renamed init to initialized and for consistency uninit to uninitialized. Fixes #5899
* cocoa-cb: remove pre-allocation of window, view and layerGravatar Akemi2018-06-12
| | | | | | | | | | | the pre-allocation was needed because the layer allocated a opengl context async itself and we couldn't influence that. so we had to start the core after the context was actually allocated. furthermore a window, view and layer hierarchy had to be created so the layer would create a context. now, instead of relying on the layer to create a context we do this manually and re-use that context later when the layer wants to create one async itself.
* vo_libmpv: pass vo struct to the control callbackGravatar Akemi2018-06-12
|
* hwdec_drmprime_drm: Do not show error message during probingGravatar Anton Kindestam2018-06-08
| | | | | Change the log-level of an error message that would sometimes show up during hwdec probing, and could be misleading.
* vo_sdl: add support for screensaver VOCTRL'sGravatar sfan52018-06-02
| | | | | Previously vo_sdl would unconditonally disable the screensaver, ignoring the `stop-screensaver` option.
* vo_gpu: desaturate after peak detectionGravatar Niklas Haas2018-05-31
| | | | | | | | | | This sacrifices some dynamic range for well-behaved sources, but prevents catastrophic desaturation on badly mastered / too bright sources. I think that's the better trade-off. This makes the desaturation algorithm much "safer" to deploy by default, as well. One could even argue going up to strength 1.0, which works better for some sources but worse for others. But I think the current strength is the best trade-off even after this change.
* input: add a define for the number of mouse buttons and use itGravatar wm42018-05-25
| | | | (Why the fuck are there up to 20 mouse buttons?)
* vd_lavc: minor simplification for get_format fallbackGravatar wm42018-05-25
| | | | | | | | | | | The default get_format does exactly do this, so we don't need to duplicate it. The only potential problem with this is that the logic doesn't entirely prevent that the avcodec_default_get_format hw_device_ctx path is triggered, which would probably work, but has unknown consequences and interactions. But the way the logic currently works it can't happen, provided the hwaccel metadata libavcodec provides is correct.
* x11: support Shift+TABGravatar Niklas Haas2018-05-24
| | | | | | | | | | | | | | For some reason, the X default modifier map binds shift+tab to ISO_Left_Tab instead of the regular Tab. So to get Shift+TAB recognized by mpv, we also need to accept ISO_Left_Tab. This patch matches what other programs like e.g. Qt do, which treat Tab and ISO_Left_Tab as the same thing. God only knows why the distinction exists, and why X decides to mix up its bindings like that. Fixes #5849
* wayland_common: require wl_compositor of version 3Gravatar Rostislav Pehlivanov2018-05-20
| | | | | We already did require it, in order to call set_buffer_scale. This just makes it error out more gracefully.
* wayland_common: fix maximized stateGravatar Rostislav Pehlivanov2018-05-20
| | | | Window size should not change if the window has been maximized or tiled.
* vo_gpu: allow higher icc-contrast and improve loggingGravatar Niklas Haas2018-05-17
| | | | | | | | | | With the advent of actual HDR devices, my real measured ICC profile has an "infinite" contrast, since the display is completely off on pure black inputs. 100k:1 might not be enough, so let's just bump it up to 1m:1 to be safe. Also, improve the logging in the case that the detected contrast is too high by default.
* drm_atomic: Fix memory leaks in drm_atomic_createGravatar Anton Kindestam2018-05-08
| | | | | | | | | First fix a memory leak when skipping cursor planes by inverting the check and putting everything, but the free, in the body. Then fix a missed drmModeFreePlane by simply copying the fields of the drmModePlane we are interested in and freeing the drmModePlane struct early.
* build: make encoding mode non-optionalGravatar wm42018-05-03
| | | | Makes it easier to not break the build by confusing the ifdeffery.
* encode: get rid of the output packet queueGravatar wm42018-05-03
| | | | | | | | | | | | Until recently, ao_lavc and vo_lavc started encoding whenever the core happened to send them data. Since audio and video are not initialized at the same time, and the muxer was not necessarily opened when the first encoder started to produce data, the resulting packets were put into a queue. As soon as the muxer was opened, the queue was flushed. Change this to make the core wait with sending data until all encoders are initialized. This has the advantage that we don't need to queue up the packets.
* vo_lavc: explicitly skip redraw and repeated framesGravatar wm42018-05-03
| | | | | | | | | | | The user won't want to have those in the video (I think). The core can sporadically issue redraws, which is what you want for actual playback, but not in encode mode. vo_lavc can explicitly detect those and skip them. It only requires switching to a more advanced internal VO API. The comments in vo.h are because vo_lavc draws to one of the images in order to render OSD. This is OK, but might come as a surprise to whoever calls draw_frame, so document it. (Current callers are OK with it.)
* encode: remove old timestamp handlingGravatar wm42018-05-03
| | | | | This effectively makes --ocopyts the default. The --ocopyts option itself is also removed, because it's redundant.
* drm_atomic: Disallow selecting cursor planes using the optionsGravatar Anton Kindestam2018-05-01
|
* drm_common: Be smarter when deciding on which CRTC and Encoder to useGravatar Anton Kindestam2018-05-01
| | | | | | | | | | | | | | | | | Inspired by kmscube, first try to pick the Encoder and CRTC already associated with the selected Connector, if any. Otherwise try to find the first matching encoder & CRTC like before. The previous behavior had problems when using atomic modesetting (crtc_setup_atomic) when we picked an Encoder & CRTC that was currently being used by the fbcon together with another Encoder. drmModeSetCrtc was able to "steal" the CRTC in this case, but using atomic modesetting we do not seem to get this behavior automatically. This should also improve behavior somewhat when run on a multi screen setup with regards to deinit and VT switching (still sometimes you end up with a blank screen where you previously had a cloned display of your fbcon)
* context_drm_egl: fix some comments and log messages that had not been ↵Gravatar Anton Kindestam2018-05-01
| | | | updated since the plane rename commit
* drm/atomic: Fix crtc_setup_atomic and crtc_release_atomicGravatar Anton Kindestam2018-05-01
| | | | | | | | | | | Add some properties which where forgotten in crtc_setup_atomic. In both change to not use DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK flags. This should make it more similar to the drmSetCrtc which it aims to replace (take effect directly, and blocking call). This also saves us the trouble of having to set up a poll to wait for pageflip, which would've been neccesary with DRM_MODE_PAGE_FLIP_EVENT, in both crtc_setup_atomic and crtc_release_atomic.
* drm/atomic: disable video plane when unused.Gravatar LongChair2018-05-01
| | | | | | | | | | This patch will make sure that the video plane is hidden when unused. When using high resolution modes, typically UHD, and embedding mpv, having the video plane sitting in the back when you don't play any video is eating a lot of memory bandwidth for compositing. That patch makes sure that the video layer is just disabled before and after playback.
* drm/atomic: add atomic modesetting.Gravatar LongChair2018-05-01
| | | | | | | This commit allows to add atomic modesetting when using the atomic renderer. This is actually needed when using and osd with a smaller size than screen resolution. It will also make the drm atomic path more consistent
* drm/atomic: refactor planes namesGravatar LongChair2018-05-01
| | | | | | | | We are currently using primary / overlay planes drm objects, assuming that primary plane is osd and overlay plane is video. This commit is doing two things : - replace the primary / overlay planes members with osd and video planes member without the assumption - Add two more options to determine which one of the primary / overlay is associated to osd / video. - It will default osd to overlay and video to primary if unspecified
* drm/atomic: add connector to atomic contextGravatar LongChair2018-05-01
| | | | | | | | | | This patch adds - DRM connector object to atomic context. - fd property to the drm atomic object as well as a method to read blob type properties. This allows to ensure that the proper connector is picked up, especially when specifying it from the commandline, and also allows to make sure we're using the right one when embedding with interop into an application.
* drm/atomic: refactor hwdec_drmprime_drm with native resourcesGravatar LongChair2018-05-01
| | | | | | | | | | | | | | | | | That new API was introduced and allows to have several native resources. Thisuses that mechanisma for drm resources rather than the deprecated opengl-cb structs. This patch therefore add two structs that can be used with the drm atomic interop. - mpv_opengl_drm_params : which will hold all the drm handles - mpv_opengl_drm_osd_size : which will hold osd layer size This commit adds a drm-osd-size=WxH parameter to commandline which allows to define the OSD plane dimension. OSD can be upscaled to screen resolution when having OSD at video resolution is too heavy. This is especially useful for UHD modes on embedded devices where the GPU cannot handle UHD modes at a decent framerate.