summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mac: use visible frame rectangle for window geometry calculationder richter2020-12-195-13/+42
| | | | | | | | | | | | | currently we use the whole screen rectangle to calculate the window geometry. this doesn't take the menu bar or the Dock into account. by default use the visible screen rectangle instead. this is also a change in behaviour, since the window can't be placed outside of this rectangle anymore. also add an option to change to the old behaviour, because it can still be useful in certain cases, like placing the window directly underneath the menu bar when used a desktop background. Fixes #8272
* mac: fix a window positioning bug when exiting fullscreender richter2020-12-192-10/+14
| | | | | | | | | | | | | | | | when exiting fullscreen we set the window frame to a aspect fit frame of the fullscreen frame to prevent aspect ration problems when animating. though that intermediate frame was set too early and before the system knew we already exited the fullscreen. because of that the frame we set could not be properly set and its origin was defaulted to the bottom left corner for exactly one display refresh and only after that the wanted frame was set. this led to a (dark) grey area on the right or top depending on the aspect ratio difference of the screen and video. to prevent this set the intermediate frame in the animation group to make it sync with the system's fullscreen behaviour. Fixes #8371
* appveyor: use MSYS2 shaderc packageJames Ross-Gowan2020-12-191-11/+1
| | | | | There's a shaderc package in MSYS2 now. Using it should shave ten minutes off the appveyor build.
* vo_wlshm: support presentation timeDudemanguy2020-12-141-0/+14
| | | | | We get presentation feedback for free thanks to the last commit. Implementing it in wlshm is pretty straightfoward from there.
* wayland: unify frame/presentation callback codeDudemanguy2020-12-144-176/+76
| | | | | | | | | | | | | | | | Originally when presentation time was implemented, the frame callback and presentation feedback functions were called in each rendering api's separate backend (egl and vulkan). This meant that their respective structs were basically copy and pasted across both files. Plus later vo_wlshm started using frame callbacks too. Things got refactored a few times and it turns out there's actually no need to have these things separate anymore. The frame callback can just be initialized in vo_wayland_init and then everything else will follow from there. Just move all of this code to wayland_common and get rid of the duplication. Sidenote: This means that vo_wlshm can actually receive presentation feedback now. It's really simple to do so might as well. See the next commit.
* x11: update geometry/autofit opts on runtimeDudemanguy2020-12-142-0/+25
| | | | | | If the window is maximized, we can't change the size immediately. In that case, we set a bool and wait for the state to change before triggering the resize.
* wayland: update geometry/autofit opts on runtimeDudemanguy2020-12-141-4/+21
| | | | | | Additionally, do some cleanups in the resize/autofitting code to make sure we don't do any wasteful VO_EVENT_RESIZE calls. Note that if set_geometry is called, we must always perform a resize.
* console: use wl-paste on WaylandGuido Cella2020-12-142-3/+13
|
* wayland: remove unused function declarationDudemanguy2020-12-131-1/+0
| | | | | It looks this line was added over 3 years ago, but said function never actually existed or was used. Funny stuff.
* auto_profiles: fix compile_cond on lua 5.1Philip Sequeira2020-12-081-6/+10
| | | | | | 5.1's load() doesn't accept strings; loadstring must be used instead. In 5.2, loadstring is deprecated and setfenv is gone.
* build: recognize Lua 5.1 on Arch LinuxPhilip Sequeira2020-12-081-0/+1
|
* manpage: document background transparencyGuido Cella2020-12-081-7/+7
| | | | | | | | | | | | | | | --alpha=yes doesn't affect only transparent videos and images, but also the background. I spent time researching how to implement transparent backgrounds and had no idea that they already worked at least on Wayland. Background transparency will work on X11 when https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2376 is merged. It doesn't work on Windows. No idea about macOS. Either way, this paragraph already says that it only works on certain environments twice. References #6590
* manpage: clarify that you can prefetch m3u8 urlsGuido Cella2020-12-081-5/+7
| | | | | | | | | | | With the current wording, I thought that playlist-prefetch doesn't prefetch the next url within a playlist of m3u8 urls, but it makes a big difference, and I would have enabled it earlier if it wasn't for this paragraph. This makes it clear that you can prefetch any file, but that it won't prefill the cache with the video data. This is true for any video, there's nothing unique about HLS streams in the behavior of this option.
* wayland: handle multiple outputs more correctlyDudemanguy2020-12-081-65/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a bit of a catch-22 in the wayland backend. mpv needs to know several things about the wl_output the surface is on (geometry, scale, etc.) for lots of its options. You still have to render something somewhere before you can know what wl_output the surface is actually on. So this means that when initializing the player, it is entirely possible to calculate initial parameters using the wrong wl_output. The surface listener is what will eventually correct this and pick the correct output. However not everything was technically working correctly in a multi-output setup. The first rule here is to rework find_output so that it returns a vo_wayland_output instead of internally setting wl->current_output. The reason is simply because the output found here is not guaranteed to be the output the surface is actually on. Note that for initialization of the player, we must set the output returned from this function as the wl->current_output even if it is not technically correct. The surface listener will fix it later. vo_wayland_reconfig has to confusingly serve two roles. It must ensure some wayland-related things are configured as well as setup things for mpv's vo. The various functions are shuffled around and some things are removed here which has subtle implications. For instance, there's no reason to always set the buffer scale. It only needs to be done once (when the wl->current_output is being created). A roundtrip needs to be done once after a wl_surface_commit to ensure there are no configuration errors. surface_handle_enter is now handles two different things: scaling as well as mpv's autofit/geometry options. When a surface enters a new output, the new scaling value is applied to all of the geometry-related structs (previously, this wasn't done). This ensures, in a multi-monitor case with mixed scale values, the surface is rescaled correctly to the actual output it is on if the initial selection of wl->current_output is incorrect. Additionally, autofit/geometry values are recalculated if they exist. This means that dragging a surface across different outputs will autofit correctly to the new output and not always be "stuck" on the old one. A very astute observer may notice that set_buffer_scale isn't set when the surface enters a new output. The API doesn't really indicate this, but a WAYLAND_DEBUG log reveals that the compositor (well at least sway/wlroots anyway) magically sets this for you. That's quite fortunate because setting in the surface handler caused all sorts of problems.
* vo_gpu: revert 8a09299 and conditionally clear framebuffer againder richter2020-12-061-3/+5
| | | | | | | | | | | | | | | | | | | | in the original commit, that removed the conditional clearing, an incorrect assumption was made that clearing "should be practically free" and can be done always. though, at least on macOS + intel this can have a performance impact of up to 50% increased usage. it might have an impact on other platforms and setups as well, but this is unconfirmed. the reason for removing the conditional clearing was to partially work around a driver bug on very specific setups, X11 with amdgpu and OpenGL, to clear garbled frames on start. though it still has issues with garbled frames in other situation like fullscreening. there is also an open bug report on the mesa bug tracker about this. setting the radeonsi_zerovram flag works around all of those issues. since the flag works around all these issues and the original fix doesn't work completely we revert it and keep our optimisation. Fixes #8273
* mac: support screen-name and fs-screen-name optsder richter2020-12-062-7/+23
| | | | | | | the screen-name and fs-screen-name option allow for specifying screens based on their name. this is the name of the NSScreen and also reported by the VOCTRL_GET_DISPLAY_NAMES event. the old screen and fs-screen options by id, respectively, are preferred over these new ones.
* wayland: support fs-screen-name optionDudemanguy2020-12-061-17/+25
| | | | | | | | | In wayland, setting the surface on a specific monitor only works in fullscreen so only --fs-screen-name can be implemented. Like with x11, we prefer --fs-screen over --fs-screen-name if it is set. This may be more useful than setting by ids because there's no guaranteed order in which screens are added in wayland. In wayland, the name used here is the model name detected by the output_listener.
* x11: support screen-name and fs-screen-name optsDudemanguy2020-12-061-1/+19
| | | | | | | | | The --screen-name and --fs-screen-name options allow for specifying screens based on their name. For x11, this is the display name reported by xrandr. --screen-name and --fs-screen-name mimic the --screen and --fs-screen options respectively. If --screen is set, then --screen-name will always do nothing. Likewise, --fs-screen-name does nothing if --fs-screen is set.
* player: add --screen-name and --fs-screen-nameDudemanguy2020-12-064-0/+19
| | | | | | Simple groundwork for adding a couple of user options that allow selecting the screen with a string name. The next two commits implements these options for xorg and wayland.
* manpage: clarify profile-cond requires underscoresGuido Cella2020-12-061-3/+5
| | | | | | | While this says that _ is replaced with -, it doesn't say that you HAVE to use _. This isn't obvious and I didn't understand why my profile conditions with - weren't working at first. Seeing as the person who reproted #8324 ran into this as well, this may be worth clarifying.
* build: restore support for non-pkgconfig zlibMia Herkt2020-12-061-1/+3
| | | | Some platforms do not offer a .pc file for zlib, e.g. Android.
* build: use pkg-config for zlibMia Herkt2020-12-061-3/+1
| | | | | | Zlib has had a .pc file since 2010, and the default search paths we use here can break the build on some distros (notably openSUSE Tumbleweed, which our Travis builds use). Just check pkg-config instead.
* vo_gpu: placebo: update for upstream API changesNiklas Haas2020-12-041-2/+29
| | | | | | | The concept of sample/address modes was moved from `pl_tex` to `pl_desc_binding`. The `pl_tex_blit()` function also underwent an API change.
* vo_sixel: don't divide by zero on small terminalAvi Halachmi (:avih)2020-12-021-10/+16
| | | | | | | | | | Our canvas size calculation is affected by few factors, and rounded down more than once - which can result in 0 width or (more typically) height - e.g. when terminal height is one row. If the width or height are 0 then all bets are off, so simply skip the setups and rendering on this case. We can still recover automatically if the terminal is resized to become bigger.
* vo_sixel: re-fit image on terminal resizeShreesh Adiga2020-12-021-1/+20
| | | | | | | | The obvious approach would be SIGWINCH, however, integrating it would be tricky, so instead we simply poll the size on draw_frame. This means the image won't resize automatically when still - e.g. cover art or when paused, though it would re-fit on OSD changes.
* vo_sixel: refactor of resize, reconfig (no-op)Shreesh Adiga2020-12-021-27/+34
| | | | More granular functionality - will be used by the the next commit.
* vo_sixel: Update description string of vo driverShreesh Adiga2020-12-021-1/+1
|
* csputils: add MP_CHROMA_TOPLEFTNiklas Haas2020-12-023-1/+8
| | | | | | | | | This is commonly used by UHD/HDR sources, and mpv hilariously ignores it up until now, just blindly mapping it to MP_CHROMA_AUTO without even so much as a warning message. It would be justified to add all the other chroma locations as well, but I'm lazy and just wanted to quickly fix this bug.
* travis: use newer 10.15 VM with newer xcodeder richter2020-11-291-1/+1
|
* travis: fix macOS 10.13 buildder richter2020-11-291-3/+8
| | | | | | homebrew is removing 10.13 support and some of the dependencies start building rom source now. we will just pin the last working homebrew version, similar to the 10.12 build
* vo_sixel: don't leak the frame referenceAvi Halachmi (:avih)2020-11-291-4/+9
| | | | | | The reference is allocated at reconfig and happens at least once (and leaked at least once), but can also be called more, e.g. on zoom or pan-and-scan changes.
* vo_tct: don't leak the frame referenceAvi Halachmi (:avih)2020-11-291-0/+5
| | | | | | The reference is allocated at reconfig (and leaked at least once), but could theoretically be called more than once by mpv, or in the future when the tct code is enhanced to hande e.g. pan-and-scan changes.
* vo_tct: remove unused variableAvi Halachmi (:avih)2020-11-291-7/+0
|
* player: allow vo to be switched at runtimesfan52020-11-273-7/+23
|
* demux: add function to refresh a track without (de-)selecting itsfan52020-11-272-0/+22
|
* vo_sixel: use draw_frame instead of draw_imageShreesh Adiga2020-11-271-13/+36
| | | | | | draw_image is deprecated, and draw_frame allows better behavior, like rendering the osd without image. e.g. `mpv --vo=sixel --idle --force-window`.
* vo_sixel: skip testdither init in fixed paletteShreesh Adiga2020-11-271-11/+18
| | | | | | | testdither was being created irrespective of whether opt_fixedpal is set or not. In case of opt_fixedpal=1, testdither is not used in the `prepare_static_palette` code. Hence only initialize it when opt_fixedpal is 0.
* vo_sixel: Update libsixel constant valuesShreesh Adiga2020-11-271-3/+3
| | | | | | | | In sixel_dither_initialize, replace 3 with the libsixel SIXEL_PIXELFORMAT_RGB888. Also in sixel_encode, the 4th parameter is supposed to be depth, which also happens to be the value of PIXELFORMAT_RGB888, so replacing that constant with the depth value.
* matroska.py: remove python2 supportLaserEyess2020-11-271-6/+2
| | | | | | | | | | Since 0.33.0 mpv does not support python2. This commit removes python2 support from the file completely with the following changes: - __future__ import of print_function is python2 only - unicode literals are legacy in python3 - 'sys.version_info.major < 3' check is redundant
* bootstrap.py: remove all python2 supportLaserEyess2020-11-271-6/+1
| | | | | | | | | In 0.33.0 python2 support has been removed from mpv's build system. This commit removes python2 compatibility code from bootstrap.py with the following changes: - __future__ import for print_function is not needed - urllib2 is python2 only
* vo_sixel: change default dither to "auto"Avi Halachmi (:avih)2020-11-272-4/+4
| | | | | | | | | | | | | | For two reasons: 1. It was counter intuitive that there's an "auto" value (which is actually a libsixel value and not an mpv one), but it's not the default value - our default was Atkinson. 2. "auto" provides better dithering than Atkinson with libsixel, which is especially noticeable with smooth gradients - where Atkinson has visible banding. In libsixel 1.8.2 the "auto" value maps to Atkinson if the output palette has up to 16 colors, or to Floyd-Steinberg otherwise (e.g. using fixed palette with 256 colors chooses Floyd-Steinberg).
* vo_sixel: fix the image corruption with mltermAvi Halachmi (:avih)2020-11-272-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | The issue was that we only uploaded the palette to the terminal when it changed (once on init with fixed palette, every frame with dynamic palette with trheshold=-1, only on scene change with threshold >= 0). Now we upload it on every frame, and it seems to fix the mlterm image corruption both with fixed palette and also with dynamic palette with threshold (i.e. at frames which did not upload a palette). It's not entirely clear why it's required with mlterm. It would seem that the palette which libsixel uses with fixed palette matches the built in default palette in xterm, but not in mlterm. With dynamic palette we can guess that mlterm resets the palette after a sixel image, but that's not confirmed. Uploading the palette on every frame doesn't seem to slow down xterm when using fixed palette - not clear yet why uploading a different palette (when using fixedpalette=no) slows it down while same palette on every frame doesn't. In mlterm there's no slowdown either way - and now also no corruption.
* vo_sixel: support --vo-sixel-exit-clear[=yes]Avi Halachmi (:avih)2020-11-272-2/+11
| | | | | | | | By default we still clear the screen, but now it's possible to leave the last sixel image on screen. Allows mpv to be used as img2sixel of sorts, but with our auto-fit and various mpv scaling/filters etc.
* terminal: process input when foregroundedGuido Cella2020-11-261-1/+9
| | | | | | | | | | When mpv is in the background because it was started with `mpv foo.mp3 &`, or the user did ctrl+z bg, and is then brought to the foreground with fg, it buffers input until you press enter. This makes it accept input almost immediately. Having a short interval isn't important, since input is buffered until the next loop iteration. Closes #8120.
* Update VERSIONsfan52020-11-221-1/+1
|
* Release 0.33.0v0.33.0sfan52020-11-222-24/+113
|
* file2string: remove question mark from safe charssfan52020-11-222-9/+4
| | | | | | | | | | Trigraphs such as "??=" (which are enabled by default with -std=c11) can mess up strings, so avoid them entirely by escaping question marks. This also drops Python 2 compatibility from file2string, making the change to the waf rule necessary. The input file is now opened in binary mode which is also more correct versus the old text mode which just happened to work even on binary files.
* Revert "options: disable vsfilter blur compat by default"rcombs2020-11-222-2/+2
| | | | | | | | | | | | | | | This reverts commit 3d17e19c2c5ca80f916411e7e61126cac8443baa. The effect of turning off this setting is that mpv doesn't tell libass what the video stream's resolution is. This happens to result in some files having their transforms scaled in ways that give higher performance (as described in #7435) because libass happened to guess a video resolution that resulted in transforms yielding smaller bitmaps, but it's just as easy for the opposite to happen depending on the resolutions and effects involved. The option's name is also somewhat misleading: setting the storage size affects blur, but it also affects stroke (which is far more important for the vast majority of scripts) and 3D transforms (which look very screwy when done wrong).
* build: always run waf with python3Uoti Urpala2020-11-221-0/+6
| | | | | | | | | | | | Upstream waf still ships with the default interpreter being "python", though the script works with both Python 2 and Python 3 (they're not changing the default choice during 2.0.x releases for compatibility reasons apparently). Add code to bootstrap.py to change the interpreter from "python" to "python3" when downloading the "waf" file. Running any mpv code under Python 2 should be considered unsupported in the future (and any code added need not work under Python 2).
* build: fix macOS arm buildsder richter2020-11-224-4/+11
| | | | | | | | | | | remove the hardcoded swift target version and move the version restriction to configure. this was a bad idea anyway and could lead to mismatched object files between obj-c and swift. fix travis 10.12 legacy build. also update the SDK version parser to handle the new macOS 11 scheme. Fixes #8281
* vo_sixel: draw osd on the output frameShreesh Adiga2020-11-221-0/+5
|
* vo_sixel: return -1 instead of SIXELSTATUS on failureShreesh Adiga2020-11-221-10/+36
| | | | | | | | Currently in mpv functions sixel failures return the value status which is of type SIXELSTATUS. So changing it to -1 which is explicit and compatible with mpv. Also log the errors using MP_ERR/MP_LOG with the error string returned by libsixel to have more info.
* vo_sixel: set --vo-sixel-fixedpalette=yes by defaultShreesh Adiga2020-11-221-1/+1
| | | | | | | fixedpalette seems to be slightly faster than dynamic palette, and also in mlterm it avoids corruption of too bright values overflowing to black. Hence setting it to be default choice instead of dynamic palette.
* vo_sixel: Add aspect ratio based output centeringShreesh Adiga2020-11-222-193/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | Resize the image based on the dimensions reported by vo_get_src_dst_rects to correctly handle aspect ratio that might be set/ignored. Added pad-x and pad-y options for padding. These options will be used to remove the extra padding. Some terminals report the padding of 2px in the ioctl dimensions which can't be used for displaying sixel output. These options can be used for fine tuning the output video resolution. Now all the terminal size detection and calculation logic is done in a single function at resize. Also top and left values are computed from the dst_rect parameters to simplify the logic for the aspect ratio based centering. Additionally vo-sixel-rows and vo-sixel-cols options have been added to enable the user to override the values in case of failures with get_terminal_size2. This commit also adds ability to handle video zoom correctly. Whenever video-zoom is triggered, the src and dst rects will be updated. Scaling seems to work well now.
* vo_sixel: rename all user options with opt_ prefixShreesh Adiga2020-11-221-36/+50
| | | | | | | This has no changes to mpv sixel playback behaviour. This is required because currently the offset values and the resolutions are being overwritten and not remembered.
* vo_sixel: set output resolution based on terminal_get_size2Shreesh Adiga2020-11-221-2/+37
|
* osdep/terminal: Add function to get terminal pixel dimensionsShreesh Adiga2020-11-224-0/+24
|
* doc: split BNF definitions of <command> and <argument> in separate linesEmanuele Torre2020-11-221-2/+3
| | | | |