Closed rytec-nl closed 3 years ago
I recall people recently reported issues about the same thing. I attempted to fix those (runtime) crashes with https://github.com/raymanfx/libv4l-rs/commit/4d003b69f1dfa8580ff3127cfca03fc6888da509, but that only prevents copying a larger range of input data to a smaller output buffer.
I assume your patch is still needed for semantical correctness. Honestly I did not test output streaming for some weeks now, perhaps I should do that again soon. Could you send a PR for this one as well? Then we'll review it and I'll run some tests with MJPG frame encoding.
Done: https://github.com/raymanfx/libv4l-rs/pull/33
One issue that I can see is when bytesused is not set on the meta struct. So there should be some check there and then perhaps default to the max size?
Hi,
I'm not sure if this is me misunderstanding something but when I fill the mmap output buffer with data I do not see a way to set the bytesUsed. Im streaming mjpeg and depending of the encoding the data size changes. As far as I can see now always the max buffer size is set. I tried using the meta struct to set
meta.bytesused
but that does not seem to be used in the library. As a workaround i did this insrc/io/mmap/stream.rs
:However I do not know if this breaks other usage of the OutputStream. Am I missing something? Or am I on the right track and should my change be expanded to cover all situations.
Thanks in advance!