Commit graph

167 commits

Author SHA1 Message Date
Niels De Graef
c461f22bef waylandsink: prefix wl_shell-specific variables with wl_ 2019-03-04 10:58:54 +00:00
Daniel Stone
68fa80e831 waylandsink: Don't create throwaway empty regions
Instead of creating a region, adding nothing to it, setting that as the
input region and destroying the region, you can instead just pass NULL
to wl_surface_set_input_region for the same effect.

Fixes #702
2019-02-15 12:03:48 +00:00
Wonchul Lee
2ae381e2a3 waylandsink: Avoid race condition on multi-threaded client
When waylandsink is used on some other thread than the main wayland
client thread, the waylandsink implementation is vulnerable to a

condition related to registry and surface events which handled in
seperated event queue.

The race that may happen is that after a proxy is created, but
before the queue is set, events meant to be emitted via the yet to

set queue may already have been queued on the wrong queue.

Wayland 1.11 introduced new API that allows creating a proxy
wrappper which can help to avoid this race condition.
2018-12-13 17:20:04 +00:00
Matteo Valdina
e0535b44d4 waylandsink: relaxed wl_shell check and added zwp_fullscreen_shell.
Relaxed the wl_shell interface constrains, so application that
pass via GstContext the wl_surface can use waylandsink in a
compositor without wl_surface and zwp_fullscreen_shell.

Added support for zwp_fullscreen_shell.

https://bugzilla.gnome.org/show_bug.cgi?id=796772
2018-07-25 07:53:09 -04:00
Fabien Dessenne
f777c66dcc waylandsink: support fullscreen
Add the fullscreen property that makes the sink displayed all across
the output.

https://bugzilla.gnome.org/show_bug.cgi?id=688190
2018-05-06 15:13:59 +02:00
Xavier Claessens
83d0623293 Meson: Generate pc file for all plugins in bad
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:08:09 +01:00
Nicolas Dufresne
c04aba241e waylandsink: Fix memory leak of shm allocator
This fixes conflict resolution error introduced in commit:

  816d115317

http://bugzilla.gnome.org/show_bug.cgi?id=790042
2017-12-06 20:50:31 -05:00
Shinya Saito
816d115317 waylandsink: Fix memory leak of shm allocator.
gst_allocator_find() needs gst_object_unref() after usage.

https://bugzilla.gnome.org/show_bug.cgi?id=790042
2017-12-06 15:46:40 -05:00
Nicolas Dufresne
9c866da336 waylandsink: Add prototype for gst_wayand_pool_get_type() 2017-11-25 20:06:57 -05:00
Nicolas Dufresne
2db81d6597 waylandsink: Rollback video info changes when copying
We change the video info base on the received buffer. We need to
rollback these changes whenever we want to copy into our internal
pool of buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=790057
2017-11-25 14:59:03 -05:00
Nicolas Dufresne
1a7363e023 waylandsink: Validate strides and offset when using FD as SHM
As SHM interface only support 1 stride, and 1 offset, we need to
make sure that there is no padding between planes for planar formats.

https://bugzilla.gnome.org/show_bug.cgi?id=790057
2017-11-25 14:59:03 -05:00
Nicolas Dufresne
cc033355ab waylandsink: Update video info size to buffer size
We where setting the size to the first memory size, this may be
too small in case we received a buffer with multiple memory.

https://bugzilla.gnome.org/show_bug.cgi?id=790057
2017-11-25 14:59:03 -05:00
Nicolas Dufresne
02df3a47b3 waylandsink: Allocate only what's needed when copying
There was this regression that we'd be using the updated video
info size instead of default size when initializing the pool.

https://bugzilla.gnome.org/show_bug.cgi?id=790057
2017-11-25 14:59:03 -05:00
Nicolas Dufresne
9bbd5ef722 waylandsink: Only try SHM for single memory buffer
https://bugzilla.gnome.org/show_bug.cgi?id=790057
2017-11-25 14:59:03 -05:00
Nicolas Dufresne
51bb235cc6 wlwindow: Only update video info on new render
The sink->video_info might not reflect the current buffer
when expose is being called.

https://bugzilla.gnome.org/show_bug.cgi?id=790057
2017-11-25 14:59:03 -05:00
Nicolas Dufresne
b06a8bffde waylandsink: Disable video-alignment from the pool
The SHM interface does not allow passing arbitrary strides and offsets,
for this reason, we simply disable this feature from the proposed pool.

