mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 10:40:34 +00:00
plugins: fix reference leaks of VA display objects.
Fix GstElement::set_context() implementation for all plug-in elements to avoid leaking an extra reference to the VA display, thus preventing correct cleanup of VA resources in GStreamer 1.2 builds.
This commit is contained in:
parent
16751205a2
commit
7a33165436
4 changed files with 4 additions and 0 deletions
|
@ -591,6 +591,7 @@ gst_vaapidecode_set_context(GstElement *element, GstContext *context)
|
||||||
if (gst_vaapi_video_context_get_display(context, &display)) {
|
if (gst_vaapi_video_context_get_display(context, &display)) {
|
||||||
GST_INFO_OBJECT(element, "set display %p", display);
|
GST_INFO_OBJECT(element, "set display %p", display);
|
||||||
gst_vaapi_display_replace(&decode->display, display);
|
gst_vaapi_display_replace(&decode->display, display);
|
||||||
|
gst_vaapi_display_unref(display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -71,6 +71,7 @@ gst_vaapiencode_set_context (GstElement * element, GstContext * context)
|
||||||
if (gst_vaapi_video_context_get_display (context, &display)) {
|
if (gst_vaapi_video_context_get_display (context, &display)) {
|
||||||
GST_INFO_OBJECT (element, "set display %p", display);
|
GST_INFO_OBJECT (element, "set display %p", display);
|
||||||
gst_vaapi_display_replace (&encode->display, display);
|
gst_vaapi_display_replace (&encode->display, display);
|
||||||
|
gst_vaapi_display_unref (display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -264,6 +264,7 @@ gst_vaapipostproc_set_context(GstElement *element, GstContext *context)
|
||||||
if (gst_vaapi_video_context_get_display(context, &display)) {
|
if (gst_vaapi_video_context_get_display(context, &display)) {
|
||||||
GST_INFO_OBJECT(element, "set display %p", display);
|
GST_INFO_OBJECT(element, "set display %p", display);
|
||||||
gst_vaapi_display_replace(&postproc->display, display);
|
gst_vaapi_display_replace(&postproc->display, display);
|
||||||
|
gst_vaapi_display_unref(display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1351,6 +1351,7 @@ gst_vaapisink_set_context(GstElement *element, GstContext *context)
|
||||||
if (gst_vaapi_video_context_get_display(context, &display)) {
|
if (gst_vaapi_video_context_get_display(context, &display)) {
|
||||||
GST_INFO_OBJECT(element, "set display %p", display);
|
GST_INFO_OBJECT(element, "set display %p", display);
|
||||||
gst_vaapi_display_replace(&sink->display, display);
|
gst_vaapi_display_replace(&sink->display, display);
|
||||||
|
gst_vaapi_display_unref(display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue