[vlc-commits] Added HasExtension() to search for an extension in opengl.
Laurent Aimar
git at videolan.org
Thu Jun 2 19:15:32 CEST 2011
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Jun 2 19:00:37 2011 +0200| [e87072e0504d9aa52a8573f7cd1a79878d948f21] | committer: Laurent Aimar
Added HasExtension() to search for an extension in opengl.
The code is based on CheckAPI from egl.c
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e87072e0504d9aa52a8573f7cd1a79878d948f21
---
modules/video_output/opengl.h | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/modules/video_output/opengl.h b/modules/video_output/opengl.h
index 0704edb..7a118df 100644
--- a/modules/video_output/opengl.h
+++ b/modules/video_output/opengl.h
@@ -56,6 +56,19 @@
# endif
#endif
+static inline bool HasExtension(const char *apis, const char *api)
+{
+ size_t apilen = strlen(api);
+ while (apis) {
+ while (*apis == ' ')
+ apis++;
+ if (!strncmp(apis, api, apilen) && memchr(" ", apis[apilen], 2))
+ return true;
+ apis = strchr(apis, ' ');
+ }
+ return false;
+}
+
typedef struct vout_display_opengl_t vout_display_opengl_t;
vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
More information about the vlc-commits
mailing list