aboutsummaryrefslogtreecommitdiff
path: root/src/pipewire.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-15 04:22:00 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-15 04:22:00 +0200
commitf6f8fdb33c630973cc0cc8c1f4f92efa6e4cb7c8 (patch)
treefce41200c196e909a648b18a56140ceaf276ac92 /src/pipewire.c
parentf53d7b30b1afab466257fee3d3a3823cff3ff2ad (diff)
Portal: sync capture to frame update
Diffstat (limited to 'src/pipewire.c')
-rw-r--r--src/pipewire.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pipewire.c b/src/pipewire.c
index 8751b7d..30e2c00 100644
--- a/src/pipewire.c
+++ b/src/pipewire.c
@@ -129,6 +129,8 @@ static void on_process_cb(void *user_data) {
self->dmabuf_data[i].offset = buffer->datas[i].chunk->offset;
self->dmabuf_data[i].stride = buffer->datas[i].chunk->stride;
}
+
+ self->damaged = true;
} else {
// TODO:
}
@@ -745,3 +747,17 @@ bool gsr_pipewire_map_texture(gsr_pipewire *self, gsr_texture_map texture_map, g
pthread_mutex_unlock(&self->mutex);
return true;
}
+
+bool gsr_pipewire_is_damaged(gsr_pipewire *self) {
+ bool damaged = false;
+ pthread_mutex_lock(&self->mutex);
+ damaged = self->damaged;
+ pthread_mutex_unlock(&self->mutex);
+ return damaged;
+}
+
+void gsr_pipewire_clear_damage(gsr_pipewire *self) {
+ pthread_mutex_lock(&self->mutex);
+ self->damaged = false;
+ pthread_mutex_unlock(&self->mutex);
+}