From dadf0ef9783367ad58672c1f89fcf61a52cd3d71 Mon Sep 17 00:00:00 2001 From: Zhao Halley Date: Wed, 15 May 2013 10:33:16 +0800 Subject: [PATCH] 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 --- gst/vaapi/gstvaapiuploader.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) mode change 100644 => 100755 gst/vaapi/gstvaapiuploader.c diff --git a/gst/vaapi/gstvaapiuploader.c b/gst/vaapi/gstvaapiuploader.c old mode 100644 new mode 100755 index d542e8be8f..8413fe679f --- a/gst/vaapi/gstvaapiuploader.c +++ b/gst/vaapi/gstvaapiuploader.c @@ -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");