aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-15 08:09:23 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-15 08:09:23 +0200
commitffb8c6af3bc6614665f1c5102cdab779963e39c1 (patch)
tree64d0e03386b971645f1501a3b5f1758820082ce9 /include
parenta9b7618be77dd157c04da4d8fbcf1fa2b328ae23 (diff)
Allow prime-run capture on laptop with external gpu when the iGPU
doesn't have any monitor to capture. Fix prime-run desktop portal capture broken (fallback to external texture). Fallback to external texture in kms capture.
Diffstat (limited to 'include')
-rw-r--r--include/pipewire.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/pipewire.h b/include/pipewire.h
index 4a6330d..d4abe42 100644
--- a/include/pipewire.h
+++ b/include/pipewire.h
@@ -43,6 +43,12 @@ typedef struct {
} gsr_video_format;
typedef struct {
+ unsigned int texture_id;
+ unsigned int external_texture_id;
+ unsigned int cursor_texture_id;
+} gsr_texture_map;
+
+typedef struct {
gsr_egl *egl;
int fd;
uint32_t node;
@@ -85,6 +91,7 @@ typedef struct {
bool started;
bool stopped;
bool no_modifiers_fallback;
+ bool external_texture_fallback;
uint64_t modifiers[GSR_PIPEWIRE_MAX_MODIFIERS];
size_t num_modifiers;
@@ -98,8 +105,8 @@ typedef struct {
bool gsr_pipewire_init(gsr_pipewire *self, int pipewire_fd, uint32_t pipewire_node, int fps, bool capture_cursor, gsr_egl *egl);
void gsr_pipewire_deinit(gsr_pipewire *self);
-/* |plane_fds| should be at GSR_PIPEWIRE_DMABUF_MAX_PLANES in size */
-bool gsr_pipewire_map_texture(gsr_pipewire *self, unsigned int texture_id, unsigned int cursor_texture_id, gsr_pipewire_region *region, gsr_pipewire_region *cursor_region, int *plane_fds, int *num_plane_fds);
+/* |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_recording_stopped(gsr_pipewire *self);
#endif /* GSR_PIPEWIRE_H */