gl/cocoa: Store a weak reference to the `GstGLWindow` instead of the `GstGLContext`
authorSebastian Dröge <sebastian@centricular.com>
Sat, 14 Jan 2023 10:46:39 +0000 (16:16 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Tue, 17 Jan 2023 17:05:29 +0000 (22:35 +0530)
commit086c8da446348d0f0a8c0a2c5398840e58771f27
tree38a95997ff8b94fdf9d1dbe618d27730bea92a45
parenta9ec35b1ca3193820f434fd17a71207cde19de2b
gl/cocoa: Store a weak reference to the `GstGLWindow` instead of the `GstGLContext`

We can't rely on the `GstGLContext` to stay alive and need to keep track
of it. For that we keep track of the `GstGLWindow` in a weak reference
to avoid a reference cycle, and get the corresponding `GstGLContext`
whenever needed.

With contributions from Nirbheek Chauhan.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1697

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3729>
subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcaopengllayer.h
subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcaopengllayer.m
subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m