roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.04k stars 207 forks source link

Add IDevice::close() #748

Closed gavv closed 1 month ago

gavv commented 1 month ago

Implement explicit closing of devices & files.

sndio::IDevice is an interface implemented by audio devices and files and network senders and receivers. See doxygen. Currently devices perform closing in their destructor. We need to be able to do it explicitly before calling destructor. This is needed for #677.

Steps:

Related: #703.

runei commented 1 month ago

Hi, I am interested in solving this issue.

gavv commented 1 month ago

Thanks, Leonardo! Be sure to pull fresh develop, it has some recent changes in IDevice.

runei commented 1 month ago

Hi @gavv , what status code should it return in case the device does not close successfully? Or it always return StatusOK?

gavv commented 1 month ago

Hi @gavv , what status code should it return in case the device does not close successfully? Or it always return StatusOK?

Same as from write - ErrFile or ErrDevice depending on device type.