From 81fd0eefac022d9f11473bc6aad00b60e7fd4167 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 2 Dec 2016 23:43:35 -0800 Subject: [PATCH] usbcvstream example: Print error from GrabFrame. --- examples/usbcvstream/usbcvstream.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/usbcvstream/usbcvstream.cpp b/examples/usbcvstream/usbcvstream.cpp index 6f9608a659..feea0b0a83 100644 --- a/examples/usbcvstream/usbcvstream.cpp +++ b/examples/usbcvstream/usbcvstream.cpp @@ -19,8 +19,11 @@ int main() { cv::Mat flip; for (;;) { uint64_t time = cvsink.GrabFrame(test); + if (time == 0) { + std::cout << "error: " << cvsink.GetError() << std::endl; + continue; + } std::cout << "got frame at time " << time << " size " << test.size() << std::endl; - if (time == 0) continue; cv::flip(test, flip, 0); cvsource.PutFrame(flip); }