Commit Graph

107 Commits

Author SHA1 Message Date
Jari Vetoniemi c10fb4ce9f vo_wayland: define opaque region
This allows compositor to optimize rendering, as it will know mpv is not
transparent.
2015-03-23 21:53:32 +01:00
Jari Vetoniemi 3714430cdf vo_wayland: share frame callbacks.
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.
2015-03-23 21:53:32 +01:00
wm4 445b3fbf82 buid: readd -Wparentheses
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.
2015-03-02 19:09:25 +01:00
torque 3b269ac0a0 input: add MOUSE_ENTER keybinding.
Signed-off-by: wm4 <wm4@nowhere>
2015-02-18 00:03:16 +01:00
wm4 fc524e8a07 command: unify handling of fullscreen and other VO flags
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.
2015-01-16 23:07:13 +01:00
wm4 460ef9c7a4 wayland: implement key modifiers
Includes shift, ctrl, alt, meta.
2015-01-12 16:41:00 +01:00
wm4 10532b99e5 wayland: don't compute absurd window size
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.)
2015-01-12 15:21:26 +01:00
Sergey Kvachonok 01717dcd2c vo_wayland: Add "multimedia" keyboard key bindings.
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>
2014-11-29 19:13:47 +01:00
Alexander Preisinger 29467736cf wayland: use reported rete and delay
If native-keyrepeat is true then we set the rate and delay reported by the
compositor.
2014-09-19 17:38:24 +02:00
Alexander Preisinger 369868e404 wayland_common: fix changing videos when fullscreen
I broke it again.
2014-09-10 19:21:52 +02:00
wm4 e267ff93f3 video: rename VOCTRL_GET_WINDOW_SIZE
Make it clear that this accesses the un-fullscreened window size.
2014-09-05 01:52:16 +02:00
Alexander Preisinger fc68c9269d wayland: print some useful outptu info
Prints output informations, useful for finding out if we detect the right mode
and for debugging.
2014-09-03 21:35:26 +02:00
Alexander Preisinger 8bd5df3ac1 wayland: only save current mode of outputs
Other ones are not needed.
2014-09-03 21:35:26 +02:00
wm4 68ff8a0484 Move compat/ and bstr/ directory contents somewhere else
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.
2014-08-29 12:31:52 +02:00
Alexander Preisinger 614ff883bc wayland: replace deprecated xkbcommon functions
Available and stable since forever (xkbcommon 0.2).
2014-08-20 17:16:18 +02:00
Alexander Preisinger 752dce9284 wayland: dynamically report display fps
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.
2014-08-18 22:00:39 +02:00
Alexander Preisinger 69a160f187 wayland: pointer interface is created after theme
Just always load the theme. It gets freed properly and dosn't bother anyone.

Fixes #1012.

CC: @mpv-player/stable
2014-08-13 22:34:18 +02:00
Alexander Preisinger 6ec39b4641 wayland: remove redundant line 2014-08-06 12:58:39 +02:00
Alexander Preisinger f175f2c38f wayland: changes for nested compositors
Adds necessary checks for nested compositors which only have limited
interfaces. Might also be useful for other minimal compositors.
2014-08-06 12:55:51 +02:00
wm4 4c533fbb16 vo: remove vo_mouse_movement() wrapper
So that VO backends don't have to access the VO just for that.
2014-07-27 21:53:29 +02:00
Alexander Preisinger 73121dbcc1 wayland: move subsurfaces to wayland vo
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.
2014-06-15 14:46:27 +02:00
Alexander Preisinger f14b45588e wayland: attach NULL surface on osd creation
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
2014-06-15 14:27:12 +02:00
wm4 99f5fef0ea Add more const
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.
2014-06-11 00:39:14 +02:00
wm4 58b070d178 wayland: remove stub for unimplemented function 2014-06-02 20:20:35 +02:00
Alexander Preisinger adf20c9775 wayland: fix typo
So long in the code without me noticing. Embarassing!
2014-05-14 20:29:08 +02:00
wm4 342298fd1a wayland: fix unchecked malloc usage
Found by cppcheck.

