From e4ae7d9879b3ee61527e771e4605a234cb37b54d Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Sat, 22 Dec 2018 18:07:35 +0100 Subject: [PATCH] libs: window: remove custom ref() and unref() Use gst_object_ref() and gst_object_unref() instead. --- gst-libs/gst/vaapi/gstvaapiwindow.c | 29 +---------------------------- gst-libs/gst/vaapi/gstvaapiwindow.h | 6 ------ gst-libs/gst/vaapi/gstvaapiwindow_glx.c | 4 ++-- tests/test-decode.c | 2 +- tests/test-filter.c | 2 +- tests/test-subpicture.c | 2 +- tests/test-textures.c | 2 +- tests/test-windows.c | 8 ++++---- 8 files changed, 11 insertions(+), 44 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.c b/gst-libs/gst/vaapi/gstvaapiwindow.c index fdf650f..ad686f0 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow.c @@ -258,7 +258,7 @@ gst_vaapi_window_new_internal (GType type, GstVaapiDisplay * display, /* ERRORS */ error: { - gst_vaapi_window_unref (window); + gst_object_unref (window); return NULL; } } @@ -332,33 +332,6 @@ gst_vaapi_window_new (GstVaapiDisplay * display, guint width, guint height) } /** - * gst_vaapi_window_ref: - * @window: a #GstVaapiWindow - * - * Atomically increases the reference count of the given @window by one. - * - * Returns: The same @window argument - */ -GstVaapiWindow * -gst_vaapi_window_ref (GstVaapiWindow * window) -{ - return (GstVaapiWindow *) gst_object_ref (window); -} - -/** - * gst_vaapi_window_unref: - * @window: a #GstVaapiWindow - * - * Atomically decreases the reference count of the @window by one. If - * the reference count reaches zero, the window will be free'd. - */ -void -gst_vaapi_window_unref (GstVaapiWindow * window) -{ - gst_object_unref (window); -} - -/** * gst_vaapi_window_replace: * @old_window_ptr: a pointer to a #GstVaapiWindow * @new_window: a #GstVaapiWindow diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.h b/gst-libs/gst/vaapi/gstvaapiwindow.h index 040db6c..0796d20 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow.h @@ -48,12 +48,6 @@ gst_vaapi_window_get_type (void) G_GNUC_CONST; GstVaapiWindow * gst_vaapi_window_new (GstVaapiDisplay * display, guint width, guint height); -GstVaapiWindow * -gst_vaapi_window_ref (GstVaapiWindow * window); - -void -gst_vaapi_window_unref (GstVaapiWindow * window); - void gst_vaapi_window_replace (GstVaapiWindow ** old_window_ptr, GstVaapiWindow * new_window); diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_glx.c b/gst-libs/gst/vaapi/gstvaapiwindow_glx.c index fe823b9..d2003df 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_glx.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_glx.c @@ -353,7 +353,7 @@ gst_vaapi_window_glx_new (GstVaapiDisplay * display, guint width, guint height) /* ERRORS */ error: { - gst_vaapi_window_unref (window); + gst_object_unref (window); return NULL; } } @@ -390,7 +390,7 @@ gst_vaapi_window_glx_new_with_xid (GstVaapiDisplay * display, Window xid) /* ERRORS */ error: { - gst_vaapi_window_unref (window); + gst_object_unref (window); return NULL; } } diff --git a/tests/test-decode.c b/tests/test-decode.c index 81bab85..ef16aa1 100644 --- a/tests/test-decode.c +++ b/tests/test-decode.c @@ -134,7 +134,7 @@ main (int argc, char *argv[]) gst_vaapi_pixmap_unref (pixmap); gst_vaapi_surface_proxy_unref (proxy); gst_object_unref (decoder); - gst_vaapi_window_unref (window); + gst_object_unref (window); gst_object_unref (display); gst_object_unref (display2); g_free (g_codec_str); diff --git a/tests/test-filter.c b/tests/test-filter.c index 8e6b208..ab57775 100644 --- a/tests/test-filter.c +++ b/tests/test-filter.c @@ -443,7 +443,7 @@ main (int argc, char *argv[]) gst_object_unref (filter); gst_vaapi_object_unref (dst_surface); gst_vaapi_object_unref (src_surface); - gst_vaapi_window_unref (window); + gst_object_unref (window); gst_object_unref (display); video_output_exit (); g_free (g_src_format_str); diff --git a/tests/test-subpicture.c b/tests/test-subpicture.c index b193e10..ee00056 100644 --- a/tests/test-subpicture.c +++ b/tests/test-subpicture.c @@ -164,7 +164,7 @@ main (int argc, char *argv[]) gst_video_overlay_composition_unref (compo); gst_vaapi_surface_proxy_unref (proxy); gst_object_unref (decoder); - gst_vaapi_window_unref (window); + gst_object_unref (window); gst_object_unref (display); g_free (g_codec_str); video_output_exit (); diff --git a/tests/test-textures.c b/tests/test-textures.c index 97c82df..46e2b91 100644 --- a/tests/test-textures.c +++ b/tests/test-textures.c @@ -172,7 +172,7 @@ main (int argc, char *argv[]) gst_vaapi_texture_unref (textures[1]); glDeleteTextures (1, &texture_id); - gst_vaapi_window_unref (window); + gst_object_unref (window); gst_object_unref (display); gst_deinit (); return 0; diff --git a/tests/test-windows.c b/tests/test-windows.c index 28b2683..4985e35 100644 --- a/tests/test-windows.c +++ b/tests/test-windows.c @@ -131,7 +131,7 @@ main (int argc, char *argv[]) g_error ("could not render surface"); pause (); - gst_vaapi_window_unref (window); + gst_object_unref (window); } gst_vaapi_object_unref (surface); @@ -161,7 +161,7 @@ main (int argc, char *argv[]) g_error ("could not render surface"); pause (); - gst_vaapi_window_unref (window); + gst_object_unref (window); } g_print ("#\n"); @@ -194,7 +194,7 @@ main (int argc, char *argv[]) g_error ("could not render surface"); pause (); - gst_vaapi_window_unref (window); + gst_object_unref (window); XUnmapWindow (dpy, win); XDestroyWindow (dpy, win); } @@ -226,7 +226,7 @@ main (int argc, char *argv[]) g_error ("could not render surface"); pause (); - gst_vaapi_window_unref (window); + gst_object_unref (window); } gst_vaapi_object_unref (surface); -- 2.7.4