Correctly combine damage tracking when using multiple sources

This commit is contained in:
dec05eba
2025-12-25 03:43:02 +01:00
parent 5a189e8a17
commit 67ddede74a
3 changed files with 11 additions and 8 deletions

View File

@@ -111,10 +111,14 @@ These are the available options for capture sources:
- The Y position in pixels. If the number ends with % and is a number between 0 and 100 then it's a position relative to the video size
.IP \(bu 3
.B width
- The width in pixels. If the number ends with % and is a number between 0 and 100 then it's a size relative to the video size
- The width in pixels. If the number ends with % and is a number between 0 and 100 then it's a size relative to the video size.
A value of 0 means to not scale the capture source and instead use the original width.
.IP \(bu 3
.B height
- The height in pixels. If the number ends with % and is a number between 0 and 100 then it's a size relative to the video size
A value of 0 means to not scale the capture source and instead use the original height.
.IP \(bu 3
.B halign
- The horizontal alignment, should be either

View File

@@ -201,8 +201,6 @@ static void usage_header(void) {
fflush(stdout);
}
// TODO: Add --list-v4l2-devices option
static void usage_full(void) {
const bool inside_flatpak = getenv("FLATPAK_ID") != NULL;
usage_header();

View File

@@ -4270,6 +4270,9 @@ int main(int argc, char **argv) {
should_stop_error = false;
bool damaged = false;
if(use_damage_tracking)
damaged = gsr_damage_is_damaged(&damage);
for(VideoSource &video_source : video_sources) {
gsr_capture_tick(video_source.capture);
@@ -4291,11 +4294,9 @@ int main(int argc, char **argv) {
video_source.capture_source->window_id = damage_target_window;
}
if(use_damage_tracking)
damaged = gsr_damage_is_damaged(&damage);
else if(video_source.capture->is_damaged)
damaged = video_source.capture->is_damaged(video_source.capture);
else
if(video_source.capture->is_damaged)
damaged |= video_source.capture->is_damaged(video_source.capture);
else if(!use_damage_tracking)
damaged = true;
}