Closed Muny closed 7 months ago
Just tried the Avalonia sample, and it behaves the same.
@Muny Could you try to the branch develop
top?
Maybe related, I fixed checking of received frame state flag in V4L2:
If I change (int)buffer.bytesused to (int)buffer.length (which are the same value, except for when bytesused is 0) in the call to this.frameProcessor.OnFrameArrived, I can successfully capture multiple times.
I did this fix at first too, but it uses the incorrect size for variable frame sizes like MJPEG.
The changes in the develop
branch do indeed fix this issue. 🥳
I will close this issue as the fix will be reflected in the next release. Thanks.
Was working on #133 and ran into an issue.
With a fresh main branch, I run the FlashCap.OneShot sample successfully:
However, after subsequent attempts to run the sample, it crashes at the YUV trancoder:
The only way to let it work again is to unplug my UVC device, then plug it back in. It then works for 1 frame, and no more.
After a little digging, I discovered that after here: https://github.com/kekyo/FlashCap/blob/854186a445e494548480ae0d6b607c1bf009eb57/FlashCap.Core/Devices/V4L2Device.cs#L306 The value of
buffer.bytesused
is 0.If I change
(int)buffer.bytesused
to(int)buffer.length
(which are the same value, except for when bytesused is 0) in the call tothis.frameProcessor.OnFrameArrived
, I can successfully capture multiple times.It's not immediately clear to me what could be causing this. I don't know what the difference between
bytesused
andlength
is.