obs-studio/plugins/linux-capture
Georges Basile Stavracas Neto ec3e8146b2 pipewire: Properly pass sizes to gs_draw_sprite_subregion
The gs_draw_sprite_subregion() function is used when a cropping
rectangle is received from PipeWire. It is usually used by
compositors to implement window screencast - where a large and
mostly empty frame is sent, the window contents are only a small
part of it, and the crop rectangle tells us that.

Recently the wlroots implementation of portals started to use it
to implement cropping, and it exposed a bug in the PipeWire code
in OBS Studio. The gs_draw_sprite_subregion() function takes a pair
of integers representing position (x, y) and a pair of integers
representing size (width, height). The PipeWire code, however,
passes a second pair of positions (x2, y2) instead of sizes, and
it causes overrendering the crop area.

This bug wasn't hit yet because both GNOME and KDE implementations
always send (0, 0) as position, which practically never trigger
this condition.

Pass only width and height to gs_draw_sprite_subregion(), instead
of adding x and y to them.

Fixes https://github.com/obsproject/obs-studio/issues/4982
2021-07-08 08:32:55 -07:00
..
data/locale Update translations from Crowdin 2021-06-11 07:18:15 -07:00
CMakeLists.txt linux-capture: Conditionally register PipeWire captures 2021-06-30 01:51:02 -07:00
README Rename linux-xshm module to linux-capture 2014-08-29 17:19:30 -07:00
linux-capture.c linux-capture: Return different descriptions for different captures 2021-03-29 17:00:31 -03:00
pipewire-capture.c linux-capture: Conditionally register PipeWire captures 2021-06-30 01:51:02 -07:00
pipewire-capture.h linux-capture: Add PipeWire-based capture 2021-03-29 17:00:31 -03:00
pipewire.c pipewire: Properly pass sizes to gs_draw_sprite_subregion 2021-07-08 08:32:55 -07:00
pipewire.h linux-capture: Add PipeWire-based capture 2021-03-29 17:00:31 -03:00
portal.c linux-capture: Add getters for portal's D-Bus connection and proxy 2021-06-30 01:51:02 -07:00
portal.h linux-capture: Add getters for portal's D-Bus connection and proxy 2021-06-30 01:51:02 -07:00
xcompcap-helper.cpp linux-capture: Remove unused code 2021-01-24 16:36:41 -08:00
xcompcap-helper.hpp linux-capture: Remove unused code 2021-01-24 16:36:41 -08:00
xcompcap-main.cpp Merge pull request #3047 from MaZderMind/bugfix/3040 2021-02-01 14:18:12 -08:00
xcompcap-main.hpp clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
xcomposite-main.cpp UI: Add source icons 2019-11-24 20:50:42 -08:00
xcursor-xcb.c linux-capture: Support linear SRGB 2021-01-21 07:42:57 -08:00
xcursor-xcb.h clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
xcursor.c linux-capture: Support linear SRGB 2021-01-21 07:42:57 -08:00
xcursor.h linux-capture: Fix cursor draw bug when cropping window cap. 2019-11-20 22:09:47 -08:00
xhelpers.c linux-capture: Use RandR monitors for screen information 2020-03-13 18:29:35 -07:00
xhelpers.h linux-capture: Use RandR monitors for screen information 2020-03-13 18:29:35 -07:00
xshm-input.c linux-capture: Add OBS_SOURCE_SRGB flag 2021-05-03 01:19:56 -07:00

README

Linux XShm capture plugin

  This plugin uses the MIT-SHM extension for the X-server to capture the
  desktop.

Todo:

 - handle resolution changes of screens
 - handle adding/removing screens while recording
 - support different depths

Contributing:

  If you are interested in helping out with the plugin, please drop by in the
  #obs-dev channel on quakenet.

References:
 - http://www.x.org/releases/current/doc/xextproto/shm.html