2023-10-15 03:21:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "gdkdmabufformatsbuilderprivate.h"
|
|
|
|
|
|
|
|
#define GDK_DMABUF_MAX_PLANES 4
|
|
|
|
|
|
|
|
typedef struct _GdkDmabuf GdkDmabuf;
|
|
|
|
typedef struct _GdkDmabufDownloader GdkDmabufDownloader;
|
|
|
|
|
|
|
|
struct _GdkDmabuf
|
|
|
|
{
|
|
|
|
guint32 fourcc;
|
|
|
|
guint64 modifier;
|
|
|
|
unsigned int n_planes;
|
|
|
|
struct {
|
|
|
|
int fd;
|
|
|
|
unsigned int stride;
|
|
|
|
unsigned int offset;
|
|
|
|
} planes[GDK_DMABUF_MAX_PLANES];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkDmabufDownloader
|
|
|
|
{
|
2023-10-21 23:19:21 +00:00
|
|
|
const char *name;
|
2023-10-22 13:59:02 +00:00
|
|
|
gboolean (* add_formats) (const GdkDmabufDownloader *downloader,
|
2023-10-15 03:21:23 +00:00
|
|
|
GdkDisplay *display,
|
|
|
|
GdkDmabufFormatsBuilder *builder);
|
|
|
|
gboolean (* supports) (const GdkDmabufDownloader *downloader,
|
|
|
|
GdkDisplay *display,
|
|
|
|
const GdkDmabuf *dmabuf,
|
|
|
|
gboolean premultiplied,
|
|
|
|
GdkMemoryFormat *out_format,
|
|
|
|
GError **error);
|
|
|
|
void (* download) (const GdkDmabufDownloader *downloader,
|
|
|
|
GdkTexture *texture,
|
|
|
|
GdkMemoryFormat format,
|
|
|
|
guchar *data,
|
|
|
|
gsize stride);
|
|
|
|
};
|
|
|
|
|
2023-10-22 15:23:37 +00:00
|
|
|
#ifdef HAVE_DMABUF
|
2023-10-20 10:08:18 +00:00
|
|
|
|
2023-10-21 20:31:10 +00:00
|
|
|
const GdkDmabufDownloader * gdk_dmabuf_get_direct_downloader (void) G_GNUC_CONST;
|
|
|
|
const GdkDmabufDownloader * gdk_dmabuf_get_egl_downloader (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
gboolean gdk_dmabuf_sanitize (GdkDmabuf *dest,
|
2023-10-20 10:08:18 +00:00
|
|
|
gsize width,
|
|
|
|
gsize height,
|
|
|
|
const GdkDmabuf *src,
|
|
|
|
GError **error);
|
2023-10-21 20:31:10 +00:00
|
|
|
|
|
|
|
gboolean gdk_dmabuf_is_disjoint (const GdkDmabuf *dmabuf);
|
2023-10-21 19:23:11 +00:00
|
|
|
|
2023-11-23 01:00:30 +00:00
|
|
|
gboolean gdk_dmabuf_get_memory_format (guint32 fourcc,
|
|
|
|
gboolean premultiplied,
|
|
|
|
GdkMemoryFormat *out_format);
|
2023-11-11 22:56:01 +00:00
|
|
|
|
2023-10-15 03:21:23 +00:00
|
|
|
#endif
|