mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-20 06:59:58 -05:00
gst: pool: add explicit remove_buffer method
This is for readability and better control. Make sure we clear out all pointers to anything related to the released pw_buffer, including all the memories.
This commit is contained in:
parent
40fd2553ea
commit
1e2618f314
3 changed files with 18 additions and 5 deletions
|
|
@ -119,6 +119,21 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
|
|||
b->user_data = data;
|
||||
}
|
||||
|
||||
void gst_pipewire_pool_remove_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
|
||||
{
|
||||
GstPipeWirePoolData *data = b->user_data;
|
||||
|
||||
data->b = NULL;
|
||||
data->header = NULL;
|
||||
data->crop = NULL;
|
||||
data->videotransform = NULL;
|
||||
|
||||
gst_buffer_remove_all_memory (data->buf);
|
||||
|
||||
/* this will also destroy the pool data, if this is the last reference */
|
||||
gst_clear_buffer (&data->buf);
|
||||
}
|
||||
|
||||
GstPipeWirePoolData *gst_pipewire_pool_get_data (GstBuffer *buffer)
|
||||
{
|
||||
return gst_mini_object_get_qdata (GST_MINI_OBJECT_CAST (buffer), pool_data_quark);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue