raspberrypi / picamera2

New libcamera based python library
BSD 2-Clause "Simplified" License
891 stars 188 forks source link

Add Persistent Allocator #894

Closed will-v-pi closed 11 months ago

will-v-pi commented 11 months ago

Add a variant of the DmaAllocator where the buffers are not deallocated after switching mode, allowing you to have multiple sets of buffers stored which can be switched between based on the camera configuration. It selects which buffers to use for a given configuration based off the use_case parameter, so this must be set uniquely for each configuration that will be used with the allocator.

davidplowman commented 11 months ago

Looks very cool to me! Before I merge, are we happy the we're taking care of the risk of leaks in any of those "persistent" allocations, maybe in configurations that aren't currently being used?