|
|
@@ -30,6 +30,7 @@
|
|
|
#include <fcntl.h>
|
|
|
#include <glad/glad.h>
|
|
|
#include <linux/dma-buf.h>
|
|
|
+#include <libdrm/drm_fourcc.h>
|
|
|
#include <spa/param/video/format-utils.h>
|
|
|
#include <spa/debug/format.h>
|
|
|
#include <spa/debug/types.h>
|
|
|
@@ -386,6 +387,7 @@ static void on_process_cb(void *user_data)
|
|
|
uint32_t strides[planes];
|
|
|
uint64_t modifiers[planes];
|
|
|
int fds[planes];
|
|
|
+ bool modifierless; // DMA-BUF without explicit modifier
|
|
|
|
|
|
blog(LOG_DEBUG,
|
|
|
"[pipewire] DMA-BUF info: fd:%ld, stride:%d, offset:%u, size:%dx%d",
|
|
|
@@ -410,10 +412,14 @@ static void on_process_cb(void *user_data)
|
|
|
}
|
|
|
|
|
|
g_clear_pointer(&obs_pw->texture, gs_texture_destroy);
|
|
|
+
|
|
|
+ modifierless = obs_pw->format.info.raw.modifier ==
|
|
|
+ DRM_FORMAT_MOD_INVALID;
|
|
|
obs_pw->texture = gs_texture_create_from_dmabuf(
|
|
|
obs_pw->format.info.raw.size.width,
|
|
|
obs_pw->format.info.raw.size.height, drm_format,
|
|
|
- GS_BGRX, planes, fds, strides, offsets, modifiers);
|
|
|
+ GS_BGRX, planes, fds, strides, offsets,
|
|
|
+ modifierless ? NULL : modifiers);
|
|
|
} else {
|
|
|
blog(LOG_DEBUG, "[pipewire] Buffer has memory texture");
|
|
|
enum gs_color_format obs_format;
|