rust-jack icon indicating copy to clipboard operation
rust-jack copied to clipboard

ClosureProcessHandler API does not have a way to set a buffer_size callback

Open Be-ing opened this issue 4 years ago • 3 comments

ClosureProcessHandler::new creates a ProcessHandler with the provided process callback, however it does not provide any way to provide a buffer_size callback for the ProcessHandler it creates.

Be-ing avatar Dec 10 '21 23:12 Be-ing

Interestingly Pipewire immediately calls the buffer size changed callback before processing. The value passed to the buffer size changed callback is different from Client::buffer_size before starting processing.

Be-ing avatar Dec 11 '21 01:12 Be-ing

How about removing ClosureProcessHandler entirely and requiring only ProcessHandler?

We could also refactor ClosureProcessHandler to something like:

ClosureProcessHandler::new(T)
    .with_process_fn(t: &mut T, _: &Client, &ProcessScope)
    .with_buffer_size_fn(t: &mut T, :_ &Client, buffer_size: Frames)

wmedrano avatar Dec 13 '21 01:12 wmedrano

How about removing ClosureProcessHandler entirely and requiring only ProcessHandler?

Sure. I don't think ClosureProcessHandler is necessary.

Be-ing avatar Dec 13 '21 02:12 Be-ing