Update bindings

This commit is contained in:
Eduardo Ramos 2024-11-26 12:31:06 +01:00
parent bc7ea82924
commit 21425486f0
2 changed files with 5 additions and 5 deletions

View File

@ -59,7 +59,7 @@ public interface LibNokhwa extends Library {
int cnokhwa_stop_capture(int deviceIndex);
int cnokhwa_has_new_frame(int deviceIndex);
int cnokhwa_has_first_frame(int deviceIndex);
int cnokhwa_frame_width(int deviceIndex);

View File

@ -251,8 +251,8 @@ public class NokhwaVideoDevice implements WebcamDeviceExtended {
private void updateBuffer() {
if (imgBuffer == null) {
final int hasFrameResult = LibNokhwa.INSTANCE.cnokhwa_has_new_frame(deviceIndex);
if (hasFrameResult == RESULT_YES) {
final int hasFirstFrameResult = LibNokhwa.INSTANCE.cnokhwa_has_first_frame(deviceIndex);
if (hasFirstFrameResult == RESULT_YES) {
// Init buffer if still not initialized:
this.bytesPerRow = LibNokhwa.INSTANCE.cnokhwa_frame_bytes_per_row(deviceIndex);
@ -262,8 +262,8 @@ public class NokhwaVideoDevice implements WebcamDeviceExtended {
doGrab();
} else {
if (hasFrameResult != RESULT_NO) {
LOG.error("Error checking for new frame = {}", hasFrameResult);
if (hasFirstFrameResult != RESULT_NO) {
LOG.error("Error checking for new frame = {}", hasFirstFrameResult);
}
}
} else {