mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
uploader: fix memory leak in GStreamer 0.10 builds.
In GStreamer 0.10 builds, gst_vaapi_uploader_get_buffer() was used but it exhibited a memory leak because the surface generated for the GstVaapiVideoMeta totally lost its parent video pool. So, it was not possible to release that surface back to the parent pool when the meta gets released, and the memory consumption kept growing. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
35eaa9e763
commit
dadf0ef978
1 changed files with 1 additions and 6 deletions
7
gst/vaapi/gstvaapiuploader.c
Normal file → Executable file
7
gst/vaapi/gstvaapiuploader.c
Normal file → Executable file
|
@ -412,7 +412,6 @@ GstBuffer *
|
|||
gst_vaapi_uploader_get_buffer(GstVaapiUploader *uploader)
|
||||
{
|
||||
GstVaapiUploaderPrivate *priv;
|
||||
GstVaapiSurface *surface;
|
||||
GstVaapiImage *image;
|
||||
GstVaapiVideoMeta *meta;
|
||||
GstBuffer *buffer;
|
||||
|
@ -428,15 +427,11 @@ gst_vaapi_uploader_get_buffer(GstVaapiUploader *uploader)
|
|||
}
|
||||
|
||||
meta = gst_buffer_get_vaapi_video_meta(buffer);
|
||||
|
||||
surface = gst_vaapi_video_pool_get_object(priv->surfaces);
|
||||
if (!surface) {
|
||||
if (!gst_vaapi_video_meta_set_surface_from_pool(meta, priv->surfaces)) {
|
||||
GST_WARNING("failed to allocate VA surface");
|
||||
goto error;
|
||||
}
|
||||
|
||||
gst_vaapi_video_meta_set_surface(meta, surface);
|
||||
|
||||
image = gst_vaapi_video_meta_get_image(meta);
|
||||
if (!gst_vaapi_image_map(image)) {
|
||||
GST_WARNING("failed to map VA image");
|
||||
|
|
Loading…
Reference in a new issue