GNOME Bugzilla – Bug 754786
vtdec: fails on OSX with GL3 context
Last modified: 2015-12-18 09:11:34 UTC
I was running some tests with vtdec on OSX, and it just displayed flashing solid colour frames. It works with GST_GL_API=opengl GST_GL_API=opengl gst-launch-1.0 rtspsrc location=rtsp://192.168.11.21:8554/test name=r ! queue ! decodebin ! glimagesink r. ! queue ! fakesink -v 2>&1 |less I should also note, some test streams vtdec fails to initialise entirely, so this test was using a 720p file
It seems like there's some slight incompatibility between gstgl, multiple contexts, CAOpenGLLayer with GL3 and vtdec. Running the vtdec ! glimagesink pipeline through a GL tracer for both opengl and opengl3 reveals some interesting things. opengl - Uses GL_ARB_fragment_program to convert the vtdec provided buffer into RGBA. - Invokes a call to CGLTexImageIOSurface2D with a width argument of 160. - GL_APPLE_ycbcr_422 GL extension exists. - GL_APPLE_rgb_422 GL extension exists. opengl3 - Uses a number of regular shaders depending on the source format. - Invokes a call to CGLTexImageIOSurface2D with a width argument of 320 (may be a problem). - There's a GL Invalid Enum Error due to a call to glGetIntegerv(GL_MAP_COLOR, ...) - GL_APPLE_ycbcr_422 GL extension does not exist (may be a problem). - GL_APPLE_rgb_422 GL extension exists. - Running in a GL tracer segfaults Effectively the code paths used for opengl vs opengl3 are very different in terms of vtdec converting to a RGBA texture. I tried to create another conversion shader for these differences but have not been successful. Proposal, for the release, disable the GL path for GL3.
You mean in vtdec? Sounds like a good plan for the release, we should keep this bug open as a blocker for the next release though.
Created attachment 311605 [details] [review] vtdec: don't support opengl output for opengl3 contexts
Comment on attachment 311605 [details] [review] vtdec: don't support opengl output for opengl3 contexts Please merge and open another bug for fixing it with GL3. But only if this also works inside decodebin/playbin :) Does it?
Apparently it doesn't work with playbin. The need-context/have-context messages don't propagate from glimagesinkbin into playsink or playbin at all.
So we have two options then for the release: 1) disable the texture stuff in vtdec completely, 2) disable GL3 support on OSX for libgstgl. Choose one :)
We probably want an intersection of those both options. Disable the texture stuff in vtdec on OSX.
Good for me, can you push a change for that?
commit f02425c4afcd85260a1b387aeddf863774257917 Author: Matthew Waters <matthew@centricular.com> Date: Fri Sep 18 21:14:46 2015 +1000 vtdec: disable the texture cache on OSX This a workaround until the incompatibility with CVOpenGLTextureCache and opengl3 contexts is fixed. https://bugzilla.gnome.org/show_bug.cgi?id=754786
commit 9981cd83271f142680bda3959c7836adea36e032 Author: Alessandro Decina <alessandro.d@gmail.com> Date: Mon Dec 14 16:10:01 2015 +1100 applemedia: vtdec: remove the internal GstGLColorConvert It was added back in the day to make texture sharing work by default with glimagesink inside playbin. These days glimagesink accepts (and converts) YUV internally so it's no longer needed. commit 07bf3796aa69f625d1503ab4a3cd013df832fa72 Author: Alessandro Decina <alessandro.d@gmail.com> Date: Mon Dec 14 14:23:20 2015 +1100 applemedia: vtdec: decouple outputting textures from outputting RGBA We're going to be able to output NV12 textures soon. commit 8ae003326157438c12c45589e050c5f446723f61 Author: Alessandro Decina <alessandro.d@gmail.com> Date: Fri Dec 11 13:20:05 2015 +1100 applemedia: vtdec: switch to IOSurface on Mac Switch to using IOSurface instead of CVOpenGLTextureCache on OSX. The latter can't be used anymore to do YUV => RGB with opengl3 on El Capitan as GL_YCBCR_422_APPLE has been removed from the opengl3 driver. Also switch to NV12 from UYVY, which was the only YUV format supported by CVOpenGLTextureCache.