Commit graph

12 commits

Author SHA1 Message Date
Hou Qi be7ba5ac51 wlwindow: free staged buffer when do gst_wl_window_finalize
If waylandsink received buffer rate is high which causes frame
drop, the cached staged buffer will be replaced when next buffer
needs to be rendered and be freed after redraw. But there is
chance to get memory leak if ended without redraw. So need to
free staged buffer when do gst_wl_window_finalize().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6670>
2024-04-25 23:55:42 +00:00
Haihua Hu 560dc511f7 wlwindow: clear configure mutex and cond when finalize
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6722>
2024-04-24 01:02:15 +09:00
Damian Hobson-Garcia dd8ef3ec1b waylandsink: Move buffer commits to the display thread
Syncrhonizing buffer commits to the streaming thread can lead to
dropped frames when frame callbacks are not processed before the
next frame is ready for rendering.  Depending on the drift between
the wayland compositor and buffer source timings, this can lead to
periods of significant frame drop, especially when the media frame
rate is close to the display frame rate.

Cache buffers in the streaming thread and peform commits on the
display thread to eliminate the buffer commit racing.

The implementation is the same for both waylandsink and gtkwaylandsink,
so move it to the common wayland library under gst-lib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6133>
2024-02-27 17:20:42 +00:00
Daniel Stone 3a37778f69 gstwayland: Support wp_single_pixel_buffer_v1
This protocol does what it says on the box, avoiding the need for a 1x1
wl_shm buffer.

A wayland-projects wrap has been added for users who do not have v1.26
available.

This commit was partly authored by Robert Mader.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2662>
2024-01-22 16:51:36 -05:00
Scott Moreau f0d15f335d gst-launch: accept option to set program name
The option --prog-name="PROGRAM-NAME" can be passed to set the program name.
The program name is used by gtk and gstreamer to set the class or app-id.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5263>
2024-01-12 17:11:11 +00:00
Xavier Claessens 7df22b338b GstShmAllocator: New shared memory allocator
This makes Wayland's allocator public. It is generally useful to have a
shared memory allocator that can create memfd on Linux.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Hugues Fruchet 42c65cc765 waylandsink: Fix cropping for video with non-square aspect ratio
Padding of unaligned content is still visible at right with some aspect-ratio.
Fix this by giving the original content resolution to wp_viewport_set_source()
instead of pixel aspect ratio scaled one.

Fixes !5259

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5346>
2023-09-19 22:56:31 +00:00
Nicolas Dufresne 0b648f9a2d waylandsink: Crop surfaces to their display width height
Setting the surface source rectangle has been omitted so far. As a side effect
surface created with padded width/height are being scaled down. Fix this using
the viewporter source rectangle configuration. This can later be enhanced
to support crop meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5259>
2023-08-30 18:58:45 +00:00
Colin Kinloch 82c449ce00 waylandsink: Emit "map" signal boarder surface is ready
This allows gtkwaylandsink to queue a draw of its gtk widget at the
correct time, avoiding a race.

Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4722>
2023-05-31 18:57:56 +00:00
Tim-Philipp Müller 81716a1097 gst-plugins-bad: re-indent with GNU indent 2.2.12
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4182>
2023-03-17 03:18:54 +00:00
Robert Mader 6aa0b0cae2 gstwaylandsink: Add rotate-method property
Similar to and inspired by glimagesink and gtkglsink.

Using the Wayland buffer transform API allows to offload
rotate operations to the Wayland compositor. This can have
several advantages:
 - The Wayland compositor may be able to use hardware plane
   capabilities to do the rotation.
 - In case of pre-rotated content on rotated outputs the
   rotations may equal out, potentially allowing the
   compositor to use hardware planes even if they don't
   support rotate operations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2543>
2022-06-20 18:30:56 +00:00
Robert Mader 8c3e33d494 gstwayland: Move reusable parts of the waylandsink into a library
In preparation for the new element `GstGtkWaylandSink`, move reusable
parts out of `GstWaylandSink` into the already exisiting but very
barebone library.

Notable changes include:
 - the `GstWaylandVideo` interface was dropped
 - support for `wl-shell` was dropped
 - lots of renaming in order to match established naming patterns
 - lots of code modernisations, reducing boilerplate
 - members were made private wherever possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2479>
2022-06-06 14:36:39 +02:00