summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wayland: use wl_output v4 for display-namesDudemanguy2022-05-131-2/+4
| | | | | | | | 5774ce759a6c7fe0727cfbd4458957abfd96a7b7 added the new output name event and used them for the --fs-screen-name option. It turns out that the display-names property could also make use of these names, so go ahead and use output->name in this case if we have them. If not, fallback to output->model like before.
* lua: avoid rare memory leak in mp.join_pathGuido Cella2022-05-121-4/+3
| | | | | If lua_pushstring is OOM, then our joined path allocation is leaked. Use autofree to ensure it's not leaked in case of Lua OOM.
* client API: always export symbols on windowsDudemanguy2022-05-111-3/+3
| | | | | | | | Windows is weird and symbols weren't actually being exported. This is because __GNUC__ is defined and picked up in the conditional, but __attribute__((visibility("default"))) doesn't actually export anything to the dll. Instead, just check if we have win32 defined first and then always set __declspec(dllexport). Fixes #10171.
* stream_lavf: add support for ipfs and ipnsMark Gaiser2022-05-051-1/+1
| | | | | | | ffmpeg 5.1 adds support for IPFS (the ipns:// and ipfs:// protocols). This patch enables those protocols to be fist-class citizens in mpv. Thus allowing for playing IPFS resources on mpv like: "mpv ipfs://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T"
* meson: compile mpv.exe as a win32 gui applicationDudemanguy2022-05-052-8/+2
| | | | | | | | | | | | | | | | | Some compiler flags were passed to mpv in order to get it to build as a gui application on windows. However on the meson build, this always resulted in mpv being built as a console application. This is because the function for making executables in meson specifically has a kwarg called win_subsystem* which defaults to 'console'. That always added link arguments at the end which compiled mpv.exe as a console application. The correct thing to do is to remove all of the subsystem-related flags in the meson build and use the win_subsystem kwarg as intended by setting it to 'windows,6.0'. For mpv.com, we can remove the -Wl,--subsystem,console flag since meson will set this by default in that executable. This makes mpv.exe function correctly and open with the pseudo-gui while mpv.com acts as a console wrapper. https://github.com/mesonbuild/meson/commit/1a0603835e3c9f1047d9b7694efc996219a422e4
* context_drm_egl: support monitor parDudemanguy2022-05-051-0/+9
| | | | | | These values and options were simply never looked at in the drm egl context. This pretty much is just a copy and paste of what is in vo_drm. Fixes #10157.
* github/workflows: add macOS 12 buildJan Ekström2022-05-051-0/+1
| | | | | | Apparently it is now in public beta. ref actions/virtual-environments#5446
* video/image_writer: tag colorspace in AVCodecContextLeo Izen2022-05-041-2/+4
| | | | | If screenshot-tag-colorspace=yes, then set the corresponding fields in AVCodecContext, not just in AVFrame.
* DOCS/input: fix typo "NANME" -> "NAME"Emanuele Torre2022-05-021-1/+1
|
* console.lua: don't render a 2nd cursor on the OSCGuido Cella2022-05-011-1/+1
| | | | | | | | | | 09ea3a424fe moved the console above the OSC when it is visible so they don't overlap, but only changed the first ass:pos() call and forgot to update the second one, which redraws the cursor on top of the text, so when both the OSC and the console are visible, a second cursor is drawn on the OSC. You have to type past where the buttons are to notice it. This commit synchronizes the position of the 2 ASS events.
* video/image_writer: fix high-depth JPEG XL screenshotsLeo Izen2022-04-291-1/+5
| | | | | | | Allow screenshot-high-bit-depth=yes to work with JPEG XL screenshots when screenshot-sw=no is set. They already work as expected when screenshot-sw=yes is set, but this allows the hardware screenshots to work this way too.
* build: add avcodec jpegxl dependency versionsLeo Izen2022-04-283-5/+8
| | | | | Add the libavcodec version check for AV_CODEC_ID_JPEGXL to the build system rather than to any file that references it.
* demux: add support for r128 replaygain tagsdatasone2022-04-281-0/+13
|
* DOCS/ao: remove only usage of git.io link shortening serviceJakub Wilk2022-04-281-1/+2
| | | | | | | | | This link was originally shortened in bf0cb27489b0e0e00190c4ea2e08290fb3817626 to improve manpage formatting, but unfortunately Github is now taking down this service on the 29th. Thus, the full link is being reinstated. ref: https://github.blog/changelog/2022-04-25-git-io-deprecation/
* wayland: use wl_surface_damage_bufferDudemanguy2022-04-272-5/+5
| | | | | | | | | | | | | | | | Since 2018, wl_surface_damage_buffer has been explicitly preferred and recommended over wl_surface_damage*. mpv was still using the old function in a couple of spots. The only difference is that we need to pass buffer coordinates instead of surface coordinates. In vo_wlshm, this is done by using vo->dwidth/vo->dheight since that is always used whenever wl_buffers are created. In the case of the cursor surfaace, we actually already passed buffer coordinates to it (img->width/height) which was probablly technically wrong with wl_surface_damage, but it doesn't really matter in practice. This requires bumping wl_compositor to version 4 which is no problem since this dates back to 2015*. https://gitlab.freedesktop.org/wayland/wayland/-/commit/921d0548035673a1bf6aeb9396b9bc728133411e https://gitlab.freedesktop.org/wayland/wayland/-/commit/3384f69ecf043d62a4e036c0353c2daa01d7c4d0
* DOCS/options: properly capitalize JPEG XLLeo Izen2022-04-261-3/+3
| | | | | The appropriate style for jxl images is JPEG XL, not Jpeg XL. Update the docs to reflect this.
* video/image_writer: add Jpeg XL screenshotsLeo Izen2022-04-263-0/+31
| | | | | | | Add Jpeg XL as a possible output format for screenshots, which should make it possible to take fast screenshots with much better quality than JPEG, or take lossless high-bit-depth screenshots with lower file sizes than PNG.
* various: fix typosCœur2022-04-2534-51/+51
|
* vo_gpu_next: avoid 0x0 resizesDudemanguy2022-04-241-2/+4
| | | | | | | | | | | It is possible for vo_gpu_next to attempt a resize before the windowing backend is fully initialized. In practice, this can happen on wayland which means libplacebo attempts a 0x0 resize. Depending on the API, a 0x0 resize may be allowed (vulkan or d3d11), but libplacebo just returns a 0 in this case which mpv doesn't do anything with anyway. In the case of opengl, this usage is explictly forbidden and will result in a warning which may confuse users. Solve this by just not trying a resize if dwidth and dheight in the vo are not available. Fixes #10083.
* github/workflows: workaround git permissions errorDudemanguy2022-04-211-0/+2
| | | | | | | | | | Recently, git patched a CVE which makes it much more strict about different users operating on directories they don't own. For us, this causes breakage with version.sh and version.py since they both run a git describe command to fetch the commit hash. Currently, this only affects the tumbleweed container (likely because it was recently changed) and thus the git describe command always errors out. Workaround this by just explictly adding the mpv directory as a safe directory for git.
* DOCS/options: update the --load-osd-console documentationGuido Cella2022-04-211-4/+3
| | | | | | | | | | - Say built-in which is more common than builtin - Move "By default" because only the key to open the console is customizable, and fix the punctuation and case of the sentence - ` opens the console, not ´ - Remove the sentences that explains which user script console.lua is based on since it's no longer relevant now that the console has been part of mpv for over 2 years.
* DOCS/input: update the ASS tags documentation URLGuido Cella2022-04-211-1/+2
| | | | The current one hasn't worked in years.
* options: make --cover-art-auto=exact the defaultGuido Cella2022-04-212-3/+3
| | | | | | | | | Now that a separate --cover-art-whitelist option exists, files like cover.jpg are loaded even without setting --cover-art-auto to fuzzy, so only load files that have exactly the media filename by default, since fuzzy loading is probably more likely to load unwanted images than to load cover art that the user intended to display, especially if you play audio files with a short filename like a.mp3.
* player: add cover-art-whitelist optionGuido Cella2022-04-214-3/+12
| | | | | | | | This allows more fine grained control over which cover art to load. With --cover-art-auto=exact and --cover-art-whitelist=yes, you can now load cover art with the exact media filename and the whitelisted filenames, but not cover art that contains the media filename (--cover-art-auto=fuzzy).
* DOCS: fix the typo of --sub-justifyhooke0072022-04-211-1/+1
|
* DOCS: correct --sub-shadow-colorhooke0072022-04-211-6/+6
|
* DOCS/{mpv,options}: document the watch later functionalityGuido Cella2022-04-213-67/+99
| | | | | | | | | | This adds a section to the documentation to explain how resuming playback works, and in particular it explains how it affects which playlist entry mpv starts playing from, since this feature was only implied in the --playlist-start documentation. It also groups the documentation of the watch later options together to make them easier to find.
* vo_wlshm: use draw_frame instead of draw_imageDudemanguy2022-04-211-3/+3
| | | | | | | | draw_image is an old API that was deprecated long ago. However when wlshm was originally added, it used draw_image. There's no particular reason for this and it can trivially be switched to draw_frame instead. This has some real advantages (notably --vo=wlshm --idle --force-window actually works).
* mpv.desktop: add japanese translationDudemanguy2022-04-211-0/+3
|
* ci: switch Tumbleweed build to openSUSE container registryMia Herkt2022-04-191-1/+1
|
* vd_lavc: fixup unchecked usage of AV_CODEC_EXPORT_DATA_FILM_GRAINJan Ekström2022-04-131-0/+7
| | | | | | | | | | | | | | This fixes build failures with avcodec 58.113.100 or before, matching FFmpeg release versions 4.0 to 4.3. This flag was added in between avcodec 58.113.100 and 58.114.100 during the FFmpeg 4.4 development cycle. It lacks its own version bump, so instead a check for the define is utilized instead. Additionally, warn the user if they request GPU film grain with too old of an FFmpeg. Fixes #10088
* vd_lavc: fix decoder initialization when no VO is availableJan Ekström2022-04-111-6/+20
| | | | | | | | | | | | | | | | | The VO is available during decoder initialization mostly for direct rendering purposes, so if f.ex. a complex filter chain is utilized, there is no video renderer information available via mp_filter_find_stream_info during creation of the decoder filter. Thus, check for whether the VO is available before attempting to check the capabilities flag from it. Additionally - to simplify logic - makes explicitly requesting GPU film grain to always disable decoder film grain functionality. The warning is still shown if the VO is available and no support for film grain application is available. Fixes #10079
* vd_lavc: remove duplicate vd_ffmpeg_ctx pointer from init_avctxJan Ekström2022-04-111-2/+1
| | | | | Seems like in some functions this was called p and in others ctx, and thus it was added as the `p` pointer was not available.
* wayland: use wl_output v4 for --fs-screen-nameDudemanguy2022-04-111-3/+30
| | | | | | | | | | In wayland 1.20.0, a couple of new events, name and description, were added to the interface. Description is not particularly useful, but name returns back nice names for the output like "DP-1" and so on. It makes sense to use these for fs-screen-name and prefer them over the model name (old way of doing it) if they are available. The only problem is that 1.20.0 is pretty new so old distros aren't going to have it anytime soon. Deal with this by adding some defines.
* x11: avoid wasteful rendering when possibleDudemanguy2022-04-117-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because wayland is a special snowflake, mpv wound up incorporating a lot of logic into its render loop where visibilty checks are performed before rendering anything (in the name of efficiency of course). Only wayland actually uses this, but there's no reason why other backends (x11 in this commit) can't be smarter. It's far easier on xorg since we can just query _NET_WM_STATE_HIDDEN directly and not have to do silly callback dances. The function, vo_x11_check_net_wm_state_change, already tracks net wm changes, including _NET_WM_STATE_HIDDEN. There is an already existing window_hidden variable but that is actually just for checking if the window was mapped and has nothing to do with this particular atom. mpv also currently assumes that a _NET_WM_STATE_HIDDEN is exactly the same as being minimized but according to the spec, that's not neccesarily true (in practice, it's likely that these are the same though). Anyways, just keep track of this state in a new variable (hidden) and use that for determing if mpv should render or not. There is one catch though: this cannot work if a display sync mode is used. This is why the previous commit is needed. The display sync modes in mpv require a blocking vsync implementation since its render loop is directly driven by vsync. In xorg, if nothing is actually rendered, then there's nothing for eglSwapBuffers (or FIFO for vulkan) to block on so it returns immediately. This, of course, results in completely broken video. We just need to check to make sure that we aren't in a display sync mode before trying to be smart about rendering. Display sync is power inefficient anyways, so no one is really being hurt here. As an aside, this happens to work in wayland because there's basically a custom (and ugly) vsync blocking function + timeout but that's off topic.
* player: rearrange video sync opts/enums/definesDudemanguy2022-04-116-32/+32
| | | | | | | | | | | | | | | | | The video sync logic for mpv lies completely within its core at essentially the highest layer of abstraction. The problem with this is that it is impossible for VOs to know what video sync mode mpv is currently using since it has no access to the opts. Because different video sync modes completely changes how mpv's render loop operates, it's reasonable that a VO may want to change how it renders based on the current mode (see the next commit for an example). Let's just move the video sync option to mp_vo_opts. MPContext, of course, can still access the value of the option so it only requires minor changes in player/video.c. Additionally, move the VS_IS_DISP define from to player/core.h to common/common.h. All VOs already have access to common/common.h, and there's no need for them to gain access to everything that's in player/core.h.
* wayland: unify visibility checking codeDudemanguy2022-04-117-23/+33
| | | | | | | | | | | A bit of a personal pet peeve. vulkan, opengl, and wlshm all had different methods for doing wayland's "check for visibility before drawing" thing. The specific backend doesn't matter in this case and the logic should all be shared. Additionally, the external swapchain that the opengl code on wayland uses is done away with and it instead copies vulkan by using a param. This keeps things looking more uniform across backends and also makes it easier to extend to other platforms (see the next couple of commits).
* vo_gpu/d3d11: add message ID based log level mappingJan Ekström2022-04-111-6/+64
| | | | | | | | | | | | | This lets us remap various messages which might now be happening at each frame onto the trace level, thus unaffecting the initial debug log level. Additionally - thanks to this ability - the previously globally denied message queue abandonment messages can now be handled and mapped to trace log level, as on that log level they may be of use. Recommended by rossy and based on his libplacebo commit 6d72f6445566eddb0493447d0bda72d98a99d40c .
* vo_gpu/d3d11: mimic libplacebo backbuffer usageJan Ekström2022-04-111-7/+10
| | | | | | Instead of always having the reference outside of calling resize, request a backbuffer at start and relieve the backbuffer at submission for presentation.
* vo_gpu/d3d11: enable receival of color depth without active backbufferJan Ekström2022-04-111-2/+12
| | | | | | | Query the description of the swap chain, which should in all theory contain the format of the backbuffer. Then utilize a newly added ra_d3d11 function to map the format to an ra_format. After that, utilize the depth of the first plane of the format, as previously.
* vo_gpu/d3d11: add helper function to get ra_format from DXGI_FORMATJan Ekström2022-04-112-0/+16
|
* vo_gpu_next: switch to unpooled hwdec mappingNiklas Haas2022-04-115-69/+90
| | | | | | | | | | | | This makes use of the new frame acquire/release callbacks to hold on to hwdec images only as long as necessary. This should greatly improve the smoothness/efficiency of hwdec interop, by not holding on to them for longer than needed. This also avoids the need to pool hwdec mappers altogether. Should fix #10067 as well, since frames are now only mapped when we actually use them.
* x11: fix screen-name optionDudemanguy2022-04-081-0/+1
| | | | | | | | | | | 9a7b2015e1a711a57b6e660774c36956ac59a7f6 added the --screen-name option for x11, but it was unfortunately broken. The commit does correctly handle vo_x11_update_screeninfo and select the correct screen. However, vo_x11_sizehint was missed. Specifically, the force_pos bool was always false because it only took into account --screen being set and not --screen-name. To fix this, just add an extra condition to the force_pos bool so it becomes true if there's a string in --screen_name. Fixes issue #9877.
* mpv.desktop: add turkish translationOğuz Ersen2022-04-081-0/+3
|
* options.lua: remove unused functionGuido Cella2022-04-081-7/+0
| | | | | val2str isn't used anywhere. Its only use was removed in dd3e52fe68, when it was still part of osc.lua.
* options: add osd-playing-msg-durationGuido Cella2022-04-074-1/+10
|
* egl_helpers: request at least 8 alpha bits if necessaryOlivier Perret2022-04-071-1/+1
| | | | | | Previously on wayland, it would result in an egl config with only 2 alpha bits, which technically matches what was requested, but is not very useful. Fixes #9862
* DOCS/input: mark chapter-list as writableGuido Cella2022-04-071-1/+1
|
* drm: context_drm_egl: add support for enabling VRRPhilip Langdale2022-04-056-0/+41
| | | | | | | | | | | | | | Variable Refresh Rate (VRR), aka Freesync or Adaptive Sync can be used with DRM by setting the VRR_ENABLED property on a crtc if the connector reports that it is VRR_CAPABLE. This is a useful feature for us as it is common to play 24/25/50 fps content on displays that are nominally locked to 60Hz. VRR can allow this content to play at native framerates. This is a simple change as we just need to check the capability and set the enabled property if requested by the user. I've defaulted it to disabled for now, but it might make sense to default to auto in the long term.
* vd_lavc: add vo caps and option to set GPU film grain applicationLynne2022-04-054-1/+32
|
* vo_gpu_next: apply film grain if such metadata is presentLynne2022-04-051-0/+5
|
* vf_format: support forwarding/stripping film grain metadataLynne2022-04-053-0/+11
|
* mp_image: support film grain parametersLynne2022-04-052-0/+12
|
* vd_lavc: hide a deprecation warning in already handled compatible codeJan Ekström2022-04-031-1/+3
| | | | | | | | | | | The field has been deprecated, yet the upcoming new default is not yet the default. Thus, until lavc major hits 60 and the default behavior finally gets changed, we have to explicitly set the field's value. The deprecation had already been handled by adding the required version limitation for this code in bbbf3571edfbb0e849d3ef60148743352b84fe84 , this change merely just removes the warning which would otherwise appear until lavc major version gets bumped to 60.
* sub/osd: use atomic for osd_state.force_video_ptsAman Karmani2022-04-022-11/+8
| | | | | | | | | | this field is used only in a special vo draining edge case. switching to an atomic reduces osd->lock contention between the mpv core (in write_video) and vo threads which are managing osd rendering manually (such as vo_rpi). Signed-off-by: Aman Karmani <aman@tmm1.net>
* osdep/atomic: add mp_atomic_doubleAman Karmani2022-04-021-0/+2
| | | | Signed-off-by: Aman Karmani <aman@tmm1.net>
* Revert "vo_gpu_next: remove unnecessary dependency"Niklas Haas2022-04-011-2/+1
| | | | | | This reverts commit 1c2dde91d369987199782f4914f56019e5a2272c. Fixes #10037
* ao_pipewire: Do not hold thread lock during loop stopThomas Weißschuh2022-03-311-3/+1
| | | | | | | Stopping the thread is done using pw_thread_loop_stop(), *which must be called without the lock held.* Fixes #10033
* ao_pipewire: fix resource lifetimesThomas Weißschuh2022-03-301-7/+21
| | | | | | | We have to destroy the core before destroying the loop. Also we have to lock the mainloop for operations on its objects. Fixes #10003
* vo_gpu_next: remove unnecessary dependencyNiklas Haas2022-03-291-1/+2
| | | | | | Pulling in <libplacebo/utils/libav.h> in particular triggers the notorious _av_vkfmt_from_pixfmt linking issue when FFmpeg is built without Vulkan support.
* lua: use correct chunkname when loading script filessfan52022-03-231-3/+6
| | | | This was brought up in #10007 and it turned out mpv did not follow Lua conventions.
* vo_gpu[_next]: hwdec: fix logging regression when probingPhilip Langdale2022-03-2112-32/+59
| | | | | | | | | When I introduced the concept of lazy loading of hwdecs by img format, I did not propagate the probing flag correctly, leading to the new normal loading path not runnng with probing set, meaning that any errors would show up, creating unnecessary noise. This change fixes this regression.
* common/av_l