mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-13 14:33:03 -04:00
pipewiresrc: should not activate the buffer pool from downstream
pipewirsrc has own buffer pool and need to clear the buffer pool information in the query to prevent from being activated by base class.
This commit is contained in:
parent
08d4e319cf
commit
3be1904558
1 changed files with 19 additions and 0 deletions
|
|
@ -118,6 +118,8 @@ static gboolean gst_pipewire_src_event (GstBaseSrc * src, GstEvent * event);
|
|||
static gboolean gst_pipewire_src_query (GstBaseSrc * src, GstQuery * query);
|
||||
static void gst_pipewire_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
|
||||
GstClockTime * start, GstClockTime * end);
|
||||
static gboolean gst_pipewire_src_decide_allocation (GstBaseSrc * basesrc,
|
||||
GstQuery * query);
|
||||
|
||||
static void
|
||||
gst_pipewire_src_set_property (GObject * object, guint prop_id,
|
||||
|
|
@ -502,6 +504,7 @@ gst_pipewire_src_class_init (GstPipeWireSrcClass * klass)
|
|||
gstbasesrc_class->event = gst_pipewire_src_event;
|
||||
gstbasesrc_class->query = gst_pipewire_src_query;
|
||||
gstbasesrc_class->get_times = gst_pipewire_src_get_times;
|
||||
gstbasesrc_class->decide_allocation = gst_pipewire_src_decide_allocation;
|
||||
gstpushsrc_class->create = gst_pipewire_src_create;
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (pipewire_src_debug, "pipewiresrc", 0,
|
||||
|
|
@ -1552,6 +1555,22 @@ gst_pipewire_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
|
|||
GST_TIME_ARGS (*start), *start, GST_TIME_ARGS (*end), *end);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_pipewire_src_decide_allocation (GstBaseSrc * basesrc, GstQuery * query)
|
||||
{
|
||||
guint i;
|
||||
|
||||
/* Rewrite decide_allocation function to clear the buffer pool information
|
||||
* in the query if it exists to prevent from being activated by base class
|
||||
* because pipewirsrc has own buffer pool.
|
||||
*/
|
||||
for (i = 0; i < gst_query_get_n_allocation_pools (query); i++) {
|
||||
gst_query_remove_nth_allocation_pool (query, i);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue