aboutsummaryrefslogtreecommitdiffhomepage
path: root/video/out/wayland_common.c
Commit message (Collapse)AuthorAge
* wayland: mark existing dnd entry print as debug rather than an errorGravatar Rostislav Pehlivanov2016-05-31
| | | | | | | | It gets printed on every alt+tab or desktop switch under mutter and weston, and offers no useful information since it's handled by destroying the previous entry. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* wayland: correctly report display refresh rateGravatar Rostislav Pehlivanov2016-05-31
| | | | | | | | | | | | This commit will cause the wayland backend and vo to correctly report the display frame rate. This didn't work as VOCTRL_GET_DISPLAY_FPS was received way too early, before the window was created (and thus current_output set). The VO will now signal VO_EVENT_WIN_STATE after window initialization and upon a resize. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* wayland: implement HIDPI supportGravatar Rostislav Pehlivanov2016-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | The wayland protocol exposes scaling done by the compositor to compensate for small window sizes on small high DPI displays. If the program ignores the scaling done, what'll happen is the compositor is going to ask the program to be scaled down by N times the window size and then it'll upscale the program's surface by N times. The scaling algorithm seems to be bilinear so the scaling is quite obvious. This commit sets up callbacks to listen for the scaling factor of each output and, on rescale events, notifies the compositor that the surface's scale is what the compositor asked for and changes the player's surface to the appropriate size, causing no scaling to be done by the compositor. Compositors not supporting this interface will ignore the callbacks and do nothing, keeping program behaviour the same. For compositors supporting and using this interface (mutter), this will fix the rendering to be pixel precise as it should be. Both the opengl wayland backend and the wayland vo have been fixed to support this. Verified to not break either on weston and mutter. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* wayland: use the advertised size in fullscreenGravatar Emmanuel Gil Peyrot2016-05-08
| | | | | | | | | | | | | | | When we receive the wl_shell_surface::configure event, it makes sense to respect the aspect ratio of the video in windowed mode, but in fullscreen it forces compositing and wastes resources (until atomic modesetting is available everywhere and we can stop having desynchronised planes). Weston mitigates a resolution mismatch by creating black surfaces and compositing them around the fullscreen surface, placed at the middle, while GNOME puts it at the top-left and leaves the rest of the desktop composited below, both of them producing a subpar experience. Fixes #3021, #2657.
* Revert "wayland: set fs mode on every configure"Gravatar Emmanuel Gil Peyrot2016-03-19
| | | | | | | | | Prevents an infinite loop of configure event and set_fullscreen request on Weston and other compositors respecting the protocol. Fixes #2817 This reverts commit eb6b2b6e50e6e3d3db41190ad818d8b966750734.
* wayland: set fs mode on every configureGravatar Alexander Preisinger2016-02-07
| | | | | Check and set the fullscreen mode on every surface configure event. This prevents gnome from resizing mpvs fullscreen window to a smaller size.
* Relicense some non-MPlayer source files to LGPL 2.1 or laterGravatar wm42016-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* mpv_talloc.h: rename from talloc.hGravatar Dmitrij D. Czarkoff2016-01-11
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* wayland: fix typo in error messageGravatar Alessandro Ghedini2015-12-27
|
* Revert "vo_wayland: define opaque region"Gravatar Ricardo Vieira2015-10-20
| | | | | | This reverts commit c10fb4ce9fcd3dbbf69741eb8499c4cfabbf5412. This is already done in vo_wayland.c:resize,324 doing it here makes the window bigger before the video resizes showing a black area while dragging the border.
* vo_opengl: wayland: switch to new internal APIGravatar wm42015-10-01
|
* input: add append argument to file drop eventGravatar Kevin Mitchell2015-08-30
| | | | | | This puts in place the machinery to merely append dropped file to the playlist instead of replacing the existing playlist. In this commit, all front-ends set this to false preserving the existing behaviour.
* vo_wayland: Wait for frame callbacksGravatar Jari Vetoniemi2015-08-21
| | | | | | | Privdes small api for vo_wayland where one can request frame callback and then wait for it. This will make vo_wayland play video smoothly.
* vo_wayland: define opaque regionGravatar Jari Vetoniemi2015-03-23
| | | | | This allows compositor to optimize rendering, as it will know mpv is not transparent.
* vo_wayland: share frame callbacks.Gravatar Jari Vetoniemi2015-03-23
| | | | | | | | Define frame callback logic in wayland_common.c As this should be used by opengl renderer as well. Preferably drawing should be skipped entierly when no frame callbacks are received. However, for now only swap buffers is skipped.
* buid: readd -WparenthesesGravatar wm42015-03-02
| | | | | | | | | This warning wasn't overly helpful in the past, and warned against perfectly fine code. But at least with recent gcc versions, this is the warning that complains about assignments in if expressions (why???), so we want to enable it. Also change all the code this warning complains about for no reason.
* input: add MOUSE_ENTER keybinding.Gravatar torque2015-02-18
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: unify handling of fullscreen and other VO flagsGravatar wm42015-01-16
| | | | | | | | The "ontop" and "border" properties already used a common mp_property_vo_flag() function, and the corresponding VOCTRLs used the same conventions. "fullscreen" is pretty similar, but was handled slightly similar. Change how VOCTRL_FULLSCREEN behaves, and use the same helper function for "fullscreen" as the other flags.
* wayland: implement key modifiersGravatar wm42015-01-12
| | | | Includes shift, ctrl, alt, meta.
* wayland: don't compute absurd window sizeGravatar wm42015-01-12
| | | | | | | | | For some reason, schedule_resize() can be called with everything set to 0. The code couldn't handle wl->window.aspect set to 0, converting NaNs to integers. Just work this around. (I have no idea what I'm doing. This is probably a corner case caused by my broken-ish wayland setup.)
* vo_wayland: Add "multimedia" keyboard key bindings.Gravatar Sergey Kvachonok2014-11-29
| | | | | | | | libxkbcommon keysyms are the same as X11 keysyms (sans prefix), so I simply copied the missing subsection from x11_common.c. Signed-off-by: Sergey Kvachonok <ravenexp@gmail.com> Signed-off-by: wm4 <wm4@nowhere>
* wayland: use reported rete and delayGravatar Alexander Preisinger2014-09-19
| | | | | If native-keyrepeat is true then we set the rate and delay reported by the compositor.
* wayland_common: fix changing videos when fullscreenGravatar Alexander Preisinger2014-09-10
| | | | I broke it again.
* video: rename VOCTRL_GET_WINDOW_SIZEGravatar wm42014-09-05
| | | | Make it clear that this accesses the un-fullscreened window size.
* wayland: print some useful outptu infoGravatar Alexander Preisinger2014-09-03
| | | | | Prints output informations, useful for finding out if we detect the right mode and for debugging.
* wayland: only save current mode of outputsGravatar Alexander Preisinger2014-09-03
| | | | Other ones are not needed.
* Move compat/ and bstr/ directory contents somewhere elseGravatar wm42014-08-29
| | | | | | | | | bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
* wayland: replace deprecated xkbcommon functionsGravatar Alexander Preisinger2014-08-20
| | | | Available and stable since forever (xkbcommon 0.2).
* wayland: dynamically report display fpsGravatar Alexander Preisinger2014-08-18
| | | | | | | | Only reports the most recently entered output if the window is displayed on 2 or more outputs. Should be changed to the lowest fps of all outputs the window is visible. Until no one complains this will have to wait. Look for the VO framedropping for more information on this topic.
* wayland: pointer interface is created after themeGravatar Alexander Preisinger2014-08-13
| | | | | | | | Just always load the theme. It gets freed properly and dosn't bother anyone. Fixes #1012. CC: @mpv-player/stable
* wayland: remove redundant lineGravatar Alexander Preisinger2014-08-06
|
* wayland: changes for nested compositorsGravatar Alexander Preisinger2014-08-06
| | | | | Adds necessary checks for nested compositors which only have limited interfaces. Might also be useful for other minimal compositors.
* vo: remove vo_mouse_movement() wrapperGravatar wm42014-07-27
| | | | So that VO backends don't have to access the VO just for that.
* wayland: move subsurfaces to wayland voGravatar Alexander Preisinger2014-06-15
| | | | | | | Subsurfaces are only used by the wayland vo. Thats why it makes sense to move all osd and subsurface specific parts to the vo_wayland.c Also destroy the subsurfaces and subcompositor properly.
* wayland: attach NULL surface on osd creationGravatar Alexander Preisinger2014-06-15
| | | | | | | When using the EGL output the subsurfaces have no buffer attached and the size seems to be infinite. Fix this by attaching a NULL buffer. Fixes #846
* Add more constGravatar wm42014-06-11
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* wayland: remove stub for unimplemented functionGravatar wm42014-06-02
|
* wayland: fix typoGravatar Alexander Preisinger2014-05-14
| | | | So long in the code without me noticing. Embarassing!
* wayland: fix unchecked malloc usageGravatar wm42014-05-11
| | | | | | | Found by cppcheck. Actually untested. (This is the file drag&drop code, I don't even know which wayland clients support this.)
* wayland: don't use VOCTRL_UPDATE_SCREENINFOGravatar wm42014-05-06
| | | | Not very tested. Appears to work.
* Revert "wayland: print waylands display erros"Gravatar Alexander Preisinger2014-04-26
| | | | | | | | | | | | This reverts commit 6e34b0ec1f50612cb2767da3dbc27be0be63041d. There has always been an error message "proxy already has a listener" and I couldn't reproduce where it is comming from until now. The display interface already has a listener and we can't overwrite it. Now remove the code and avoid this error message. Conflicts: video/out/wayland_common.c
* Fix some libav* include statementsGravatar wm42014-04-19
| | | | | | | | | | | | | Fix all include statements of the form: #include "libav.../..." These come from MPlayer times, when FFmpeg was somehow part of the MPlayer build tree, and this form was needed to prefer the local files over system FFmpeg. In some cases, the include statement wasn't needed or could be replaced with mpv defined symbols.
* wayland: unset input regions for osdGravatar Alexander Preisinger2014-04-16
| | | | | Set a zero sized input region for the osd surfaces in order to avoid getting input for the subsurfaces which might dissapear any time.
* wayland/shm: Use subsurfaces for OSDGravatar Alexander Preisinger2014-04-16
|
* wayland: don't schedule resize if going fullscreenGravatar Ricardo Vieira2014-04-13
| | | | mpv was resizing to the same size before it went to fullscreen, we don't need to schedule a resize because the compositor will send a configure event with the new dimensions and thats when we should do it.
* video/out: simplify monitor aspect handlingGravatar wm42014-01-11
| | | | | | | | For some reason, this made all VO backends both set the screen resolution in opts->screenwidth/height, and call aspect_save_screenres(). Remove the latter. Move the code to calculate the PAR-corrected window size from aspect.c to vo.c, and make it so that the monitor PAR is recalculated when it makes sense.
* wayland: properly empty output listGravatar Alexander Preisinger2014-01-08
|
* wayland: fix crash when initialization failsGravatar wm42014-01-08
| | | | | | On X11, if no wayland compositor is running, wl_list_init() will never be called. This will cause destroy_display() to segfault when trying to iterate over the list.
* wayland: fix memory leaksGravatar Alexander Preisinger2014-01-08
| | | | | There are still some leaks from wayland-cursor stuff, but there is no way to free the memory as user of the cursor library.
* wayland: cleanup registry_handle_globalGravatar Alexander Preisinger2014-01-08
| | | | | The wl_registry object is already passed as a parameter. No need to create a temporary variable.