This fixes video artifact seen when using the FFMPEG based video
decoder.

https://bugzilla.gnome.org/show_bug.cgi?id=790057
2017-11-25 14:59:03 -05:00
Nicolas Dufresne
9b2e28d91d Request minimum buffer even if need_pool is FALSE
When tee is used, it will not request a pool, but still it wants to
know how many buffers are required.

https://bugzilla.gnome.org/show_bug.cgi?id=730758
2017-09-06 14:19:37 -04:00
Sebastian Dröge
634cd87c76 gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent
https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-05-17 10:40:23 +03:00
Nicolas Dufresne
4261692187 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:05:52 -04:00
Thibault Saunier
78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
George Kiagiadakis
5e9ce3313f waylandsink: fix memory offset calculation for dmabuf buffers
https://bugzilla.gnome.org/show_bug.cgi?id=779790
2017-03-14 17:07:40 +02:00
Fabien Dessenne
e2dffab9be waylandsink: consider buffer size when copying to wl shm pool
When the sink receives a buffer that is neither a wl_shm one nor a
dmabuf one, this buffer is copied to an internal wl_shm buffer before
being sent to the display.
In that case, the actual size of the received buffer (which may differ
from the one negotiated in the caps) must be used.

https://bugzilla.gnome.org/show_bug.cgi?id=777841
2017-02-22 04:23:44 -05:00
Fabien Dessenne
57645056ad waylandsink: set video surface opaque
Unless the video format has an alpha component (ARGB, ...), set the
video_surface opaque.
In the usual case where the black area_surface has the same size as the
video_surface (eg: run gst-play-1.0 video.mp4), this makes the black
surface totally occluded which makes weston compositor's life easier
since it can ignore that surface.
Also unconditionally set the black area_surface opaque.

https://bugzilla.gnome.org/show_bug.cgi?id=778078
2017-02-02 13:14:01 -05:00
Fabien Dessenne
e2fba40038 waylandsink: fix display re-connection (redraw pending)
Reset redraw_pending at display disconnection, so we can re-connect
later from a clean state (avoid endless buffer drops).
Add a log to inform of dropped buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=775791
2017-01-02 19:53:27 -05:00
Sebastian Dröge
9b89f58cae ext: Fix various compiler warnings with clang
wldisplay.c:179:15: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
  if (shm_fmt < 0)
      ~~~~~~~ ^ ~

gstsegmentation.cpp:419:40: error: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
          filter->cvFG->imageData[j] = 255;
                                     ~ ^~~

https://bugzilla.gnome.org/show_bug.cgi?id=775112
2016-11-25 23:47:15 +02:00
Sebastian Dröge
95ed2cf687 wldisplay: Don't compare a guint with < 0
-1 is the "invalid" value, compare to it directly.

CID 1394490.
2016-11-23 18:45:42 +02:00
Reynaldo H. Verdejo Pinochet
7c64ea4832 wayland: avoid prefix clash in combined pkg-config check
Adittionally, remove leftover WAYLAND_DRM_ include flags var

