summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* wayland: cap xdg_wm_base at 4 if wm_capabilities aren't supportedDudemanguy2024-05-161-0/+4
| | | | Fixes #13986.
* vf_vapoursynth: pass image properties from inputKacper Michajłow2024-05-121-9/+21
| | | | | | | | | | | | This might not always be correct depending on filtering done in VS. But unless VS send us all the metadata we have to get it from somewhere. Fixes dynamic frame metadata, which was copied from fmt_in, initialized only upon reinitialization. Fixes crashes caused by the use of stale pointers. Fixes: #13956
* vf_vapoursynth: fix _ChromaLocationKacper Michajłow2024-05-121-1/+2
|
* hwdec_cuda_vk: add missing io.h includeKacper Michajłow2024-05-111-0/+2
| | | | Fixes compilation on Windows with cuda enabled.
* vo_gpu_next: check if existing cache file has correct sizeKacper Michajłow2024-05-101-1/+2
|
* lcms: check for null arg in gl_parse_3dlut_sizeKacper Michajłow2024-05-091-0/+2
| | | | | | | This fixes `icc-3dlut-size` validation in config which would crash if set without argument. Found by OSS-Fuzz.
* dmabuf: fix warnings on 320-bit buildKacper Michajłow2024-05-082-4/+4
|
* filter/vf_gpu_vulkan: fix Vulkan handle typeKacper Michajłow2024-05-081-1/+1
|
* drm_prime: remove off by one when allocating new ref counterKacper Michajłow2024-05-071-4/+3
|
* drm_prime: fix issue detected by valgrindrepojohnray2024-05-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conditional jump or move depends on uninitialised value(s) at 0x10FE22: drm_prime_remove_handle_ref (drm_prime.c:144) by 0x10FCCD: drm_prime_destroy_framebuffer (drm_prime.c:107) by 0x10FEB1: set_current_frame (hwdec_drmprime_drm.c:73) by 0x11054F: overlay_frame (hwdec_drmprime_drm.c:223) by 0xF1311: gl_video_render_frame (video.c:3315) by 0xFA015: draw_frame (vo_gpu.c:85) by 0xF8FDB: render_frame (vo.c:961) by 0xF943F: vo_thread (vo.c:1099) by 0x5EBE89B: start_thread (in /lib/libpthread-2.31.so) Uninitialised value was created by a heap allocation at 0x484713C: realloc (vg_replace_malloc.c:1437) by 0x10258B: ta_realloc_size (ta.c:195) by 0x10325D: ta_xrealloc_size (ta_utils.c:298) by 0x10FDBF: drm_prime_add_handle_ref (drm_prime.c:133) by 0x10FC57: drm_prime_create_framebuffer (drm_prime.c:87) by 0x1102FF: overlay_frame (hwdec_drmprime_drm.c:188) by 0xF1311: gl_video_render_frame (video.c:3315) by 0xFA015: draw_frame (vo_gpu.c:85) by 0xF8FDB: render_frame (vo.c:961) by 0xF943F: vo_thread (vo.c:1099) by 0x5EBE89B: start_thread (in /lib/libpthread-2.31.so) Conditional jump or move depends on uninitialised value(s) at 0x10FCE4: drm_prime_destroy_framebuffer (drm_prime.c:109) by 0x10FEB1: set_current_frame (hwdec_drmprime_drm.c:73) by 0x11054F: overlay_frame (hwdec_drmprime_drm.c:223) by 0xF1311: gl_video_render_frame (video.c:3315) by 0xFA015: draw_frame (vo_gpu.c:85) by 0xF8FDB: render_frame (vo.c:961) by 0xF943F: vo_thread (vo.c:1099) by 0x5EBE89B: start_thread (in /lib/libpthread-2.31.so) Uninitialised value was created by a heap allocation at 0x484713C: realloc (vg_replace_malloc.c:1437) by 0x10258B: ta_realloc_size (ta.c:195) by 0x10325D: ta_xrealloc_size (ta_utils.c:298) by 0x10FDBF: drm_prime_add_handle_ref (drm_prime.c:133) by 0x10FC57: drm_prime_create_framebuffer (drm_prime.c:87) by 0x1102FF: overlay_frame (hwdec_drmprime_drm.c:188) by 0xF1311: gl_video_render_frame (video.c:3315) by 0xFA015: draw_frame (vo_gpu.c:85) by 0xF8FDB: render_frame (vo.c:961) by 0xF943F: vo_thread (vo.c:1099) by 0x5EBE89B: start_thread (in /lib/libpthread-2.31.so)
* various: fix comma stylenanahi2024-05-073-3/+3
|
* various: fix indentationnanahi2024-05-0711-51/+51
|
* various: fix trailing whitespacenanahi2024-05-071-2/+2
|
* hwdec_cuda: reduce nesting in check functionsJrelvas2024-05-072-20/+16
| | | | This simplifies the code and makes it easier to read.
* hwdec_cuda: avoid gpu wakeup by deferring cuInitJrelvas2024-05-074-32/+64
| | | | | | | | | | | | | | | | | | `cuInit` wakes up the nvidia dgpu on nvidia laptops. This is bad news because the wake up process is blocking and takes a few seconds. It also needlessly increases power consumption. Sometimes, a VO loads several hwdecs (like `dmabuf_wayland`). When `cuda` is loaded, it calls `cuInit` before running all interop inits. However, the first checks in the interops do not require cuda initialization, so we only need to call `cuInit` after those checks. This commit splits the interop `init` function into `check` and `init`. `check` can be called without initializing the Cuda backend, so cuInit is only called *after* the first interop check. With these changes, there's no cuda initialization if no OpenGL/Vulkan backend is available. This prevents `dmabuf_wayland` and other VOs which automatically load cuda from waking up the nvidia dgpu unnecessarily, making them start faster and decreasing power consumption on laptops. Fixes: https://github.com/mpv-player/mpv/issues/13668
* osdep/dirent: add implementation for Windows SDK buildKacper Michajłow2024-05-061-1/+0
|
* various: move strings.h inclusion to common.hKacper Michajłow2024-05-061-1/+0
|
* various: move unistd.h inclusion to common.hKacper Michajłow2024-05-068-11/+0
|
* cocoa-cb: add support for macOS color space transformation (EDR/HDR)der richter2024-05-054-1/+53
| | | | | | | | | | by default utilises the color space of the screen on which the window is located. if a specific value is defined, it will instead be utilised. depending on the chosen color space the macOS EDR (HDR) support is activated and that OS's transformation (tone mapping) is used. Fixes #7341
* win32: fix maximize state with --border=noKacper Michajłow2024-05-051-6/+10
| | | | | | WS_POPUP windows cannot be maximized, so instead of forcing it with unavoidable side-effects, change the window style before maximizing to make it work correctly.
* win32: make context menu items accessible from the window menunanahi2024-05-033-4/+30
| | | | | | This makes the context menu items accessible from the window menu, which can be opened by either right-clicking on the title bar or left-clicking on the mpv icon on the title bar.
* win32: move context menu init/uninit to GUI threadnanahi2024-05-031-2/+3
| | | | | | | | | Currently if VO init fails, the context menu is leaked. Additionally, init/uninit are in the VO thread, while other accesses are in the GUI thread. Fix this by moving them to the GUI thread, similar to other resources. This also lets init function take the mpv HWND in the next commit.
* wayland: set wl->scaling if there is no wl->current_output yetDudemanguy2024-05-031-0/+6
| | | | | | | If we get either preferred_scale or preferred_buffer_scale this early during initialization the wl->scaling value should be immediately updated instead of being deferred until later for correct geometry. Fixes #14019.
* win32: support multitouchnanahi2024-05-031-7/+54
| | | | | Use the multitouch API. To disable system's defualt mouse emulation, set --native-touch=yes.
* wayland_common: support multitouchnanahi2024-05-031-6/+7
| | | | | Use the multitouch API. No need to emulate mouse input as it's already done by the input system.
* wayland: log if cursor shape support is missingDudemanguy2024-05-021-0/+7
| | | | | This is done for the other protocol interfaces already but was accidentally omitted.
* mac: properly handle regular expressions without force unwrapder richter2024-04-281-3/+4
|
* mac: code cleanup and consistency changes, fix linting issuesder richter2024-04-287-122/+103
|
* mac/helper: make wakeup callback declaration consistentder richter2024-04-281-1/+1
|
* w32_common: fix show-in-taskbar toggling after explorer is restartednanahi2024-04-271-2/+8
| | | | | | | | | | | | | | | | | After explorer is restarted while show-in-taskbar is false, toggling show-in-taskbar no longer puts mpv back to the taskbar until it's unfocused and refocused. My guess of how this works is that the HWND of the taskbar is cached, and setting the WS_EX_TOOLWINDOW style internally uses this value to show/hide the taskbar button. But after explorer is restarted it no longer works until its taskbar state needs to change (such as focusing). Only then it realizes the HWND is no longer valid and refreshes it. Fix this by following MS documentation on this: the window needs to be hidden before changing the style, and be shown after that. This unfortunately can sometimes introduce a brief window flash, but it fixes the problem.
* vf_gpu: vulkan and egl implementationsShreesh Adiga2024-04-276-105/+333
| | | | | | | | Abstract out EGL, and allow choosing between EGL and vulkan at runtime. vf_gpu_egl.c contains GL specific context and creation/destroy code, vf_gpu_vulkan.c contains Vulkan specific. This allows vf_gpu being built in systems where EGL is not available and where Vulkan is available.
* mac: make display-names unique to allow specific selectionder richter2024-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | the Screen property localizedName returns a none unique dynamic name that doesn't allow a specific selection of a Screen on every OS boot. the name consists of the vendor name and model name (eg DELL U2723QE). if the same model display is connected to the system several times, macOS starts to add numbers to the localizedName (eg DELL U2723QE (1)), that may not be associated to the same Screen on every OS boot or connecting the display. it also changes the name of the first connected display by adding that numeration. this makes it impossible specify the proper screen with the screen-name option every time. to circumvent this we remove the enumeration from the name and instead add the serial number to the display-names property. this makes the actual Screen unique and none dynamic. furthermore the selection of a screen by name will check for equality for the old localizedName, simple name without enumeration, serial number and the combined name with serial number. this makes it possible to select the screen by either of those names and identifiers, and keeps backwards compatibility with the old behaviour. Examples: localized name (System Settings name): DELL U2723QE, DELL U2723QE (1) simple name: DELL U2723QE serial number: 123456789 combined name: DELL U2723QE (123456789)
* vo_dmabuf_wayland: use wl_fixed_from_int when setting viewport sourceDudemanguy2024-04-211-3/+3
| | | | | | | When this was originally implemented, the fixed conversion factor was accidentally reverse engineered. It was left as is though. Instead, use the wl_fixed_from_int helper, so it's more obvious what is going on here.
* vo_dmabuf_wayland: fix scaling for subsurface positioningDudemanguy2024-04-211-2/+2
| | | | | It's off if the video aspect ratio doesn't match the monitor aspect ratio. Fixes c243946338dcdcdbed9cfdc9d662d5612649932d.
* d3d11: disable IDXGIInfoQueue usage if dxgidebug.h is incompleteKacper Michajłow2024-04-193-0/+19
| | | | Older MinGW-w64 doesn't define IDXGIInfoQueue in dxgidebug.h.
* d3d11: use IDXGIInfoQueue instead ID3D11InfoQueueKacper Michajłow2024-04-193-50/+77
| | | | | | | | | DXGI debug interface encapsulate multiple message queues, which allows to get validation not only for D3D11 calls, but also DXGI ones. Also this makes leak detector not report self debug interface as alive like it was before. And same as with validation, it has ability to detect more alive objects, not being limited to D3D11.
* context_drm_egl: guard gbm_device on uninitDudemanguy2024-04-181-1/+2
| | | | | | | Not all cards support gbm which means the creation of the gbm device will fail. However during the uninit process, the destruction of the device was unconditionally done which leads to a segfault. Guard it instead. Fixes #13929.
* x11: always do a reset_size if geometry/autofit is updated at runtimeDudemanguy2024-04-181-2/+2
| | | | | | | | | | Previously, the code required a check against the old saved geometry to make sure the size and/or position was different before updating. The doesn't work with the previous changes that allow a geometry value to be set again with the same value as before. It would probably be nicer to check against something that always keeps track of the actual window size in real time, but it seems geometry in x11 doesn't quite work that way so we'll do it the easier way instead.
* various: add GPU context descriptionnanahi2024-04-1818-0/+18
| | | | | | | Now that obj_settings_list is used for GPU contexts, detailed descriptions can be added so that --gpu-context=help can print the descriptions of the GPU contexts using standard obj_settings_list help printing.
* video/out/gpu/context: add auto dummy contextnanahi2024-04-181-5/+21
| | | | | | | | | | This adds a dummy context at the start of the context lists, which serves three purposes: - The "auto" option is listed for --gpu-context=help. - Some special handlings of "auto" string are removed. - Make sure that lists have at least one element, so MP_ARRAY_SIZE() works as intended.
* video/out/gpu/context: convert --gpu-context to use obj_settings_listnanahi2024-04-182-89/+100
| | | | | | | | | | | | | | | | Since the list of available GPU contexts is a compile time constant, use obj_settings_list instead of opt_string_validate for GPU contexts. This has several advantages: - Aligns with the existing usage of vo, ao, and filter lists. - Allows custom probing order. - Allows list option suffixes. (--gpu-context-append, etc.) - Allows autocomplete in console.lua. - Uses the standard obj_settings_list help printing, so the custom help printing function is no longer needed. This also deduplicates some context creation code for ra_ctx_create and ra_ctx_create_by_name.
* video/out/gpu/context: don't use hidden flag for contextsnanahi2024-04-183-17/+24
| | | | | For contexts that have no API, just use a separate list for them. This keeps validate func for the main contexts simpler.
* vo_gpu_next: invalidate cache object if requested by libplaceboKacper Michajłow2024-04-181-3/+5
| | | | See: https://code.videolan.org/videolan/libplacebo/-/merge_requests/659
* terminal: add terminal_set_mouse_input functionnanahi2024-04-183-6/+6
| | | | This function is used to enable/disable mouse input for win32 and unix.
* vo_{tct,sixel,kitty}: implement mouse supportnanahi2024-04-183-0/+6
|
* w32_common: implement --show-in-taskbar optionnanahi2024-04-181-1/+12
| | | | | When the window style changes, use WS_EX_TOOLWINDOW style to exclude the window from the taskbar and Alt+Tab switching.
* x11_common: implement --show-in-taskbar optionnanahi2024-04-181-0/+18
| | | | | | | | | This adds a new option --show-in-taskbar, which controls whether mpv appears in taskbars. This is useful for picture-in-picture setups where the video window should not appear in taskbars. On X11, this can be controled by setting the _NET_WM_STATE_SKIP_TASKBAR window state.
* x11_common: detect wm support for _NET_WM_STATE_SKIP_TASKBARnanahi2024-04-181-0/+2
|
* player/command: add video-codec-info and audio-codec-infoKacper Michajłow2024-04-151-0/+5
| | | | | | | | | | | Adds support for extracting codec profile. Old properties are redirected to new one and removed from docs. Likely will stay like that forever as there is no reason to remove them. As a effect of unification of properties between audio and video, video-codec will now print codec (format) descriptive name, not decoder long name as it were before. In practice this change fixes what docs says. If you really need decoder name, use the `track-list/N/decoder-desc`.
* wayland: fix segfault in surface_handle_enter due to memory readllyyr2024-04-151-1/+2
| | | | Fixes: 895f40e150d4 ("wayland: only perform a rescale if window is on one output")
* wayland: check if scale actually changes in scaling eventsDudemanguy2024-04-141-2/+6
| | | | | | | The protocol strongly implies that this only happens when the value changes, and it's also what you would naturally expect. But maybe it's worth guarding this in cause for some reason the same value twice in a row happens.
* wayland: only perform a rescale if window is on one outputDudemanguy2024-04-142-34/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | The mpv window overlapping multiple outputs with different scale values can result in some weird behavior when dragging it from one monitor to another one. This is due to the way some compositors implement preferred_scale or preferred_buffer_scale (integer scale equivalent). Depending on the scale values, mpv window has to be resized to match the new scaling value (due to fractional scaling requiring a viewport). This can cause the window to become smaller and no longer overlap the monitor you were just trying to drag it to. Repeat this and the window will become smaller and smaller. Depending on the layout, the reverse can also happen (the window becomes larger). This can cause additional events to fire as the preferred_scale value may change again which does more weird things. It seems kwin is not affected by this because their implementation of preferred_scale sends the event only if the window is fully on the new monitor. Honestly, this is probably more logical anyway but we should at least deal with the other implementations better. Try to deal with it by reworking scaling changes so they only occur when the mpv window is fully on one monitor. If we get a preferred_scale event and there is an overlap, save it as a pending change to be performed on the next surface_enter or surface_leave event (whichever results in there being only one monitor. Some weird rendering glitches can still happen during overlap but this makes it usable again.
* vo_gpu_next: rotate target cropKacper Michajłow2024-04-131-2/+2
| | | | | | | | Turns out libplacebo uses unrotated target crop in relation to source. Use dst rect from VO, instead of extracting it from pl_frame, to avoid another unrotating operation. Fixes: a9354b36ca
* wayland: apply keepaspect options to wayland configure boundsDudemanguy2024-04-131-6/+15
| | | | | | | | Previously if mpv's size was constrained by the compositor's configure bounds event, there was no attempt to preserve the aspect ratio of the given coordinates if --keepaspect (the default) was used. Be sure to apply keepaspect to the bounded widths and heights if we are using this event.
* wayland: avoid unneeded calls to xdg_toplevel state functionsDudemanguy2024-04-131-11/+12
| | | | | | | | | | | The reconfigure event handles setting fullscreen, maximize, etc. We were implictly relying on the compositor to just ignore mpv if we set a redundant state (e.g. setting fullscreen when we're already fullscreen), but kwin actually doesn't and operates again. This causes some subtle issues when handling geometry on state changes. Rework the state change calls so they are only executed if wl->geometry_configured isn't set yet (i.e. the window just opened up for the first time). It's the only time this is actually needed.
* wayland: enforce a state change after a reconfigureDudemanguy2024-04-132-0/+12
| | | | | | | | If mpv is coming out of some locked size state (fullscreen, maximized, tiled), the window size given by the reconfigure event should be used assuming the --auto-window-size option is set. Fixes 8a9749b8a563f258342450160c98e9c02ebedc96
* vo_gpu_next: set target resolution to crop valueKacper Michajłow2024-04-131-2/+2
| | | | | Use rect of the actual image instead of FBO size which includes margins.
* mac/vulkan: add support for frame timing via presentation feedbackder richter2024-04-102-2/+25
|
* mac/window: fix window pinch gesture and modify current-window-scaleder richter2024-04-101-1/+1
| | | | | | | | | this will prevent jumping of the window size in the case the window size was 'externally' modified and not via the window-scale property, when using the pinch gesture. Fixes #11594 Fixes #13799
* various: make filter internal function names more descriptivenanahi2024-04-101-6/+6
| | | | | | | | | Lots of filters have generic internal function names like "process". On a stack trace, all of the different filters use this name, which causes confusion of the actual filter being processed. This renames these internal function names to carry the filter names. This matches what had already been done for some filters.
* vo_gpu_next: keep target params in priv instead of alocating itKacper Michajłow2024-04-101-4/+7
|
* Revert "vo_dmabuf_wayland: assume counter-clockwise rotations"Dudemanguy2024-04-091-4/+1
| | | | | | | | | | | | | This commit was originally sparked by a change in sway. When looking at the wording of the spec, it was believed that the rotation should be counter-clockwise. But that was interpreted incorrectly. The rotation direction in the spec is meant for compositors not clients. Clients should be rotating clockwise and compositors rotate it the opposite direction. Also see the discussion in upstream wayland*. *: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/369 This reverts commit 27ef1725e7724f4b6899e3992ac3a884db9fbe13.
* bstr: change bstr0_s to bstr0_lit, restrict it only for string literalsKacper Michajłow2024-04-081-10/+10
| | | | | | | | | A