From 21425486f052e4012e6c38241dd953eabf4e0b65 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Date: Tue, 26 Nov 2024 12:31:06 +0100 Subject: [PATCH] Update bindings --- .../eduramiba/webcamcapture/drivers/nokhwa/LibNokhwa.java | 2 +- .../webcamcapture/drivers/nokhwa/NokhwaVideoDevice.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/nokhwa/LibNokhwa.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/nokhwa/LibNokhwa.java index ec3746c..2295975 100644 --- a/src/main/java/com/github/eduramiba/webcamcapture/drivers/nokhwa/LibNokhwa.java +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/nokhwa/LibNokhwa.java @@ -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); diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/nokhwa/NokhwaVideoDevice.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/nokhwa/NokhwaVideoDevice.java index 7c9d0ca..9b556fe 100644 --- a/src/main/java/com/github/eduramiba/webcamcapture/drivers/nokhwa/NokhwaVideoDevice.java +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/nokhwa/NokhwaVideoDevice.java @@ -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 {