Fixes building of ext/wayland/* broken by dfd86de67a

Related to:

https://bugzilla.gnome.org/show_bug.cgi?id=773927
2016-11-18 10:41:16 -08:00
Thibault Saunier
c38d3a41e2 meson: Build waylandsink
https://bugzilla.gnome.org/show_bug.cgi?id=774493
2016-11-15 18:33:25 -03:00
Tim-Philipp Müller
5f5ce8f1ff wayland: only use libdrm headers, don't link to the lib
https://bugzilla.gnome.org/show_bug.cgi?id=773927
2016-11-04 13:44:19 +00:00
Tim-Philipp Müller
9229e34a6b wayland: include drm_fourcc.h properly and fix build 2016-11-04 09:21:59 +00:00
Tim-Philipp Müller
dc6862bf70 wayland: fix cflags/libs order 2016-11-04 09:21:59 +00:00
Nicolas Dufresne
5d01d3bbb8 waylandsink: Rework dmabuf support
Simplify and fix some of the show_frame logic.

https://bugzilla.gnome.org/show_bug.cgi?id=711155
2016-11-03 15:37:46 -04:00
Fabien Dessenne
2ad337e440 waylandsink: support linux dmabuf protocol
Support the wayland zwp_linux_dmabuf_unstable_v1 protocol.
SHM formats and DMABuf formats are exposed differently in caps: the
DMABuf formats are flagged with GST_CAPS_FEATURE_MEMORY_DMABUF.
No buffer pool is proposed for DMABuf buffers, it is the upstream
element responsibility to provide with such buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=711155
2016-11-03 15:37:46 -04:00
Nicolas Dufresne
3272f2002f waylandsink: Allow any kind of FD for shm memory
https://bugzilla.gnome.org/show_bug.cgi?id=711155
2016-11-03 15:37:46 -04:00
Arun Raghavan
312c8c9f7c waylandsink: Properly configure internal pool
There was a small omission in the code. It still worked, but the pool
configuration may not have been optimimal.
2016-10-13 12:10:51 -04:00
Arun Raghavan
cd8f463345 waylandsink: Actually use buffer pool config after setting it up
CID: 1373420
2016-09-30 12:59:20 +05:30
Nicolas Dufresne
31d0a2c1ea waylandsink: Don't leak GValues in getcaps 2016-09-23 16:48:34 -04:00
Nicolas Dufresne
f6b270d8eb waylandsink: Update our window size on configure event
This is specific to when the waylandsink is not being embedded. In
this patch we pass the render lock to the window so it can safely
call gst_wl_window_set_render_rectangle() with the new size.

https://bugzilla.gnome.org/show_bug.cgi?id=722343
2016-09-22 19:12:22 -04:00
Nicolas Dufresne
fdea1e1144 waylandsink: Remove atomic operation
We already take the render lock from the wlqueue thread in some other
place which indicates that there is no use of this atomic instead of
a proper locking mechanism.
2016-09-22 19:12:22 -04:00
Nicolas Dufresne
0859e201f6 waylandsink: Do not pre-configure proposed pool
Upstream must configure the pool before using it. Pre-configuring
the proposed pool could hide bugs in upstream elements.
2016-09-22 19:12:22 -04:00
Nicolas Dufresne
ecf88d0d43 waylandsink: Properly draw black border in absence of viewporter
When we don't have a viewporter (scaling support), we can't use the
1x1 scaleup image trick. Instead, we need to allocate a buffer with
the same size as the area that need to have black background.
2016-09-22 19:12:22 -04:00
Nicolas Dufresne
ba71a392a6 waylandsink: Destroy viewporter when done
https://bugzilla.gnome.org/show_bug.cgi?id=738079
2016-09-21 15:08:34 -04:00
Nicolas Dufresne
3378b1a259 waylandsink: Port to vmeta and GstVideoFrame
This add support for non-standard strides to be used. Note that
some extra work is needed for multi-plane format which may have
a different GstMemory object per plane. This is not currently a
problem since SHM interface is limited to 1 memory.
2016-09-21 11:02:40 -04:00
Nicolas Dufresne
74a7baa533 waylandsink: Don't propose multiple time the same buffer pool
The buffer pool API does not allow multiple of owner. This otherwise
lead to error when renegotiation take place. Aso consider the
allocation query "need_pool" boolean.
2016-09-21 11:02:40 -04:00
Nicolas Dufresne
9357047eaf waylandsink: Promote debug trace into error trace
Otherwise those error may go unseen making debugging much
harder.
2016-09-21 11:02:40 -04:00
Nicolas Dufresne
94a5652694 waylandsink: Factor-out the pool creation 2016-09-21 11:02:40 -04:00
Nicolas Dufresne
1c81b0bb6e waylansink: Implement _show_frame()
This fixes the property show-preroll-frame expose by the VideoSink base
class and removes redundant code.
2016-09-21 11:02:40 -04:00
Tim-Philipp Müller
957ea18b1b wayland: fix distcheck some more 2016-09-20 18:28:29 +01:00
Tim-Philipp Müller
b711e23036 wayland: fix distcheck when wayland-scanner is not installed 2016-09-17 14:12:44 +01:00
Nicolas Dufresne
4bb5823cea waylandsink: Make wl_viewporter optional
This makes the viewporter interface optional. The end result is
obviously far from optimal, though it greatly helps testing on older
compostitors or gnome-wayland. We can make it strictly needed later when
this new interface get widely adopted.
2016-09-15 14:14:10 -04:00