Skip to content

Buffer factory#1

Draft
saaaji wants to merge 4 commits intomainfrom
buffer_factory
Draft

Buffer factory#1
saaaji wants to merge 4 commits intomainfrom
buffer_factory

Conversation

@saaaji
Copy link
Member

@saaaji saaaji commented Feb 23, 2026

Give basler a custom allocator for camera frames.

The C++ API defines an abstract class BufferFactory with methods allocate and free which you can extend to tell basler how to allocate frames

The bindings extend the interface with a "placeholder" class that is constructed with basically a lambda (rust closure) that contains the allocation logic. the placeholder class does not free, so basically C++ does not "own" the memory. The rust provider owns the memory. The closure takes a requested size and hands out basically a raw pointer to the memory you want it to use (as a uintptr_t = usize in rust). Safety is questionable but at least the functionality exists if we end up needing it.

functions to create and attach the buffer factory implemented also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant