I recently needed to write camera input to a stream in a QUIC server. To achieve this, I had to implement a custom adapter (reference). This experience highlights a real-world use case where the Camera struct naturally benefits from implementing io.ReadCloser. Having this functionality directly within the Vidio package would help people with similar use cases.
From the top of my head, it would require to:
Rename Read to CanRead
Implement Read from io.Reader in Camera.
Make Close return an error.
By the way, thanks for putting this package together, it was literally plug and play.
I recently needed to write camera input to a stream in a QUIC server. To achieve this, I had to implement a custom adapter (reference). This experience highlights a real-world use case where the Camera struct naturally benefits from implementing io.ReadCloser. Having this functionality directly within the Vidio package would help people with similar use cases.
From the top of my head, it would require to:
Read
toCanRead
Read
fromio.Reader
inCamera
.Close
return anerror
.By the way, thanks for putting this package together, it was literally plug and play.