summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* 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 function in this window can be very time consuming depending on video and screenshot image format and size. This results in existing file being overwritten because the file writing functions don't check for the existance of file. Fix this be opening the file in exclusive mode. Add overwrite parameter to write_image for other operations that are documented to overwrite existing files, like screenshot-to-file. Note that for write_avif, checking existance is used instead because avio_open does not support exclusive open mode.
* repack: add restrict qualifier to src/dst pointersKacper Michajłow2024-03-191-36/+36
| | | | | Allows compiler to do its job and optimize this code. We don't really want to repack in-place.
* win32: resolve dropped shell links (Windows shortcuts)nanahi2024-03-191-1/+3
| | | | | When a shell link is dropped onto the mpv window, the file name will be replaced by the file name of its target so that the linked file is played.
* video/image_writer: attach MDVC metadata and CLLI metadataLeo Izen2024-03-192-13/+8
| | | | | | | | This commit allows image_writer to attach HDR metadata to AVFrames via the corresponding AVFrameSideData attachments, if present. It does this by calling pl_avframe_set_color, already used by mp_image_to_avframe. Signed-off-by: Leo Izen <leo.izen@gmail.com>
* vo_gpu_next: make `dither-depth=auto` mean 8 bpc for non-d3d11 SDRllyyr2024-03-191-1/+5
| | | | | | | Fixes the issue described in https://github.com/mpv-player/mpv/issues/11862 for SDR files for non-d3d11 gpu-api. We currently don't have a smarter way to get the real on-the-wire bpc for other APIs, so this is the best that can be done.
* vulkan: remove color_depth stubllyyr2024-03-191-6/+0
| | | | Needed for the next commit
* vo_gpu_next: fix -Wembedded-directive warningnanahi2024-03-192-18/+19
| | | | warning: embedding a directive within macro arguments has undefined behavior
* video/out/gpu/spirv: fix warning: zero size arrays are an extensionnanahi2024-03-191-0/+1
|
* various: fix -Wold-style-declaration warningnanahi2024-03-195-6/+6
| | | | warning: `static' is not at beginning of declaration
* video/out/placebo/utils: fix -Wignored-qualifiers warningnanahi2024-03-191-1/+1
| | | | warning: type qualifiers ignored on function return type
* vo_gpu_next: don't render ASS subtitles at HDR colorspaceKacper Michajłow2024-03-181-1/+1
| | | | | | | | | | | | Upstream ASS specification says that all subtitles should be rendered with color primaries and transfer matching their associated video. But as expected after further discussion the decision has been made to fallback to SDR mode in case of HDR video. See-Also: https://github.com/libass/libass/blob/649a7c2e1fc6f4188ea1a89968560715800b883d/libass/ass_types.h#L233-L237 See-Also: libass/libass#297 See-Also: mpv-player#13381 Fixes: mpv-player#13673
* win32: remove all NC area on Windows 10 with --title-bar=noKacper Michajłow2024-03-181-3/+12
| | | | | | | | | Windows 10 top bar height cannot be adjusted individually when WS_CAPTION is enabled due to buggy DWM NC drawing behavior. The issue is fixed in Windows 11. To keep consistent window look remove the border on each side, but only on Windows 10.
* win32: add helper function to check Windows 10 build numberKacper Michajłow2024-03-181-8/+20
|
* win32: adjust top border offset when title bar is disabledKacper Michajłow2024-03-181-18/+52
| | | | | | | | | | | | | | | Windows 11 draws border regardless, so we are 1px off on window size, blending border with one line of video. Fix that by adding the border to our internal windows size calculation. Windows 10 on the other hand has a bug where specifying left and top NC area will trigger title bar drawn in full height always. Keep old behaviour in this case. Also while there is similar "visible" border there, it seems to be transparent on Windows 10. For high contrast themes, don't adjust title bar height and instead remove WS_CAPTION to have the same border all around the window, as DWM doesn't make borders invisible in this case.
* win32: add DWMWA_VISIBLE_FRAME_BORDER_THICKNESS definitionKacper Michajłow2024-03-181-1/+8
|
* win32: use dpi aware GetSystemMetricsForDpiKacper Michajłow2024-03-181-9/+19
|
* win32: update maximized state when leaving fullscreennanahi2024-03-181-6/+7
| | | | | If the window-maximized is set while in fullscreen, it needs to be applied when leaving fullscreen, as noted in the comment.
* win32: fix window maximized state after setting window sizenanahi2024-03-181-0/+20
| | | | | | | | | | | With runtime geometry change, currently it only results in a SetWindowPos call to resize the window. However, SetWindowPos doesn't change the window maximized state, so Windows still thinks that the window is maximized even though it no longer covers the whole workspace. This results in visual glitches, and if the window is dragged afterwards it's "restored" again. Fix this by correctly setting the window maximized state in this case.
* wayland_common: respect compositor's preferenced size on state changenanahi2024-03-171-4/+2
| | | | | | | | | | | Currently mpv always uses the previous window size when unmaximizing or exiting fullscreen. This disregards compositor's preferenced size in the configure event, resulting in wrong window size if changing window state and size are delivered in the same configure event. It's better to always respect the preferenced size instead, unless the state change is due to runtime geometry change, where we want to use our preference.
* wayland_common: always use the current geometry for prepare_resizenanahi2024-03-171-14/+12
| | | | | | | | | | | | | | | | | | | | In the xdg_toplevel_configure handler, in some cases the geometry is not equal to the width and height in the event. This can happen when runtime geometry change is requested (a new size is set), or in the case of wl->state_change || width == 0 || height == 0 (the old size is used). However, prepare_resize always uses the width and height in the event and not the corrected geometry here. This causes xdg_surface_set_window_geometry using the wrong value resulting in wrong size of window decoration. Amusingly, the debug message right above it uses the correct size. Fix this by using the updated geometry size instead. Since now all prepare_resize have parameters of 0, the width and height parameters are no longer needed. Fixes: 828dd65ef84b4d8e95e70752b9eb0833909d1d23
* x11_common: unmaximize window on runtime geometry changenanahi2024-03-171-9/+6
| | | | | | | | | | | | | 8e793bde78f00fbb64223db30851c6d080c4abeb made that changing geometry while maximized has no effect until the window is unmaximazed. However, this behavior is inconsistent with setting window-scale on all of win32, wayland, and x11, which always unmaximizes the window and sets the window size. Since setting geometry is conceptually similar to setting window-scale (both change the window size), they should have the same behavior. If not fullscreen, unmaximize window on runtime geometry change to keep the behavior consistent with window-scale.
* win32: support runtime geometry updatenanahi2024-03-171-5/+13
| | | | | Similar to other platforms. Also make sure that the x/y positions are set on geometry update.
* x11_common: fix window x/y position when updating geometry on runtimenanahi2024-03-172-4/+9
| | | | | | | | | | | Currently, setting geometry on runtime only changes the window size but not the position. This is because reset_size is only set if the window size is changed, and vo_x11_highlevel_resize doesn't set the window position without force_window_position enabled. Fix this by setting the related flags and perform a window move when geometry is updated. Fixes 8e793bde78f00fbb64223db30851c6d080c4abeb.
* gpu-next: add support for --dither-depth=autoKacper Michajłow2024-03-171-3/+8
| | | | | On supported APIs. Fixes: https://github.com/mpv-player/mpv/issues/11862
* d3d11: get real on the wire bits per color channelKacper Michajłow2024-03-171-0/+5
|
* d3d11: add mp_get_dxgi_output_descKacper Michajłow2024-03-172-22/+25
|
* mac/view: optimise drag and drop event handlingder richter2024-03-161-17/+11
|
* mac/input: move scroll wheel event handling into input helperder richter2024-03-161-35/+1
|
* mac/input: optimise mouse movement enabled checkder richter2024-03-161-6/+2
|
* mac/input: move mouse event handling into input helperder richter2024-03-161-47/+12
|
* vo_{drm,wlshm}: make query_format checks more correctsfan52024-03-162-6/+7
| | | | | We're using mp_sws here, so we should ask it for format support and not the underlying library (usually swscale) directly.
* vo_drm: add support for YUYV formatsfan52024-03-163-9/+20
| | | | | | | | | | As the first aligned format this required a fix to reconfig(). Adding the other component-swapped formats in this group would be trivial but I checked the DRM database [1] and no driver exists that supports one of those but not YUYV and this is quite fringe as-is, so I opted not to. [1] <https://drmdb.emersion.fr/formats>
* vo_{drm,wlshm,x11}: add support for video-target-paramssfan52024-03-163-0/+12
|
* vo: move target_params into responsibility of VOsfan52024-03-163-6/+5
| | | | | | | | | The VO generic code tries to be helpful and resets this after each reconfig. However for the simpler VOs the target params are constant after a reconfig or even for the entire lifetime. So it's clearly better to let the VO decide. This also allows the VO to use a static buffer instead.
* context_drm_egl: log fallback correctlysfan52024-03-161-0/+4
| | | | Currently a theoretical concern because we handle all existing formats.
* vo_drm: add support for BGR formatssfan52024-03-161-3/+21
|
* vo_drm: use native matching pixel format for XRGB2101010sfan52024-03-161-34/+6
|
* mac/event: move key event handling to input helper and optimise itder richter2024-03-142-6/+6
|
* mac/events: remove redundant functions and optimise input helper usageder richter2024-03-142-6/+6
| | | | some redundant functions that jump through hoops.
* mac/helper: move input ctx related functionality into new input helperder richter2024-03-145-18/+23
| | | | also make functions thread safe.
* wayland_common: move WAYLAND_DISPLAY check above vo_wayland_state initDudemanguy2024-03-131-3/+3
| | | | | | | | Segfaults otherwise on uninit because some objects are created while others are not. Move