Closed columbarius closed 1 year ago
The docs say:
It is also possible to dynamically grow the memory as needed.
Can we use that instead?
Then we would have to use a separate buffer for each param since a realloc would invalidate previous pointers to that memory or we could try to create the params and when that fails increase the buffersize and create them again.
No, I mean that this doc sentence hints that PipeWire has an API to dynamically allocate the buffers.
Ahh I see there is a new builder api (spa_pod_dynamic_builder
) in PipeWire. Will take a look at it. Thx.
Implemented #260 just to realize, while trying to figure out the minimum PipeWire version, that after the second reallocation we have dangling pointers. See: https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/d3a1b9fe31ba5978fa50299921fd4481f125dba2
I think we can avoid this by using different builders for each param object?
Yes, updated #260
Superseeded by #260
Modern GPUs support many modifiers which increases the size required for the param_buffer. Instead of randomly bumping the hardcoded value we should calculate the required space dynamically.