[vlc-devel] [PATCH 5/5] doc: QtGl: add details on GetProcAddress impl
Alexandre Janniaux
ajanni at videolabs.io
Tue Nov 10 10:22:01 CET 2020
Hi,
I just realised the document I sent was incomplete, it was
missing this part:
diff --git a/doc/libvlc/QtGL/qtvlcwidget.cpp b/doc/libvlc/QtGL/qtvlcwidget.cpp
index f5d9adcd3c..134ad06601 100644
--- a/doc/libvlc/QtGL/qtvlcwidget.cpp
+++ b/doc/libvlc/QtGL/qtvlcwidget.cpp
@@ -157,7 +157,10 @@ public:
* mentioned in the API. Cf QPlatformOpenGLContext::getProcAddress.
* Thus, we don't need to wrap the function symbols here, but it might
* fail to work (not crash though) on exotic platforms since Qt doesn't
- * commit to this behaviour. */
+ * commit to this behaviour. A way to handle this in a more stable way
+ * would be to store the mContext->functions() table in a thread local
+ * variable, and wrap every call to OpenGL in a function using this
+ * thread local state to call the correct variant. */
return reinterpret_cast<void*>(that->mContext->getProcAddress(current));
}
Regards,
--
Alexandre Janniaux
Videolabs
On Mon, Nov 09, 2020 at 06:15:03PM +0100, Alexandre Janniaux wrote:
> ---
> doc/libvlc/QtGL/qtvlcwidget.cpp | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/doc/libvlc/QtGL/qtvlcwidget.cpp b/doc/libvlc/QtGL/qtvlcwidget.cpp
> index e33f6a6c08..f5d9adcd3c 100644
> --- a/doc/libvlc/QtGL/qtvlcwidget.cpp
> +++ b/doc/libvlc/QtGL/qtvlcwidget.cpp
> @@ -153,6 +153,11 @@ public:
> static void* get_proc_address(void* data, const char* current)
> {
> VLCVideo* that = static_cast<VLCVideo*>(data);
> + /* Qt usual expects core symbols to be queryable, even though it's not
> + * mentioned in the API. Cf QPlatformOpenGLContext::getProcAddress.
> + * Thus, we don't need to wrap the function symbols here, but it might
> + * fail to work (not crash though) on exotic platforms since Qt doesn't
> + * commit to this behaviour. */
> return reinterpret_cast<void*>(that->mContext->getProcAddress(current));
> }
>
> --
> 2.29.2
>
More information about the vlc-devel
mailing list