gl: window-gbm: Remove unneeded extra function
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Sun, 2 Dec 2018 01:30:16 +0000 (20:30 -0500)
committerNicolas Dufresne <nicolas@ndufresne.ca>
Wed, 5 Dec 2018 13:41:11 +0000 (13:41 +0000)
The cleanup function was only called in _close() which was only
calling that function. This indirection didn't make much sense.

gst-libs/gst/gl/gbm/gstglwindow_gbm_egl.c

index b0eb258d639a49a0e3775a4fea62c4dc20a5efd5..1678fa28a42149a3e31a5fa363d38124ce9b09de 100644 (file)
@@ -50,8 +50,6 @@ static void gst_gl_window_gbm_egl_close (GstGLWindow * window);
 static void gst_gl_window_gbm_egl_draw (GstGLWindow * window);
 
 static gboolean gst_gl_window_gbm_init_surface (GstGLWindowGBMEGL * window_egl);
-static void gst_gl_window_gbm_egl_cleanup (GstGLWindowGBMEGL * window_egl);
-
 
 
 static void
@@ -112,7 +110,15 @@ gst_gl_window_gbm_egl_close (GstGLWindow * window)
 {
   GstGLWindowGBMEGL *window_egl = GST_GL_WINDOW_GBM_EGL (window);
 
-  gst_gl_window_gbm_egl_cleanup (window_egl);
+  if (window_egl->gbm_surf != NULL) {
+    if (window_egl->current_bo != NULL) {
+      gbm_surface_release_buffer (window_egl->gbm_surf, window_egl->current_bo);
+      window_egl->current_bo = NULL;
+    }
+
+    gbm_surface_destroy (window_egl->gbm_surf);
+    window_egl->gbm_surf = NULL;
+  }
 
   GST_GL_WINDOW_CLASS (gst_gl_window_gbm_egl_parent_class)->close (window);
 }
@@ -344,21 +350,6 @@ cleanup:
 }
 
 
-static void
-gst_gl_window_gbm_egl_cleanup (GstGLWindowGBMEGL * window_egl)
-{
-  if (window_egl->gbm_surf != NULL) {
-    if (window_egl->current_bo != NULL) {
-      gbm_surface_release_buffer (window_egl->gbm_surf, window_egl->current_bo);
-      window_egl->current_bo = NULL;
-    }
-
-    gbm_surface_destroy (window_egl->gbm_surf);
-    window_egl->gbm_surf = NULL;
-  }
-}
-
-
 /* Must be called in the gl thread */
 GstGLWindowGBMEGL *
 gst_gl_window_gbm_egl_new (GstGLDisplay * display)