[853/906] display: remove _{set,get}_context
authorMatthew Waters <ystreet00@gmail.com>
Thu, 24 Oct 2013 11:30:45 +0000 (22:30 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:32 +0000 (19:31 +0000)
A GstGLDisplay doesn't need a GstGLContext and its use
was cause a reference cycle

gst-libs/gst/gl/gstgldisplay.c
gst-libs/gst/gl/gstgldisplay.h
gst-libs/gst/gl/gstglmixer.c
tests/check/libs/gstglcontext.c
tests/check/libs/gstglmemory.c

index 198e766..7a0b161 100644 (file)
@@ -104,46 +104,6 @@ gst_gl_display_get_gl_api (GstGLDisplay * display)
 }
 
 void
-gst_gl_display_set_context (GstGLDisplay * display, GstGLContext * context)
-{
-  g_return_if_fail (GST_IS_GL_DISPLAY (display));
-  g_return_if_fail (GST_GL_IS_CONTEXT (context));
-
-  gst_gl_display_lock (display);
-
-  if (display->context)
-    gst_object_unref (display->context);
-
-  display->context = gst_object_ref (context);
-
-  gst_gl_display_unlock (display);
-}
-
-GstGLContext *
-gst_gl_display_get_context (GstGLDisplay * display)
-{
-  GstGLContext *context;
-
-  g_return_val_if_fail (GST_IS_GL_DISPLAY (display), NULL);
-
-  gst_gl_display_lock (display);
-
-  context = display->context ? gst_object_ref (display->context) : NULL;
-
-  gst_gl_display_unlock (display);
-
-  return context;
-}
-
-GstGLContext *
-gst_gl_display_get_context_unlocked (GstGLDisplay * display)
-{
-  g_return_val_if_fail (GST_IS_GL_DISPLAY (display), NULL);
-
-  return display->context ? gst_object_ref (display->context) : NULL;
-}
-
-void
 gst_context_set_gl_display (GstContext * context, GstGLDisplay * display)
 {
   GstStructure *s;
index 46f2228..9fb22f5 100644 (file)
@@ -68,9 +68,6 @@ GstGLDisplay *gst_gl_display_new (void);
 
 GstGLAPI       gst_gl_display_get_gl_api             (GstGLDisplay * display);
 gpointer       gst_gl_display_get_gl_vtable          (GstGLDisplay * display);
-void           gst_gl_display_set_context             (GstGLDisplay * display, GstGLContext * context);
-GstGLContext * gst_gl_display_get_context             (GstGLDisplay * display);
-GstGLContext * gst_gl_display_get_context_unlocked    (GstGLDisplay * display);
 
 #define GST_GL_DISPLAY_CONTEXT_TYPE "gst.gl.GLDisplay"
 void     gst_context_set_gl_display (GstContext * context, GstGLDisplay * display);
index 92678fb..453f5a3 100644 (file)
@@ -965,7 +965,6 @@ gst_gl_mixer_activate (GstGLMixer * mix, gboolean activate)
 
       GST_INFO ("Creating GstGLDisplay");
       mix->context = gst_gl_context_new (mix->display);
-      gst_gl_display_set_context (mix->display, mix->context);
 
       if (!gst_gl_context_create (mix->context, 0, &error)) {
         GST_ELEMENT_ERROR (mix, RESOURCE, NOT_FOUND,
index bb2d2d2..aa58c69 100644 (file)
@@ -233,7 +233,6 @@ GST_START_TEST (test_share)
 
   display = gst_gl_display_new ();
   context = gst_gl_context_new (display);
-  gst_gl_display_set_context (display, context);
 
   window = gst_gl_window_new (display);
   gst_gl_context_set_window (context, window);
index 985129a..ae42ada 100644 (file)
@@ -38,7 +38,6 @@ setup (void)
 {
   display = gst_gl_display_new ();
   context = gst_gl_context_new (display);
-  gst_gl_display_set_context (display, context);
   gst_gl_context_create (context, 0, NULL);
   gst_gl_memory_init ();
 }