mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
libs: display: remove gst_vaapi_display_unref()
Use gst_object_unref() instead. https://bugzilla.gnome.org/show_bug.cgi?id=796470
This commit is contained in:
parent
b1d8c68921
commit
fb1c4c52cc
17 changed files with 32 additions and 48 deletions
|
@ -1208,19 +1208,6 @@ gst_vaapi_display_ref (GstVaapiDisplay * display)
|
||||||
return gst_object_ref (display);
|
return gst_object_ref (display);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gst_vaapi_display_unref:
|
|
||||||
* @display: a #GstVaapiDisplay
|
|
||||||
*
|
|
||||||
* Atomically decreases the reference count of the @display by one. If
|
|
||||||
* the reference count reaches zero, the display will be free'd.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
gst_vaapi_display_unref (GstVaapiDisplay * display)
|
|
||||||
{
|
|
||||||
gst_object_unref (display);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_vaapi_display_replace:
|
* gst_vaapi_display_replace:
|
||||||
* @old_display_ptr: a pointer to a #GstVaapiDisplay
|
* @old_display_ptr: a pointer to a #GstVaapiDisplay
|
||||||
|
|
|
@ -154,9 +154,6 @@ gst_vaapi_display_new_with_display (VADisplay va_display);
|
||||||
GstVaapiDisplay *
|
GstVaapiDisplay *
|
||||||
gst_vaapi_display_ref (GstVaapiDisplay * display);
|
gst_vaapi_display_ref (GstVaapiDisplay * display);
|
||||||
|
|
||||||
void
|
|
||||||
gst_vaapi_display_unref (GstVaapiDisplay * display);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_vaapi_display_replace (GstVaapiDisplay ** old_display_ptr,
|
gst_vaapi_display_replace (GstVaapiDisplay ** old_display_ptr,
|
||||||
GstVaapiDisplay * new_display);
|
GstVaapiDisplay * new_display);
|
||||||
|
@ -258,7 +255,7 @@ void
|
||||||
gst_vaapi_display_reset_texture_map (GstVaapiDisplay * display);
|
gst_vaapi_display_reset_texture_map (GstVaapiDisplay * display);
|
||||||
|
|
||||||
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDisplay, gst_vaapi_display_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDisplay, gst_object_unref)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
|
@ -244,7 +244,7 @@ plugin_init (GstPlugin * plugin)
|
||||||
gst_vaapiencode_register (plugin, display);
|
gst_vaapiencode_register (plugin, display);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ error_no_display:
|
||||||
}
|
}
|
||||||
unsupported_driver:
|
unsupported_driver:
|
||||||
{
|
{
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
return TRUE; /* return TRUE to avoid get blacklisted */
|
return TRUE; /* return TRUE to avoid get blacklisted */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ gst_vaapidecode_start (GstVideoDecoder * vdec)
|
||||||
success =
|
success =
|
||||||
gst_vaapi_plugin_base_ensure_display (GST_VAAPI_PLUGIN_BASE (decode));
|
gst_vaapi_plugin_base_ensure_display (GST_VAAPI_PLUGIN_BASE (decode));
|
||||||
if (old_display)
|
if (old_display)
|
||||||
gst_vaapi_display_unref (old_display);
|
gst_object_unref (old_display);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,7 +530,7 @@ gst_vaapiencode_open (GstVideoEncoder * venc)
|
||||||
GST_VAAPI_PLUGIN_BASE_DISPLAY (encode) = NULL;
|
GST_VAAPI_PLUGIN_BASE_DISPLAY (encode) = NULL;
|
||||||
success = ensure_display (encode);
|
success = ensure_display (encode);
|
||||||
if (old_display)
|
if (old_display)
|
||||||
gst_vaapi_display_unref (old_display);
|
gst_object_unref (old_display);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ plugin_set_display (GstVaapiPluginBase * plugin, GstVaapiDisplay * display)
|
||||||
plugin->display_type = gst_vaapi_display_get_display_type (display);
|
plugin->display_type = gst_vaapi_display_get_display_type (display);
|
||||||
gst_vaapi_plugin_base_set_display_name (plugin, display_name);
|
gst_vaapi_plugin_base_set_display_name (plugin, display_name);
|
||||||
}
|
}
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1313,7 +1313,7 @@ bail:
|
||||||
g_array_unref (out_formats);
|
g_array_unref (out_formats);
|
||||||
if (surface)
|
if (surface)
|
||||||
gst_vaapi_object_unref (surface);
|
gst_vaapi_object_unref (surface);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,7 @@ gst_vaapi_create_display_from_egl (GstGLDisplay * gl_display,
|
||||||
gst_vaapi_create_display_from_handle (display_type, native_display);
|
gst_vaapi_create_display_from_handle (display_type, native_display);
|
||||||
if (wrapped_display) {
|
if (wrapped_display) {
|
||||||
display = gst_vaapi_display_egl_new (wrapped_display, gles_version);
|
display = gst_vaapi_display_egl_new (wrapped_display, gles_version);
|
||||||
gst_vaapi_display_unref (wrapped_display);
|
gst_object_unref (wrapped_display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ gst_vaapi_ensure_display (GstElement * element, GstVaapiDisplayType type)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
gst_vaapi_video_context_propagate (element, display);
|
gst_vaapi_video_context_propagate (element, display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -887,7 +887,7 @@ gst_video_info_force_nv12_if_encoded (GstVideoInfo * vinfo)
|
||||||
* supported features.
|
* supported features.
|
||||||
*
|
*
|
||||||
* Returns: a new #GstVaapiDisplay instances. Free with
|
* Returns: a new #GstVaapiDisplay instances. Free with
|
||||||
* gst_vaapi_display_unref () after use. Or %NULL if no VA display is
|
* gst_object_unref () after use. Or %NULL if no VA display is
|
||||||
* available.
|
* available.
|
||||||
**/
|
**/
|
||||||
GstVaapiDisplay *
|
GstVaapiDisplay *
|
||||||
|
|
|
@ -182,7 +182,7 @@ video_output_create_display (const gchar * display_name)
|
||||||
if (display) {
|
if (display) {
|
||||||
if (gst_vaapi_display_get_display (display))
|
if (gst_vaapi_display_get_display (display))
|
||||||
break;
|
break;
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
display = NULL;
|
display = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ video_output_create_display (const gchar * display_name)
|
||||||
egl_display = NULL;
|
egl_display = NULL;
|
||||||
g_print ("error: unsupported EGL renderering mode\n");
|
g_print ("error: unsupported EGL renderering mode\n");
|
||||||
#endif
|
#endif
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
if (!egl_display)
|
if (!egl_display)
|
||||||
return NULL;
|
return NULL;
|
||||||
display = egl_display;
|
display = egl_display;
|
||||||
|
|
|
@ -302,7 +302,7 @@ app_free (App * app)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app->display)
|
if (app->display)
|
||||||
gst_vaapi_display_unref (app->display);
|
gst_object_unref (app->display);
|
||||||
|
|
||||||
if (app->output_file)
|
if (app->output_file)
|
||||||
fclose (app->output_file);
|
fclose (app->output_file);
|
||||||
|
|
|
@ -136,8 +136,8 @@ main (int argc, char *argv[])
|
||||||
gst_vaapi_surface_proxy_unref (proxy);
|
gst_vaapi_surface_proxy_unref (proxy);
|
||||||
gst_vaapi_decoder_unref (decoder);
|
gst_vaapi_decoder_unref (decoder);
|
||||||
gst_vaapi_window_unref (window);
|
gst_vaapi_window_unref (window);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
gst_vaapi_display_unref (display2);
|
gst_object_unref (display2);
|
||||||
g_free (g_codec_str);
|
g_free (g_codec_str);
|
||||||
video_output_exit ();
|
video_output_exit ();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -222,7 +222,7 @@ main (int argc, char *argv[])
|
||||||
g_error ("could not create Gst/VA display");
|
g_error ("could not create Gst/VA display");
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ main (int argc, char *argv[])
|
||||||
g_error ("could not create Gst/VA display");
|
g_error ("could not create Gst/VA display");
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
close (drm_device);
|
close (drm_device);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
|
@ -267,7 +267,7 @@ main (int argc, char *argv[])
|
||||||
g_error ("could not create Gst/VA display");
|
g_error ("could not create Gst/VA display");
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
close (drm_device);
|
close (drm_device);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
|
@ -299,7 +299,7 @@ main (int argc, char *argv[])
|
||||||
g_error ("could not create Gst/VA display");
|
g_error ("could not create Gst/VA display");
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
XCloseDisplay (x11_display);
|
XCloseDisplay (x11_display);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
|
@ -325,7 +325,7 @@ main (int argc, char *argv[])
|
||||||
g_error ("could not create Gst/VA display");
|
g_error ("could not create Gst/VA display");
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
XCloseDisplay (x11_display);
|
XCloseDisplay (x11_display);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
|
@ -347,7 +347,7 @@ main (int argc, char *argv[])
|
||||||
g_print ("Pixel aspect ratio: %u/%u\n", par_n, par_d);
|
g_print ("Pixel aspect ratio: %u/%u\n", par_n, par_d);
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ main (int argc, char *argv[])
|
||||||
g_error ("could not create Gst/VA display");
|
g_error ("could not create Gst/VA display");
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
XCloseDisplay (x11_display);
|
XCloseDisplay (x11_display);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
|
@ -393,7 +393,7 @@ main (int argc, char *argv[])
|
||||||
g_error ("could not create Gst/VA display");
|
g_error ("could not create Gst/VA display");
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
XCloseDisplay (x11_display);
|
XCloseDisplay (x11_display);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
|
@ -416,7 +416,7 @@ main (int argc, char *argv[])
|
||||||
g_print ("Pixel aspect ratio: %u/%u\n", par_n, par_d);
|
g_print ("Pixel aspect ratio: %u/%u\n", par_n, par_d);
|
||||||
|
|
||||||
dump_info (display);
|
dump_info (display);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
}
|
}
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -346,7 +346,7 @@ app_free (App * app)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app->display)
|
if (app->display)
|
||||||
gst_vaapi_display_unref (app->display);
|
gst_object_unref (app->display);
|
||||||
|
|
||||||
if (app->output_file)
|
if (app->output_file)
|
||||||
fclose (app->output_file);
|
fclose (app->output_file);
|
||||||
|
|
|
@ -444,7 +444,7 @@ main (int argc, char *argv[])
|
||||||
gst_vaapi_object_unref (dst_surface);
|
gst_vaapi_object_unref (dst_surface);
|
||||||
gst_vaapi_object_unref (src_surface);
|
gst_vaapi_object_unref (src_surface);
|
||||||
gst_vaapi_window_unref (window);
|
gst_vaapi_window_unref (window);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
video_output_exit ();
|
video_output_exit ();
|
||||||
g_free (g_src_format_str);
|
g_free (g_src_format_str);
|
||||||
g_free (g_crop_rect_str);
|
g_free (g_crop_rect_str);
|
||||||
|
|
|
@ -166,7 +166,7 @@ main (int argc, char *argv[])
|
||||||
gst_vaapi_surface_proxy_unref (proxy);
|
gst_vaapi_surface_proxy_unref (proxy);
|
||||||
gst_vaapi_decoder_unref (decoder);
|
gst_vaapi_decoder_unref (decoder);
|
||||||
gst_vaapi_window_unref (window);
|
gst_vaapi_window_unref (window);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
g_free (g_codec_str);
|
g_free (g_codec_str);
|
||||||
video_output_exit ();
|
video_output_exit ();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -98,7 +98,7 @@ main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unref in random order to check objects are correctly refcounted */
|
/* Unref in random order to check objects are correctly refcounted */
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
gst_vaapi_video_pool_unref (pool);
|
gst_vaapi_video_pool_unref (pool);
|
||||||
gst_vaapi_object_unref (surface);
|
gst_vaapi_object_unref (surface);
|
||||||
video_output_exit ();
|
video_output_exit ();
|
||||||
|
|
|
@ -173,7 +173,7 @@ main (int argc, char *argv[])
|
||||||
glDeleteTextures (1, &texture_id);
|
glDeleteTextures (1, &texture_id);
|
||||||
|
|
||||||
gst_vaapi_window_unref (window);
|
gst_vaapi_window_unref (window);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
gst_deinit ();
|
gst_deinit ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_vaapi_object_unref (surface);
|
gst_vaapi_object_unref (surface);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_X11
|
#if USE_X11
|
||||||
|
@ -200,7 +200,7 @@ main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_vaapi_object_unref (surface);
|
gst_vaapi_object_unref (surface);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_WAYLAND
|
#if USE_WAYLAND
|
||||||
|
@ -230,7 +230,7 @@ main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_vaapi_object_unref (surface);
|
gst_vaapi_object_unref (surface);
|
||||||
gst_vaapi_display_unref (display);
|
gst_object_unref (display);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_deinit ();
|
gst_deinit ();
|
||||||
|
|
Loading…
Reference in a new issue