gl: add a method to check whether DMA modifier is supported in EGL

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3524>
This commit is contained in:
He Junyan 2023-05-19 16:20:56 +08:00 committed by GStreamer Marge Bot
parent 05cffc19dd
commit 22bb3107d7
2 changed files with 22 additions and 0 deletions

View file

@ -1826,3 +1826,23 @@ beach:
#endif
return FALSE;
}
/**
* gst_gl_context_egl_supports_modifier: (skip)
* @context: an EGL #GStGLContext
*
* Returns: %TRUE if the @context supports the modifiers.
*
* Since: 1.24
*/
gboolean
gst_gl_context_egl_supports_modifier (GstGLContext * context)
{
#if GST_GL_HAVE_DMABUF
g_return_val_if_fail (GST_IS_GL_CONTEXT_EGL (context), FALSE);
return gst_gl_context_egl_fetch_dma_formats (context);
#else
return FALSE;
#endif
}

View file

@ -113,6 +113,8 @@ G_GNUC_INTERNAL
gboolean gst_gl_context_egl_get_format_modifiers (GstGLContext * context,
gint fourcc,
const GArray ** modifiers);
G_GNUC_INTERNAL
gboolean gst_gl_context_egl_supports_modifier (GstGLContext * context);
G_END_DECLS
#endif /* __GST_GL_CONTEXT_EGL_H__ */