OpenGL context
#1
Hi
I am experimenting with VDPAU/OpenGL interoperability in order to perform some simple video processing using textures and frame buffer objects. However my attempts so far have failed.

I suspect there might be a problem with OpenGL context. Can anyone suggest how I might be able to create a context local to the processing code where there is no need for a window or how I might share the existing context used for the VDPAU output to screen?

Thanks
Reply
#2
Yup glGenTextures is returning zeroes so it's probably because there is no GL context.

Can anybody suggest how I can get access to a GL context from within CVDPAU:Big Grinecode()?

Thanks
Reply
#3
Burnt my head a bit but I managed to generate a GLX pixel buffer and attach an OpenGL context to that, local to the code concerned.
I can now access OpenGL functions OK.
Reply
#4
GL contexts are always attached to a single thread, if you want to do any image processing using OpenGL, I suggest doing it from the render thread.
Reply
#5
That's tricky because I need to access VDPAU video surfaces before they go into the VDPAU video mixer.
I think that is on a different thread.

What parts of the code are covered by the render thread?

Although I did manage to create another OpenGL context for processing VDPAU video surfaces, it's very slow for some reason, dropping frames all over the place. I'm guessing there is no hardware acceleration but I don't know why.
Reply
#6
I have redesigned vdpau and implemented vdpau/opengl interop (NV_vdpau_interop). For initialization vdpau creates its own gl context which shares textures with the main thread. This way vdpau is much less dependent on the render thread. https://github.com/xbmc/xbmc/pull/870
Reply
#7
OK so you have clearly been down this road. Thanks for bringing your repo to my attention.
Should I download a copy of your master branch to test my video processing on?
Reply

Logout Mark Read Team Forum Stats Members Help
OpenGL context0