gst: sink: post an element error when all buffers are removed abruptly

When the link on the pipewire side is destroyed, on video streams, buffers
are removed abruptly and there is no way this pipeline can be revived,
so let's post an element error to stop it.

On a normal shutdown, the pool is first set to flushing in change_state(),
so checking for the flushing state is a good indicator to know if this
is a normal shutdown or not.

See #1980
This commit is contained in:
George Kiagiadakis 2024-05-28 17:34:45 +03:00
parent ef5f5d4c3c
commit 68711290bd
3 changed files with 18 additions and 0 deletions

View file

@ -117,6 +117,8 @@ void gst_pipewire_pool_wrap_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
data,
pool_data_destroy);
b->user_data = data;
pool->n_buffers++;
}
void gst_pipewire_pool_remove_buffer (GstPipeWirePool *pool, struct pw_buffer *b)
@ -132,6 +134,8 @@ void gst_pipewire_pool_remove_buffer (GstPipeWirePool *pool, struct pw_buffer *b
/* this will also destroy the pool data, if this is the last reference */
gst_clear_buffer (&data->buf);
pool->n_buffers--;
}
GstPipeWirePoolData *gst_pipewire_pool_get_data (GstBuffer *buffer)