mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-24 07:00:05 -05:00
remove hardcoded port allocation params
This commit is contained in:
parent
ca7d08c406
commit
3fee60597e
6 changed files with 27 additions and 48 deletions
|
|
@ -99,18 +99,32 @@ static gboolean
|
|||
do_start (GstBufferPool * pool)
|
||||
{
|
||||
GstPinosPool *p = GST_PINOS_POOL (pool);
|
||||
PinosProperties *props = NULL;
|
||||
GstStructure *config;
|
||||
GstCaps *caps;
|
||||
guint size;
|
||||
guint min_buffers;
|
||||
guint max_buffers;
|
||||
SpaAllocParam *port_params[2];
|
||||
SpaAllocParamMetaEnable param_meta_enable;
|
||||
SpaAllocParamBuffers param_buffers;
|
||||
|
||||
config = gst_buffer_pool_get_config (pool);
|
||||
gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers);
|
||||
|
||||
port_params[0] = ¶m_buffers.param;
|
||||
param_buffers.param.type = SPA_ALLOC_PARAM_TYPE_BUFFERS;
|
||||
param_buffers.param.size = sizeof (SpaAllocParamBuffers);
|
||||
param_buffers.minsize = size;
|
||||
param_buffers.stride = 0;
|
||||
param_buffers.min_buffers = min_buffers;
|
||||
param_buffers.max_buffers = max_buffers;
|
||||
param_buffers.align = 16;
|
||||
port_params[1] = ¶m_meta_enable.param;
|
||||
param_meta_enable.param.type = SPA_ALLOC_PARAM_TYPE_META_ENABLE;
|
||||
param_meta_enable.param.size = sizeof (SpaAllocParamMetaEnable);
|
||||
param_meta_enable.type = SPA_META_TYPE_HEADER;
|
||||
|
||||
pinos_stream_start_allocation (p->stream, props);
|
||||
pinos_stream_start_allocation (p->stream, port_params, 2);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue