[mutter] egl: Add vfuncs needed for client EGLStream surfaces
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] egl: Add vfuncs needed for client EGLStream surfaces
- Date: Thu, 17 Nov 2016 16:09:22 +0000 (UTC)
commit f5bdf75f70272bd1bce632ecf15c8f5157343bea
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Oct 20 16:44:18 2016 +0800
egl: Add vfuncs needed for client EGLStream surfaces
https://bugzilla.gnome.org/show_bug.cgi?id=773629
src/backends/meta-egl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
src/backends/meta-egl.h | 10 ++++++++++
2 files changed, 57 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-egl.c b/src/backends/meta-egl.c
index e61790a..b1e8b66 100644
--- a/src/backends/meta-egl.c
+++ b/src/backends/meta-egl.c
@@ -63,6 +63,10 @@ struct _MetaEgl
PFNEGLSTREAMCONSUMERACQUIREATTRIBEXTPROC eglStreamConsumerAcquireAttribEXT;
PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC eglStreamConsumerGLTextureExternalKHR;
+
+ PFNEGLSTREAMCONSUMERACQUIREKHRPROC eglStreamConsumerAcquireKHR;
+
+ PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC eglCreateStreamFromFileDescriptorKHR;
};
G_DEFINE_TYPE (MetaEgl, meta_egl, G_TYPE_OBJECT)
@@ -655,6 +659,45 @@ meta_egl_stream_consumer_gl_texture_external (MetaEgl *egl,
return TRUE;
}
+gboolean
+meta_egl_stream_consumer_acquire (MetaEgl *egl,
+ EGLDisplay display,
+ EGLStreamKHR stream,
+ GError **error)
+{
+ if (!is_egl_proc_valid (egl->eglStreamConsumerAcquireKHR, error))
+ return FALSE;
+
+ if (!egl->eglStreamConsumerAcquireKHR (display, stream))
+ {
+ set_egl_error (error);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+EGLStreamKHR
+meta_egl_create_stream_from_file_descriptor (MetaEgl *egl,
+ EGLDisplay display,
+ EGLNativeFileDescriptorKHR file_descriptor,
+ GError **error)
+{
+ EGLStreamKHR stream;
+
+ if (!is_egl_proc_valid (egl->eglCreateStreamFromFileDescriptorKHR, error))
+ return EGL_NO_STREAM_KHR;
+
+ stream = egl->eglCreateStreamFromFileDescriptorKHR (display, file_descriptor);
+ if (stream == EGL_NO_STREAM_KHR)
+ {
+ set_egl_error (error);
+ return EGL_NO_STREAM_KHR;
+ }
+
+ return stream;
+}
+
#define GET_EGL_PROC_ADDR(proc) \
egl->proc = (void *) eglGetProcAddress (#proc);
@@ -694,6 +737,10 @@ meta_egl_constructed (GObject *object)
GET_EGL_PROC_ADDR (eglStreamConsumerAcquireAttribEXT);
GET_EGL_PROC_ADDR (eglStreamConsumerGLTextureExternalKHR);
+
+ GET_EGL_PROC_ADDR (eglStreamConsumerAcquireKHR);
+
+ GET_EGL_PROC_ADDR (eglCreateStreamFromFileDescriptorKHR);
}
#undef GET_EGL_PROC_ADDR
diff --git a/src/backends/meta-egl.h b/src/backends/meta-egl.h
index 191955c..b7bdf32 100644
--- a/src/backends/meta-egl.h
+++ b/src/backends/meta-egl.h
@@ -148,9 +148,19 @@ gboolean meta_egl_stream_consumer_acquire_attrib (MetaEgl *egl,
EGLAttrib *attrib_list,
GError **error);
+gboolean meta_egl_stream_consumer_acquire (MetaEgl *egl,
+ EGLDisplay display,
+ EGLStreamKHR stream,
+ GError **error);
+
gboolean meta_egl_stream_consumer_gl_texture_external (MetaEgl *egl,
EGLDisplay display,
EGLStreamKHR stream,
GError **error);
+EGLStreamKHR meta_egl_create_stream_from_file_descriptor (MetaEgl *egl,
+ EGLDisplay display,
+ EGLNativeFileDescriptorKHR file_descriptor,
+ GError **error);
+
#endif /* META_EGL_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]