glcontext: track sharedness with a cookie
authorMatthew Waters <matthew@centricular.com>
Wed, 15 Jul 2015 14:37:58 +0000 (00:37 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:05 +0000 (19:32 +0000)
commit78957c45c24ac90cb07a60234eb871e1b33f28f8
tree2ffb77574e48be2609bbfea17944b850bf10243c
parent2df7e0f9de799e29c006214b2c5605330d1bd40d
glcontext: track sharedness with a cookie

The previous approach of traversing the other_context weak ref tree was
1. Less performant
2. Incorrect for context destruction removing a link in the tree

Example of 2:
c1 = context_create (NULL)
c2 = context_create (c1)
c3 = context_create (c2)
context_can_share (c1, c3) == TRUE
context_destroy (c2)
unref (c2)
context_can_share (c1, c3) returns FALSE when it should be TRUE!

This does not remove the restriction that context sharedness can only
be tracked between GstGLContext's.
gst-libs/gst/gl/gstglcontext.c
tests/check/libs/gstglcontext.c