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:
Gwenole Beauchesne 2013-11-29 14:02:52 +01:00
parent 16751205a2
commit 7a33165436
4 changed files with 4 additions and 0 deletions

View file

@ -591,6 +591,7 @@ gst_vaapidecode_set_context(GstElement *element, GstContext *context)
if (gst_vaapi_video_context_get_display(context, &display)) {
GST_INFO_OBJECT(element, "set display %p", display);
gst_vaapi_display_replace(&decode->display, display);
gst_vaapi_display_unref(display);
}
}
#endif

View file

@ -71,6 +71,7 @@ gst_vaapiencode_set_context (GstElement * element, GstContext * context)
if (gst_vaapi_video_context_get_display (context, &display)) {
GST_INFO_OBJECT (element, "set display %p", display);
gst_vaapi_display_replace (&encode->display, display);
gst_vaapi_display_unref (display);
}
}
#else

View file

@ -264,6 +264,7 @@ gst_vaapipostproc_set_context(GstElement *element, GstContext *context)
if (gst_vaapi_video_context_get_display(context, &display)) {
GST_INFO_OBJECT(element, "set display %p", display);
gst_vaapi_display_replace(&postproc->display, display);
gst_vaapi_display_unref(display);
}
}
#endif

View file

@ -1351,6 +1351,7 @@ gst_vaapisink_set_context(GstElement *element, GstContext *context)
if (gst_vaapi_video_context_get_display(context, &display)) {
GST_INFO_OBJECT(element, "set display %p", display);
gst_vaapi_display_replace(&sink->display, display);
gst_vaapi_display_unref(display);
}
}
#endif