
Add new param to request SyncTimeline metadata on buffer that contains the sync points. Add new Buffers param depending on the SyncTimeline metadata and that adds extra space for the syncobj fd. When we receive a buffer from PipeWire with the SyncTimeline, also set up the spa_data with the syncobj fd and the sync type. We use the GenericFd type. When we render a buffer with SyncTimeline, set the acquire & release points for the syncobj. [ Michel Dänzer: * Flesh out Wim's skeleton and make it compile * Dequeue explicit-sync buffers only if the release point has signaled * Tweak commit log v2: * Always check spa_buffer->n_datas as well when getting the SPA_META_SyncTimeline metadata (Doğukan Korkmaztürk) * Always put space before opening parens. v3: * Keep a per-stream list of dequeued buffers with unsignaled release point. (Wim Taymans) * Fix indentation of meta_drm_timeline_is_signaled parameters in dequeue_pw_buffer. v4: * priv->dequeued_buffers handling fixes in dequeue_pw_buffer. v5: * Fix bumping sync points in maybe_set_sync_points. v6: * Guard new code by #ifdef HAVE_NATIVE_BACKEND as needed. * Remove unused sync_fd in dequeue_pw_buffer. v7: (Sebastian Wick) * Refactor can_reuse_pw_buffer helper out of dequeue_pw_buffer. * Separate loops for priv->dequeued_buffers and pw_stream_dequeue_buffer in dequeue_pw_buffer. * Add g_assert after g_hash_table_lookup. * Prevent calling meta_drm_timeline_is_signaled with non-NULL *error. * Use g_autoptr & g_steal_pointer for timeline in maybe_create_syncobj. * Log meta_drm_timeline_create_syncobj / meta_drm_timeline_import_syncobj errors in maybe_create_syncobj. * Use g_warning_once instead of g_warning. * Do not close (spa_buffer->datas[1].fd) in on_stream_remove_buffer, g_hash_table_remove closes it. v8: * Fix pw_stream_dequeue_buffer loop condition in dequeue_pw_buffer. (Sebastian Wick) * Use g_clear_error in can_reuse_pw_buffer. (Sebastian Wick) * Add comment above dequeued_buffers list declaration in MetaScreenCastStreamSrcPrivate. v9: * Call g_clear_error from dequeue_pw_buffer instead of can_reuse_pw_buffer. (Sebastian Wick) v10: (Jonas Ådahl) * Move added #includes to separate HAVE_NATIVE_BACKEND block. * Add and use enum entries for spa_buffer::datas array access. * Clean up the end of can_reuse_pw_buffer. * Change first argument of dequeue_pw_buffer to MetaScreenCastStreamSrc. * Rename GSList iterator to "l". * Clean up error handling in dequeue_pw_buffer. * Fix second parameter to second can_reuse_pw_buffer call in dequeue_pw_buffer. * Fix coding style of code added in on_stream_param_changed. v11: * Move local_error declaration inside HAVE_NATIVE_BACKEND in dequeue_pw_buffer. v12: (Jonas Ådahl) * Use new syncobj_data_from_buffer helper to retrieve acquire/release spa_data. * Generally assume spa_buffer->n_datas is large enough, just spot-check it in strategic places. * Use GList for dequeued_buffers list. * Warn in meta_screen_cast_stream_src_dispose if dequeued_buffers list isn't empty. v13: * Simplify empty list test in meta_screen_cast_stream_src_dispose. (Jonas Ådahl) v14: * Refactor maybe_remove_syncobj helper out of on_stream_remove_buffer. This allows using g_return_if_fail in the former. (Sebastian Wick, Jonas Ådahl) v15: * Guard syncobj_data_from_buffer & enum definitions by HAVE_NATIVE_BACKEND, since they're unused outside of that guard. ] [ Jonas Ådahl v16: * Destroy the timelines hash table after destroying the stream. * Don't warn when getting timeline data. * Fix n_datas sanity check condition. ] Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3876>
Mutter
Mutter is a Wayland display server and X11 window manager and compositor library.
When used as a Wayland display server, it runs on top of KMS and libinput. It implements the compositor side of the Wayland core protocol as well as various protocol extensions. It also has functionality related to running X11 applications using Xwayland.
When used on top of Xorg it acts as a X11 window manager and compositing manager.
It contains functionality related to, among other things, window management, window compositing, focus tracking, workspace management, keybindings and monitor configuration.
Internally it uses a fork of Cogl, a hardware acceleration abstraction library used to simplify usage of OpenGL pipelines, as well as a fork of Clutter, a scene graph and user interface toolkit.
Mutter is used by, for example, GNOME Shell, the GNOME core user interface, and by Gala, elementary OS's window manager. It can also be run standalone, using the command "mutter", but just running plain mutter is only intended for debugging purposes.
Contributing
To contribute, open merge requests at https://gitlab.gnome.org/GNOME/mutter.
It can be useful to first look at the GNOME Handbook and the documentation and API references below first.
Documentation
- Coding style and conventions
- Git conventions
- Code overview
- Building and Running
- Debugging
- Monitor configuration
API Reference
- Meta: https://mutter.gnome.org/meta/
- Clutter: https://mutter.gnome.org/clutter/
- Cogl: https://mutter.gnome.org/cogl/
- CoglPango: https://mutter.gnome.org/cogl-pango/
- Mtk: https://mutter.gnome.org/mtk/
Meetings
There are recurring meetings to discuss development of GNOME Shell, mutter and related components.
License
Mutter is distributed under the terms of the GNU General Public License, version 2 or later. See the COPYING file for detalis.