glcontext: track sharedness with a cookie
authorMatthew Waters <matthew@centricular.com>
Wed, 15 Jul 2015 14:37:58 +0000 (00:37 +1000)
committerMatthew Waters <matthew@centricular.com>
Sat, 18 Jul 2015 05:34:55 +0000 (15:34 +1000)
commitbe9ad5eeb255c68b7ed07c6cb6d64b744c2076c7
treed1b5716f247262a79751408c09480d3b6cff5d99
parentb679cc2238942a77ecf64038aa0a89a83063e287
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