From f6f8fdb33c630973cc0cc8c1f4f92efa6e4cb7c8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 15 Sep 2024 04:22:00 +0200 Subject: Portal: sync capture to frame update --- include/capture/capture.h | 2 ++ include/pipewire.h | 3 +++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/capture/capture.h b/include/capture/capture.h index 7a42909..e31b3a5 100644 --- a/include/capture/capture.h +++ b/include/capture/capture.h @@ -25,6 +25,8 @@ struct gsr_capture { bool (*uses_external_image)(gsr_capture *cap); /* can be NULL. If NULL, return false */ bool (*set_hdr_metadata)(gsr_capture *cap, AVMasteringDisplayMetadata *mastering_display_metadata, AVContentLightMetadata *light_metadata); /* can be NULL. If NULL, return false */ uint64_t (*get_window_id)(gsr_capture *cap); /* can be NULL. Returns 0 if unknown */ + bool (*is_damaged)(gsr_capture *cap); /* can be NULL */ + void (*clear_damage)(gsr_capture *cap); /* can be NULL */ void (*destroy)(gsr_capture *cap, AVCodecContext *video_codec_context); void *priv; /* can be NULL */ diff --git a/include/pipewire.h b/include/pipewire.h index 8e20616..13c4b67 100644 --- a/include/pipewire.h +++ b/include/pipewire.h @@ -65,6 +65,7 @@ typedef struct { struct spa_video_info format; int server_version_sync; bool negotiated; + bool damaged; struct { bool visible; @@ -105,5 +106,7 @@ void gsr_pipewire_deinit(gsr_pipewire *self); /* |plane_fds| should be at least GSR_PIPEWIRE_DMABUF_MAX_PLANES in size */ bool gsr_pipewire_map_texture(gsr_pipewire *self, gsr_texture_map texture_map, gsr_pipewire_region *region, gsr_pipewire_region *cursor_region, int *plane_fds, int *num_plane_fds, bool *using_external_image); +bool gsr_pipewire_is_damaged(gsr_pipewire *self); +void gsr_pipewire_clear_damage(gsr_pipewire *self); #endif /* GSR_PIPEWIRE_H */ -- cgit v1.2.3