After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754786 - vtdec: fails on OSX with GL3 context
vtdec: fails on OSX with GL3 context
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
Other Mac OS
: Normal blocker
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2015-09-09 15:29 UTC by Jan Schmidt
Modified: 2015-12-18 09:11 UTC
See Also:
GNOME target: ---
GNOME version: ---

vtdec: don't support opengl output for opengl3 contexts (5.68 KB, patch)
2015-09-18 06:59 UTC, Matthew Waters (ystreet00)
rejected Details | Review

Description Jan Schmidt 2015-09-09 15:29:07 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:// 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
Comment 1 Matthew Waters (ystreet00) 2015-09-16 07:50:59 UTC
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.

- 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.

- 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.
Comment 2 Sebastian Dröge (slomo) 2015-09-16 07:58:20 UTC
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.
Comment 3 Matthew Waters (ystreet00) 2015-09-18 06:59:51 UTC
Created attachment 311605 [details] [review]
vtdec: don't support opengl output for opengl3 contexts
Comment 4 Sebastian Dröge (slomo) 2015-09-18 07:27:02 UTC
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?
Comment 5 Matthew Waters (ystreet00) 2015-09-18 08:15:34 UTC
Apparently it doesn't work with playbin.

The need-context/have-context messages don't propagate from glimagesinkbin into playsink or playbin at all.
Comment 6 Sebastian Dröge (slomo) 2015-09-18 08:39:30 UTC
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 :)
Comment 7 Matthew Waters (ystreet00) 2015-09-18 11:12:13 UTC
We probably want an intersection of those both options.

Disable the texture stuff in vtdec on OSX.
Comment 8 Sebastian Dröge (slomo) 2015-09-18 11:19:16 UTC
Good for me, can you push a change for that?
Comment 9 Matthew Waters (ystreet00) 2015-09-18 11:32:38 UTC
commit f02425c4afcd85260a1b387aeddf863774257917
Author: Matthew Waters <>
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.
Comment 10 Alessandro Decina 2015-12-18 08:57:48 UTC
commit 9981cd83271f142680bda3959c7836adea36e032
Author: Alessandro Decina <>
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 <>
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 <>
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.