summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-04-05 09:01:06 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-04-05 12:09:37 +0200
commitae45e28aab6631d0233754b5c2502c931483091a (patch)
tree5f2ccb05185c09b7e3263b10207a2bc45c3ee876
parent46887c48055fb9101ebedadf52c8f8b13b0e8918 (diff)
downloadcv-ae45e28aab6631d0233754b5c2502c931483091a.tar.gz
cv-ae45e28aab6631d0233754b5c2502c931483091a.tar.bz2
cv-ae45e28aab6631d0233754b5c2502c931483091a.zip
capture: Overload perror to hide some OpenCV error messages
-rw-r--r--capture.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/capture.c b/capture.c
index 6f5ecd0..8576e20 100644
--- a/capture.c
+++ b/capture.c
@@ -7,6 +7,8 @@
#include <cv.h>
#include <highgui.h>
+#include <errno.h>
+
/* Only available as of GTK 3.4 */
#ifndef GDK_BUTTON_PRIMARY
#define GDK_BUTTON_PRIMARY 1
@@ -257,3 +259,13 @@ main(int argc, char *argv[])
return 0;
}
+
+/* FIXME: Need to overload perror so that invalid OpenCV messages are hidden. */
+void
+perror(const char *s)
+{
+ if (strcmp("VIDIOC_QUERYMENU", s) == 0)
+ return;
+
+ fprintf(stderr, "%s: %s\n", s, strerror(errno));
+}