Actually untested. (This is the file drag&drop code, I don't even know
which wayland clients support this.)
2014-05-11 16:41:17 +02:00
wm4 b51664c04a wayland: don't use VOCTRL_UPDATE_SCREENINFO
Not very tested. Appears to work.
2014-05-06 23:16:18 +02:00
Alexander Preisinger a5282e3a69 Revert "wayland: print waylands display erros"
This reverts commit 6e34b0ec1f.

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
2014-04-26 14:51:48 +02:00
wm4 85998f6121 Fix some libav* include statements
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.
2014-04-19 17:18:10 +02:00
Alexander Preisinger 49cbc174c1 wayland: unset input regions for osd
Set a zero sized input region for the osd surfaces in order to avoid getting
input for the subsurfaces which might dissapear any time.
2014-04-16 16:38:54 +02:00
Alexander Preisinger 5528ad3031 wayland/shm: Use subsurfaces for OSD 2014-04-16 16:38:54 +02:00
Ricardo Vieira 586b02e7bd wayland: don't schedule resize if going fullscreen
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.
2014-04-13 15:30:23 +02:00
wm4 d956bbc065 video/out: simplify monitor aspect handling
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.
2014-01-11 18:58:06 +01:00
Alexander Preisinger c555b2ae55 wayland: properly empty output list 2014-01-08 22:16:41 +01:00
wm4 34abe7e255 wayland: fix crash when initialization fails
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.
2014-01-08 21:49:18 +01:00
Alexander Preisinger 4b10255008 wayland: fix memory leaks
There are still some leaks from wayland-cursor stuff, but there is no way to
free the memory as user of the cursor library.
2014-01-08 20:59:40 +01:00
Alexander Preisinger 61e5670684 wayland: cleanup registry_handle_global
The wl_registry object is already passed as a parameter. No need to create
a temporary variable.
2014-01-08 16:23:19 +01:00
Alexander Preisinger 74d9504b65 wayland: remove set_user_data from seat_listener
The user_data is passed on add_listener and can later be changed with
set_user_data. But because we don't want to change it later and because it is
the same object remove the set_user_data call.

This might be a copy&paste leftover from the initial draft for the wayland
backend.
2014-01-08 16:23:19 +01:00
Alexander Preisinger fa5f1e7800 wayland: use static consistently
Declare everything that is only needed inside wayland_common.c as static.
2014-01-08 16:23:11 +01:00
Alexander Preisinger 374f40de30 wayland: fix fullscreen & resizing for good
I added enough logic to never set ontop or fullscreen twitce.
This commit keeps also the size of the video if multiple videos are played.
If the ratio differs the width will be kept at the same size and only the
height changes.
2014-01-07 21:12:24 +01:00
wm4 2c4c912c15 wayland: silence annoying libwayland-client message
libwayland-client contains the following code [1]:

	runtime_dir = getenv("XDG_RUNTIME_DIR");
	if (!runtime_dir) {
		fprintf(stderr,
			"error: XDG_RUNTIME_DIR not set in the environment.\n");

This means this message will unconditionally and unavoidably be printed
if XDG_RUNTIME_DIR is not set. Since mpv is a terminal program, and we
want to avoid unnecessary output, work it around by not attempting to
use wayland if this environment variable is not set.

[1] http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-client.c#n636
    (cd0dccd01e16fa404e03974d30ded3aebdb1c4bc)
2014-01-07 01:07:52 +01:00
wm4 326d887a41 wayland: fix some memory leaks on initialization failure
This commonly happens when initializing vo_opengl on a X11-only system.

Unfortunately, most wl_*_destroy() functions appear not to accept NULL
pointers, making partial deinitialization a pain: you have to add your
own NULL checks everywhere to avoid crashes.

xkb.context is uninitialized separately, because you can initialize it
just fine, even if the rest of input initialization fails.
2014-01-07 01:07:50 +01:00
Alexander Preisinger 68e179bcf0 wayland: remove workaround
The changes in the vo_wayland_ontop function have no effect on the workaround.

Somehow the problem just disappeared. I guess it is because of the new control
function in gl_wayland.c where the resize happens immediatly after the event
dispatch/flush.
2014-01-04 20:54:51 +01:00
Alexander Preisinger 148918dd53 wayland: fix obvious bug in dnd code
I still don't think this is the right approach.
2014-01-04 20:28:52 +01:00
wm4 7c6bb321eb video/out: remove some code duplication between X11 and wayland
Both X11 and Wayland support the same format for drag & drop operations
(text/uri-list), and the code for that was copied from x11_common.c to
wayland_common.c. Factor it out.
2014-01-04 19:33:40 +01:00
Stefano Pigozzi 082c5c19a1 input: move files drag and drop to a new event.c file
event.c will be used to feed the input queue with 'global' events that don't
mesh well with the usual check_events path in mpv.
2014-01-04 17:28:55 +01:00
Alexander Preisinger 340ab6cd72 wayland: move workaround to fullscreen code
Because of this workaround there was a bug in the wayland vo.
Now it works on both vos (opengl and shm) as it should.
2014-01-04 13:57:47 +01:00
Alexander Preisinger 8f241998c0 wayland: implement dropping files on the VO window
Needs some proper testing.
2014-01-04 13:48:50 +01:00
Alexander Preisinger 52fa38079d wayland/opengl: fix garbage borders
It seems mpv draws garbage in those regions. Now we calculate the aspect and
let weston draw the black borders.
2014-01-02 20:33:39 +01:00
Alexander Preisinger e947c72fe9 wayland: don't change set fullscreen twice
Newest weston chrashes if we call set_fullscreen twice. This is a major bug
I which I should probably report.
2014-01-02 20:33:06 +01:00