mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
glupload: always release the previous buffer
Fixes the case where _perform_with_buffer() is called without intervening calls to _release_buffer() as is the case on start up with glimagesink. Also release the buffer when reseting the upload. https://bugzilla.gnome.org/show_bug.cgi?id=731107
This commit is contained in:
parent
188ae1c3b0
commit
57a54e9de4
1 changed files with 8 additions and 0 deletions
|
@ -65,6 +65,7 @@ struct _GstGLUploadPrivate
|
||||||
GstVideoGLTextureUploadMeta *meta;
|
GstVideoGLTextureUploadMeta *meta;
|
||||||
|
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf;
|
||||||
|
gboolean released;
|
||||||
};
|
};
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_debug);
|
||||||
|
@ -161,6 +162,8 @@ gst_gl_upload_reset (GstGLUpload * upload)
|
||||||
upload->in_tex[i] = NULL;
|
upload->in_tex[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_gl_upload_release_buffer (upload);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -241,6 +244,8 @@ gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer,
|
||||||
g_return_val_if_fail (tex_id != NULL, FALSE);
|
g_return_val_if_fail (tex_id != NULL, FALSE);
|
||||||
g_return_val_if_fail (gst_buffer_n_memory (buffer) > 0, FALSE);
|
g_return_val_if_fail (gst_buffer_n_memory (buffer) > 0, FALSE);
|
||||||
|
|
||||||
|
gst_gl_upload_release_buffer (upload);
|
||||||
|
|
||||||
/* GstGLMemory */
|
/* GstGLMemory */
|
||||||
mem = gst_buffer_peek_memory (buffer, 0);
|
mem = gst_buffer_peek_memory (buffer, 0);
|
||||||
|
|
||||||
|
@ -330,6 +335,8 @@ gst_gl_upload_release_buffer (GstGLUpload * upload)
|
||||||
gst_buffer_unref (upload->priv->outbuf);
|
gst_buffer_unref (upload->priv->outbuf);
|
||||||
upload->priv->outbuf = NULL;
|
upload->priv->outbuf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
upload->priv->released = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -539,6 +546,7 @@ _upload_memory (GstGLUpload * upload)
|
||||||
upload->out_tex->tex_id = *(guint *) out_frame.data[0];
|
upload->out_tex->tex_id = *(guint *) out_frame.data[0];
|
||||||
|
|
||||||
gst_video_frame_unmap (&out_frame);
|
gst_video_frame_unmap (&out_frame);
|
||||||
|
upload->priv->released = FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue