summaryrefslogtreecommitdiffstats
path: root/video/out/vo_gpu_next.c
Commit message (Collapse)AuthorAgeFilesLines
* vo_gpu_next: only increment osd_sync in update_overlays if pausedDudemanguy2023-10-131-1/+1
| | | | | While the video playing, it's not actually needed and can cause unnecessary redraws. Fixes #12623.
* vo: change vo->driver->wait_events to nanosecondsDudemanguy2023-10-101-3/+3
| | | | | | | | | | | | In many cases, this is purely cosmetic because poll still only accepts microseconds. There's still a gain here however since pthread_cond_timedwait can take a realtime ts now. Additionally, 37d6604d70c8c594de2817db26356c4c950ac0fd changed the value added to timeout_ms in X11 and Wayland to ensure that it would never be 0 and rounded up. This was both incomplete, several other parts of the player have this same problem like drm, and not really needed. Instead the MPCLAMP is just adjusted to have a min of 1.
* vo_gpu_next: improve updating overlaysDudemanguy2023-10-051-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | fbe154831a8addfc18a4f81e1c4b9284c31acace added a new VOCTRL to signal when the OSD changed for gpu-next's handling of subtitles, but this is both not necessary and actually incomplete. The VOCTRL would signal OSD changes, but not all subtitle changes (like selecting another non-external sub track for example). VOCTRL_OSD_CHANGED was used to increment p->osd_sync which would then redraw the blended subtitles if the player was paused. But there's already a VOCTRL_PAUSE and VOCTRL_RESUME. Plus, the sub_bitmap_list object will have items in it if it changed in any way, so we don't need the VOCTRL_OSD_CHANGED method at all. That can be removed. The check that fp->osd_sync < p->osd_sync stays in place since that's an optimization while the video is playing, but we also check the pause state as well since the VO can know this. If we're paused, then always do update_overlays since core must be signalling a redraw to us if we get a draw_frame call here. Additionally in update_overlays itself, the p->osd_sync counter is incremented if we have any items since the frame signature will need that. As for the actual bug that is fixed, changing subtitle tracks while paused with blended subtitles now correctly works. Previously, it was never updated so the old subtitle stayed there forever until you deselected it (since VOCTRL_OSD_CHANGED triggered there). Also include some cosmetic code fixes that were noticed.
* vo_gpu: remove --scaler-lut-sizeNiklas Haas2023-09-251-1/+0
| | | | | | | Pointless bloat option, hard-coded as 256 now in libplacebo and no reason not to also hard-code in mpv. See-Also: haasn/libplacebo@64d7c5aab06766a9492d3cfffd35333792052cd9
* vo_gpu: remove --scale-cutoff etcNiklas Haas2023-09-251-1/+0
| | | | | | | Pointless bloat option, hard-coded as 1e-3 now in libplacebo and no reason not to also hard-code in mpv. See-Also: haasn/libplacebo@64d7c5aab06766a9492d3cfffd35333792052cd9
* vo_gpu_next: use proper color for subtitlesKacper Michajłow2023-09-211-19/+28
| | | | | All SUBBITMAP_LIBASS are converted to sRGB beforehand, for the rest we need to use video color space.
* vo_gpu_next: fix unscaled screenshot with --blend-subtitlesKacper Michajłow2023-09-211-4/+4
| | | | Need to use correct adjusted dst.
* vo: make cscale follow scale by defaultKacper Michajłow2023-09-191-1/+3
|
* vo_gpu_next: fix blur and taper values being zerollyyr2023-09-181-2/+4
| | | | | This would always apply the config blur and taper values to the kernel, even if it was zero because the user didn't specify any.
* vo_gpu_next: remove ewa_lanczossharp nagNiklas Haas2023-09-161-6/+0
| | | | | | | Upstream finally caved in to peer pressure and added this filter. Of course, this also removes the fallback for people on older versions of libplacebo, but people using mpv git master are probably using libplacebo git master anyway. It's time to debloat this code.
* vo_gpu_next: update for new ICC profile APINiklas Haas2023-09-151-38/+60
| | | | | | | | | Upstream has moved from passing struct pl_icc_profile to directly attaching a managed pl_icc_object, plus providing a new function pl_icc_update to update the ICC profile object parameters (if needed). To facilitate this move, pull our ICC params back out of pl_options and update the target ICC object directly.
* vo_gpu_next: map --scaler-resizes-onlyNiklas Haas2023-09-141-0/+3
|
* vo_gpu_next: support --blend-subtitles when taking screenshootKacper Michajłow2023-09-091-3/+25
|
* vo_gpu_next: support crop in video_screenshotKacper Michajłow2023-09-091-4/+11
|
* vo_gpu_next: forwards compatibility with pl_cacheNiklas Haas2023-09-081-0/+13
| | | | | | | Interrim solution, forwards compatible with new and backwards compatible with old API. Eventually, we will want to discontinue the use of deprecated pl_icc_params.save/load and pl_renderer_save/load, but that requires minimum version bump.
* vo_gpu_next: don't rotate gamut visualizationNiklas Haas2023-09-021-7/+5
| | | | | | | | | | Causes bad performance with interpolation because the changing hue angle invalidates the mixing cache, as a result of libplacebo implementations (specifically, the fact that this graph is drawn during the color management process, instead of as a separate overlay). Fix it by just hard-coding a particular, relatively interesting plane (pi/4 approximately maps onto the red-blue axis).
* vo_gpu_next: improve --tonemapping-visualizeNiklas Haas2023-08-301-0/+25
| | | | | | | | | | | | | | | Pick a smarter rect, limit it to right half of screen (to allow more easily using it simultaneously with stats), and also auto-rotate through the hue plane by default (wrapping once every 10 seconds of playback). I briefly considered making it based on wallclock time instead of pts, but this has the rather unfortunate downside of only being updated sporadically as the user moves the mouse over OSC elements. (Of course, we could also forcibly redraw the screen continously to avoid it, but I'd rather not make such an invasive change for no real reason) This design also allows you to pause and focus on (via framestepping) individual parts of the hue graph that you're interested in.
* vo_gpu_next: add support for VOCTRL_HDR_METADATAKacper Michajłow2023-08-291-0/+34
|
* vo_gpu_next: fix --target-contrast=infNiklas Haas2023-08-281-1/+1
| | | | | | Somehow this overrode max_luma instead of min_luma... Fixes: 347fbd6fa357e854cfb0bc6d3c9b3d12994d5c0c
* vo_gpu_next: update tmp params before rendering frameNiklas Haas2023-08-271-7/+6
| | | | | Gives the correct queue size value for the subsequent pl_queue_update() calls, which avoids a bit of unnecessary overhead.
* vo_gpu_next: make option shim consistent with new APINiklas Haas2023-08-271-18/+20
| | | | | Avoids some unnecessary #ifdef and allows us to isolate the shim to a single location.
* vo_gpu_next: avoid duplicate code (cosmetic)Niklas Haas2023-08-271-5/+4
| | | | Also avoids 80col violation.
* vo_gpu_next: correctly set params.frame_mixerNiklas Haas2023-08-271-4/+3
| | | | | | | This was incorrectly adapted from the old options system, we forgot to ever actually assign p->frame_mixer to params.frame_mixer. Fixes: d2082841df8bc39c585fc9d4be6498d1a296fed8
* vo_gpu_next: don't nuke main options state in video_screenshotNiklas Haas2023-08-271-6/+13
| | | | | | | | This actually fixes a bug that was present in this code even before the new pl_options system, which is that `video_screenshot` would permanently leave `peak_detect_params.allow_delayed` as false, until something else forced options re-application due to options cache change.
* vo_gpu_next: don't override main options in draw_frameNiklas Haas2023-08-271-8/+10
| | | | | | | Instead, take a stack copy of the relevant struct. Avoids leaving temporary state dangling after this function returns. Fixes: 40b6afcfca81a30c29531a49b6368b53ad5d501f
* vo_gpu_next: move line to correct location (cosmetic)Niklas Haas2023-08-211-1/+1
|
* vo_gpu_next: correctly handle GAMUT_AUTONiklas Haas2023-08-211-3/+3
| | | | Fixes: https://github.com/mpv-player/mpv/issues/12208
* vo_gpu_next: reword error message on empty screenshotNiklas Haas2023-08-211-1/+1
| | | | | This can happen under perfectly legitimate circumstances if no file is loaded yet.
* vo_gpu_next: correctly clear removed hooksNiklas Haas2023-08-191-0/+1
| | | | | | | | Before d208284, this was implicitly reset back to 0 at the start of every update_options(). But we no longer explicitly reset par->params, so we need to do it manually here for the hooks. Fixes: https://github.com/mpv-player/mpv/issues/12203
* vo_gpu_next: fix typo in video_screenshot()Niklas Haas2023-08-191-1/+1
| | | | | | | Undefined behavior (bad initializer). Somehow didn't trigger a warning on my end... Fixes: a8192eda6cfc909fc9f5f62e36523b53c0300eff
* vo_gpu_next: add --libplacebo-optsNiklas Haas2023-08-191-0/+7
| | | | To help test not-yet-exposed options, and for debugging purposes.
* vo_gpu_next: don't re-set frame_mixerNiklas Haas2023-08-191-1/+2
| | | | This is already set by map_scaler, just disable it if unwanted.
* vo_gpu_next: move allow_delayed to move appropriate placeNiklas Haas2023-08-191-1/+1
| | | | No need to override this so late in the general (non-screenshot) code.
* vo_gpu_next: switch to new pl_options systemNiklas Haas2023-08-191-99/+124
| | | | | | | | | | | | | | | With a backwards compatibility shim for older versions of libplacebo in which we simply define the relevant subset of this struct ourselves and initialize it to known-good values, to be able to continue using our options assigning code. It's worth pointing out that our use of scalers deviates from how pl_options was intended to be used, as a consequence of backwards compatibility with pre-308 versions of libplacebo. But this should work fine in practice, since we don't care about serializing these custom scalers correctly. Users can still override them using the built-in pl_options scalers when loading custom scalers via --libplacebo-options. (To be added in the next commit)
* vo_gpu_next: fix leak of --icc-profile-auto on uninitNiklas Haas2023-08-181-1/+1
| | | | | | This was already correctly freed when acquiring a new profile, but never freed on uninit. Fix by reparenting the profile onto `p`, which is what vo_gpu also does.
* vo_gpu_next: drop redundant PL_HAVE_LCMS checkNiklas Haas2023-08-181-20/+1
| | | | | This header is installed unconditionally starting with libplacebo v4.208.0, so we are safe to remove the check.
* vo_gpu_next: use pl_dispatch_info_move to avoid useless data copyKacper Michajłow2023-08-181-21/+46
| | | | | Instead copy the data on-demand when VOCTRL_PERFORMANCE_DATA is requested.
* vo_gpu_next: drop PL_API_VER compatibility pathsNiklas Haas2023-08-181-46/+0
| | | | v6.292 implied by minimum dependency.
* vo_gpu_next: actually fix screenshots with PARDudemanguy2023-08-081-2/+10
| | | | | | | | | | | 983e8f0100b98bd8aed48e5fe86dd5682174b04e resulted in the correct dimensions, but it was not actually right because vo_gpu_next still had the src and dst rects the same. This just needs to work like how vo_gpu does where the src is the image params and the dst is desired output. So basically, just copy that code over here. Fixes #12108 and as a bonus, overriding the aspect ratio now results in correct screenshots (previously didn't work at now and then with the above commit it had correct dimensions but still incorrect output).
* vo_gpu_next: take into account PAR when taking screenshotsDudemanguy2023-08-071-1/+2
| | | | | | Using the width and height params directly doesn't actually work if PAR is something other than 1. Instead, use mp_image_params_get_dsize and calculate the correct dimensions which matches the vo_gpu behavior.
* vo_gpu_next: add ability to use named hook paramsNiklas Haas2023-08-071-1/+14
| | | | Closes: https://github.com/mpv-player/mpv/issues/12093
* vo_gpu_next: increase non-interpolation queue sizeNiklas Haas2023-08-071-1/+1
| | | | | | | | | | | | | | | 1 is not enough to prevent PL_QUEUE_MORE, because the pl_queue is designed to always know the next frame (in addition to the current). Before haasn/libplacebo@112bb886, this was was (wrongly) silently omitted by the pl_queue code, but that fix exposed this. While it's technically API misuse on mpv side, due to the mpv vo code having its own internal queueing and timing control, it shouldn't actually make any difference in practice (and likely, the error message showing up is the only meaningful bug here - the issue is entirely cosmetic). Fixes: https://github.com/mpv-player/mpv/issues/12101
* vo_gpu_next: update for new pl_filter configuration APINiklas Haas2023-08-061-9/+33
| | | | | | | | | | Configuration of filter parameters was moved from pl_filter_function (of which the user had to make a copy) to pl_filter_config, with the pl_filter_function remaining immutable. Implement this new logic in a way that can reasonably exist side-by-side with the old configuration API. Once we drop support for PL_API_VER below 303, we can drastically simplify this code.
* vo_gpu/vo_gpu_next: fix setting an empty dscaleDudemanguy2023-08-051-1/+1
| | | | | | | | | The manual currently says that if dscale is unset, --scale will be applied. However, this only works at init time. If you change the dscale filter to be empty later, vo_gpu will segfault and vo_gpu_next will throw an error and refuse the changes. That's because when the option is unset at runtime, the value becomes "" not NULL and the vo's never accounted for this. Fixes #12031.
* vo_gpu_next: add --hdr-peak-percentileNiklas Haas2023-08-041-0/+1
|
* vo_gpu_next: fix assertion on waylandNiklas Haas2023-07-291-2/+7
| | | | | | | This code failed to handle the case of the swapchain submission being skipped because the window was invisible. Fixes: f9dc695b580c394bf4f9833d36e91b7fcbe009ea
* vo_gpu_next: delay swapchain submit until flip_frame()Niklas Haas2023-07-291-2/+5
| | | | Presents frames at the correct time when DS is disabled.
* Revert "vo_gpu_next: use pl_dispatch_info_move to avoid useless data copy"sfan52023-07-231-46/+21
| | | | | | | | We wanted to preserve the libplacebo v5.264.0 requirement for gpu_next for this release, since this is the what most Linux distributions are shipping. The VLC 3 <-> libplacebo v6 situation is an additional reason distros are not likely to ship the newest libplacebo release soon. This reverts commit b73d96776cfee61f88bf60b27315baab32a2115d.
* vo_gpu_next: add --hdr-contrast-recovery/smoothnessNiklas Haas2023-07-181-0/+5
| | | | New upstream feature. Disabled by default.
* vo_gpu_next: add --target-contrast optionKacper Michajłow2023-07-171-0/+30
| | | | For better control over target display levels.
* various: correctly ignore cache files with --no-configDudemanguy2023-07-061-4/+11
| | | | | | | | | | | | --no-config should prevent loading user files of any type: configs, cache, etc. For cache files, this case wasn't properly handled and it was assumed they would always get something. vo_gpu's shader cache actually already handles this, so it was left untouched. In theory, demuxer cache should never have this issue because saving it to disk is disabled by default (and likely that will never change), but go ahead and change it for consistency's sake. Fixes some segfaults with --no-config and various combinations of settings (particularly --vo=gpu-next).
* vo_gpu_next: remove synchronization from info_callbackKacper Michajłow2023-07-021-9/+0
| | | | VOCTRL is processed on VO thread.
* vo_gpu_next: use pl_dispatch_info_move to avoid useless data copyKacper Michajłow2023-07-021-21/+45
| | | | | Instead copy the data on-demand when VOCTRL_PERFORMANCE_DATA is requested.
* vo_gpu_next: add --corner-rounding optionNiklas Haas2023-06-211-0/+6
| | | | For better or worse.
* vo_gpu_next: add missing --gamut-mapping-mode optionsNiklas Haas2023-06-211-1/+12
| | | | | Adds the missing upstream values that were exposed by the new gamut mapping API.
* vo: hwdec: Pass the ra_ctx to hwdecs instead of just the raPhilip Langdale2023-05-281-1/+1
| | | | | | We will need the full ra_ctx to be able to look up all the state required to initialise an ffmpeg vulkan hwcontext, so pass let's pass the ra_ctx instead of just the ra.
* vo_gpu_next: fix to allow using dllimportKacper Michajłow2023-05-271-1/+1
| | | | | Address of variables can't be used for constant initialization in C language modes.
* vo: make mp_frame_perf thread safeKacper Michajłow2023-05-251-2/+2
| | | | | | | It was unsafe to return pointer to memory that was freed on another thread, just copy the string to caller owned sturcture. Fixes crashes when displaying passes stats with gpu-next.
* vo_gpu_next: add size guard for pass->num_samplesKacper Michajłow2023-05-251-2/+3
| | | | | This shouldn't happen as the array sizes are the same, but guard against it in case libplacebo do something naughty.
* vo_gpu_next: synchronize voctrl_performance_data accessKacper Michajłow2023-05-251-0/+11
| | | | | info_callback is fired quite often and from different thread than any accesses to this structure.
* vo_gpu_next: fix off by one in info_callbackKacper Michajłow2023-05-251-1/+1
| | | | Fixes invalid memory writes.
* vo_gpu_next: fix build on older libplaceboNiklas Haas2023-05-241-1/+0
| | | | | | Introduced by, of all things, a rebase... Fixes: a5da8b2c87dc3ace0038ccb5dc8f221df7f52206
* vo_gpu_next: update to new libplacebo gamut mapping APINiklas Haas2023-05-241-3/+29
| | | | | | | | This just replaces the API calls to get rid of deprecation warnings, it doesn't yet expand the enum, nor replace them by the proper options. The translation from tone map modes to hybrid mix parameters is taken from the libplacebo source code.
* vo_gpu_next: remove --tone-mapping-crosstalkNiklas Haas2023-05-241-1/+0
| | | | Removed upstream, to be replaced by constant 0.04.
* vo_gpu_next: allow to use ICC profile luminance valueKacper Michajłow2023-05-131-4/+14
| | | | | | Also while at it respect target-peak option when ICC profile is used. Fixes #11449
* player: use XDG_CACHE_HOME by defaultDudemanguy2023-05-091-4/+14
| | | | | | | | | | | | This adds cache as a possible path for mpv to internally pick (~/.cache/mpv for non-darwin unix-like systems, the usual config directory for everyone else). For gpu shader cache and icc cache, controlling whether or not to write such files is done with the new --gpu-shader-cache and --icc-cache options respectively. Additionally, --cache-on-disk no longer requires explicitly setting the --cache-dir option. The old options, --cache-dir, --gpu-shader-cache-dir, and --icc-cache-dir simply set an override for the directory to save cache files. If unset, then the cache is saved in XDG_CACHE_HOME.
* vo_gpu_next: fixes to allow using dllimportKacper Michajłow2023-04-241-3/+3
| | |