libobs/graphics: Add Linux-only gs_texture_create_from_dmabuf()

DMA-BUF is a widespread Linux buffer sharing mechanism. It is what's
commonly used zero-copy screen sharing by Wayland compositors.

Add a new 'device_texture_create_from_dmabuf' vfunc to gs_exports,
and stub implementations to libobs-opengl. Add a new public method
gs_texture_create_from_dmabuf() that calls this vfunc.
This commit is contained in:
Georges Basile Stavracas Neto
2020-03-12 23:50:18 -03:00
parent 01c00cf271
commit f7a55f45fd
10 changed files with 126 additions and 0 deletions

View File

@@ -170,6 +170,16 @@ EXPORT void device_debug_marker_begin(gs_device_t *device,
const float color[4]);
EXPORT void device_debug_marker_end(gs_device_t *device);
#if __linux__
EXPORT gs_texture_t *device_texture_create_from_dmabuf(
gs_device_t *device, unsigned int width, unsigned int height,
enum gs_color_format color_format, uint32_t n_planes, const int *fds,
const uint32_t *strides, const uint32_t *offsets,
const uint64_t *modifiers);
#endif
#ifdef __cplusplus
}
#endif