summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* vo_dmabuf_wayland: use wl_fixed_from_int when setting viewport sourceHEADmasterDudemanguy40 hours1-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 positioningDudemanguy40 hours1-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łow4 days3-0/+19
| | | | Older MinGW-w64 doesn't define IDXGIInfoQueue in dxgidebug.h.
* d3d11: use IDXGIInfoQueue instead ID3D11InfoQueueKacper Michajłow4 days3-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 uninitDudemanguy5 days1-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 runtimeDudemanguy5 days1-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 descriptionnanahi5 days18-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 contextnanahi5 days1-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_listnanahi5 days2-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 contextsnanahi5 days3-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łow5 days1-3/+5
| | | | See: https://code.videolan.org/videolan/libplacebo/-/merge_requests/659
* terminal: add terminal_set_mouse_input functionnanahi5 days3-6/+6
| | | | This function is used to enable/disable mouse input for win32 and unix.
* vo_{tct,sixel,kitty}: implement mouse supportnanahi5 days3-0/+6
|
* w32_common: implement --show-in-taskbar optionnanahi6 days1-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 optionnanahi6 days1-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_TASKBARnanahi6 days1-0/+2
|
* player/command: add video-codec-info and audio-codec-infoKacper Michajłow8 days1-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 readllyyr8 days1-1/+2
| | | | Fixes: 895f40e150d4 ("wayland: only perform a rescale if window is on one output")
* wayland: check if scale actually changes in scaling eventsDudemanguy9 days1-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 outputDudemanguy9 days2-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łow10 days1-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 boundsDudemanguy10 days1-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 functionsDudemanguy10 days1-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 reconfigureDudemanguy10 days2-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łow10 days1-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 richter13 days2-2/+25
|
* mac/window: fix window pinch gesture and modify current-window-scaleder richter13 days1-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 descriptivenanahi13 days1-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łow13 days1-4/+7
|
* Revert "vo_dmabuf_wayland: assume counter-clockwise rotations"Dudemanguy14 days1-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
| | | | | | | | | Allows to avoid non-portable strlen usage. Also avoid "initializer element is not constant" warnings on older GCC that doesn't like explicit type specification in aggregate initialization. Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: nanahi <130121847+na-na-hi@users.noreply.github.com>
* vo_tct: reduce lut_item size and generate it without snprintfKacper Michajłow2024-04-071-6/+11
|
* vo_tct: use fwrite when appropriateKacper Michajłow2024-04-071-11/+9
|
* vo_tct: add synchronized output supportKacper Michajłow2024-04-071-0/+4
| | | | See-Also: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
* vo_tct: add --vo-tct-buffering optionKacper Michajłow2024-04-071-9/+36
|
* misc/bstr: add bstr0_s for static initializationKacper Michajłow2024-04-071-12/+12
|
* vo_tct: write frame fully instead of every pixelKacper Michajłow2024-04-071-48/+44
| | | | | | | This is multiple times faster than just writing every pixel sequence separately. Especially on slower terminal emulators. In general no need to stress I/O, while we can just prepare the frame to print and do it once.
* vulkan: use pl_vk_inst_createKacper Michajłow2024-04-072-39/+39
| | | | | | | | | | | | This change is mostly motivated by missing VK_KHR_portability_enumeration instance extension when enumerating the devices. Which causes issues with MoltenVK which does not advertise full Vulkan conformance. To avoid duplicating code use pl_vk_inst_create() which correctly query availability and enables the mentioned extension. While at it fix the VkInstance leaking in vk_validate_dev().
* vo: add win32 context menu supportShuanglei Tao2024-04-064-0/+291
|
* mac/common: reuse hidpi window scale frame calculation helperder richter2024-04-041-4/+2
|
* mac/window: cleanup unfsContentFrame usage and make it none optionalder richter2024-04-041-10/+8
|
* mac/window: fix unfs window size retrievalder richter2024-04-042-0/+4
| | | | | | the unfsContentFrame wasn't updated when externally resized leading to a wrong unfs window size afterwards. update it on windowDidResize event when not in fs, not animating and not live resizing.
* wayland_common: set mouse position on pointer enternanahi2024-04-011-0/+7
| | | | | | | | | At least on some compositors, when the pointer enters a surface, only a wl_pointer_enter event is generated, but not wl_pointer_motion. This results in the initial mouse position being lost, which is especially problematic when input simulation is used. Fix this by setting the mouse position on pointer enter event.
* mac/view: fix cursor visibility when toggling fullscreender richter2024-03-291-3/+3
| | | | | | | | | | | this broke with the recent refactor of the input handling. one of the edge cases was not considered, where not every mouse down event has a corresponding mouse up event, eg all double clicks or more only have one up event after the first down event. this was handled correctly previously. Fixes #13777
* mac: cleanup swift bridge header imports and unify themder richter2024-03-293-2/+5
|
* mac/log: rename log functions and cleanup classder richter2024-03-295-29/+29
|
* mac: use LogHelper directly instead of mp_logder richter2024-03-293-8/+8
|
* mac: rename mpvHandle to mpvder richter2024-03-291-5/+4
|
* mac: remove now unnecessary objective-c forwardingder richter2024-03-291-1/+1
|
* mac/apphub: move menu bar into AppHubder richter2024-03-291-7/+5
|
* mac/apphub: move app icon into AppHubder richter2024-03-291-4/+2
| | | | | split up AppHub header in obj-c and c parts and make it a bidirectional bridging.
* win32: fix native key repeat supportnanahi2024-03-291-5/+2
| | | | | | | win32 does not respect --native-keyrepeat option, and native key repeat has been broken since 0ab3482f73a199b2e839ad4ec0a4b21adc1e75d5. This lets mpv respect the --native-keyrepeat option on win32.
* vo_gpu: support video-target-paramsnanahi2024-03-273-0/+27
|
* vo_direct3d: support video-target-paramsnanahi2024-03-271-0/+13
| | | | The backbuffer format is available.
* vo_xv: support video-target-paramsnanahi2024-03-271-0/+8
| | | | | The target colorspace depends on whether the xv adaptor supports setting BT.709 colorspace.
* cocoa-cb: use EventHelper for event handlingder richter2024-03-241-8/+4
|
* cocoa-cb: use a separate mpv_handle for cocoa-cb to simplify shutdownder richter2024-03-241-5/+4
|
* mac/apphub: migrate remaining events functionality to new AppHubder richter2024-03-241-1/+1
| | | | | | | | add new app_bridge objc file for bridging between mpv core and app functionality. replace old EventsResponder singleton with AppHub. another step to clean up all App functionality and have one central place for it.
* hwdec/vulkan: enable the stable AV1 extensionLynne2024-03-241-2/+1
| | | | | | | As no drivers were ever released with the unstable extension, it's not needed anymore. Not bumping the required headers version yet.
* mac: optimise and shorten some codeder richter2024-03-213-15/+6
|
* mac/option: remove now unused computed option variablesder richter2024-03-211-1/+0
|
* mac/option: rename option structs to properly represent their contentder richter2024-03-216-59/+59
| | | | also optimise option cache setup.
* mac/libmpv: remove mac option handling in favour of option handlerder richter2024-03-211-4/+4
| | | | | | since the option handler is not optional anymore and available on init in cocoa-cb we don't need to duplicate this functionality in libmpv anymore.
* mac/option: make option helper none optionalder richter2024-03-216-79/+49
| | | | gets rid of some unwrapping boilerplate and nil coalescing operators.
* mac/option: make option helper vo struct independentder richter2024-03-213-6/+9
|
* mac/option: remove unused and obsolete variablesder richter2024-03-212-2/+2
|
* mac/option: move option functionality from mpv helper to option helperder richter2024-03-216-90/+90
| | | | delete now empty mpv helper
* mac/type: move c<>swift type bridging into a dedicated type helperder richter2024-03-211-20/+20
|
* video/egl_helpers: fix fallback logic for EGL_KHR_create_contextsfan52024-03-211-3/+4
| | | | | | | | | | | | Both possible paths had bugs: For OpenGL it passed EGL_CONTEXT_CLIENT_VERSION, which - in older versions of the standard - was not permitted. For GLES it always assumed EGL_CONTEXT_FLAGS_KHR to work, which belongs to the aforementioned extension. Ironically this was never a problem (probably saved by implementations not being overly strict) except in 2024 on an emulated Android 14 device that trips over this edge case. It is a mystery.
* video/egl_helpers: log error for eglCreateContextsfan52024-03-211-1/+2
|
* various: use thread safe mp_strerror()nanahi2024-03-192-2/+3
|
* image_writer: refactor screenshot write functionsnanahi2024-03-191-50/+24
| | | | | | | | | | | | When 3cb9119984b88b31a5b958b1b83efe8d1cf0b818 introduced AVIF screenshot support, FILE * in write functions were replaced by filenames. This resulted in unnecessary duplication of FILE * handling code and the usage of avio_open API made it hard to use exclusive open with it. To unify file handling, use avio_open_dyn_buf instead which writes to memory instead. This way FILE * can be used for the write functions and file handling code can be deduplicated. Since we now control the file opening, exclusive open can now be used for AVIF screenshots.
* image_writer: fix TOCTOU in screenshot filename generationnanahi2024-03-193-11/+26
| | | | | | | | | | | | | | | | The screenshot command is documented to not overwrite existing files. However, there is a race window between the filename is generated with gen_fname and when the file is open to write. Specifically, the convert_image fun