From 9737ecb7d3793cd62fa8d28b29001ba904736a8a Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 10 Nov 2024 10:30:20 +0000 Subject: [PATCH] Add missing ifdefs for screencopy-dmabuf --- src/ext-image-copy-capture.c | 4 ++++ src/main.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/ext-image-copy-capture.c b/src/ext-image-copy-capture.c index 81b001a..8d01452 100644 --- a/src/ext-image-copy-capture.c +++ b/src/ext-image-copy-capture.c @@ -334,9 +334,11 @@ static double rate_format(const struct ext_image_copy_capture* self, enum wv_buffer_type type, enum wv_buffer_domain domain, uint32_t format, uint64_t modifier) { +#ifdef ENABLE_SCREENCOPY_DMABUF if (type == WV_BUFFER_DMABUF && !self->parent.enable_linux_dmabuf) { return 0; } +#endif return self->parent.rate_format(self->parent.userdata, type, domain, format, modifier); } @@ -359,6 +361,7 @@ static void rate_formats_in_array(const struct ext_image_copy_capture* self, } } +#ifdef ENABLE_SCREENCOPY_DMABUF static void select_modifiers_for_top_format(struct wv_buffer_config* config, const struct format_array* formats) { @@ -378,6 +381,7 @@ static void select_modifiers_for_top_format(struct wv_buffer_config* config, config->modifiers[config->n_modifiers++] = entry->modifier; } } +#endif static bool config_dma_buffers(struct ext_image_copy_capture* self, struct wv_buffer_config* config) diff --git a/src/main.c b/src/main.c index 8bd9713..1f2b5ad 100644 --- a/src/main.c +++ b/src/main.c @@ -1609,9 +1609,11 @@ static double rate_format(const void* userdata, enum wv_buffer_type type, case WV_BUFFER_SHM: fb_type = NVNC_FB_SIMPLE; break; +#ifdef ENABLE_SCREENCOPY_DMABUF case WV_BUFFER_DMABUF: fb_type = NVNC_FB_GBM_BO; break; +#endif case WV_BUFFER_UNSPEC:; } assert(fb_type != NVNC_FB_UNSPEC);