Safely wrapping `Stream::dequeue_raw_buffer` and `queue_raw_buffer`
My idea was to create a Buffer
struct that wraps ptr::NonNull<pw_sys::pw_buffer>
.
My doubt is maily about queue_buffer
: the doc says that you should return a buffer to the stream it originated from, but it doesn't say what happens if you return it to the wrong stream. Does pipewire detect it and fails somewhat, or does it cause UB? It matters because in the first case we can just leave it up to the user, with a note in the docs. In the other case, however, we need to find a way to associate a buffer with the stream it came from, and ensure it can't be returned to the wrong one.