[opencv] 49/251: dshow: Only show debugging messages if environment variable OPENCV_DSHOW_DEBUG is explicitly set to non-zero
Nobuhiro Iwamatsu
iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:23 UTC 2017
This is an automated email from the git hooks/post-receive script.
iwamatsu pushed a commit to annotated tag 3.3.0
in repository opencv.
commit df7fb00c217888b29f4794ad65940cff95a4b1ae
Author: Rink Springer <rink at rink.nu>
Date: Thu Jul 13 11:44:20 2017 +0200
dshow: Only show debugging messages if environment variable OPENCV_DSHOW_DEBUG is explicitly set to non-zero
Based on discussion at: https://github.com/opencv/opencv/pull/9051
---
modules/videoio/src/cap_dshow.cpp | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/modules/videoio/src/cap_dshow.cpp b/modules/videoio/src/cap_dshow.cpp
index 200edc7..7d0eda8 100644
--- a/modules/videoio/src/cap_dshow.cpp
+++ b/modules/videoio/src/cap_dshow.cpp
@@ -337,11 +337,17 @@ interface ISampleGrabber : public IUnknown
#ifdef _DEBUG
#include <strsafe.h>
-//change for verbose debug info
-static bool gs_verbose = true;
-
static void DebugPrintOut(const char *format, ...)
{
+ static int gs_verbose = -1;
+ if (gs_verbose < 0)
+ {
+ // Fetch initial debug state from environment - defaults to disabled
+ const char* s = getenv("OPENCV_DSHOW_DEBUG");
+ gs_verbose = s != NULL && atoi(s) != 0;
+ }
+
+
if (gs_verbose)
{
va_list args;
@@ -487,9 +493,6 @@ class videoInput{
videoInput();
~videoInput();
- //turns off console messages - default is to print messages
- static void setVerbose(bool _verbose);
-
//Functions in rough order they should be used.
static int listDevices(bool silent = false);
@@ -1120,20 +1123,6 @@ videoInput::videoInput(){
}
-
-// ----------------------------------------------------------------------
-// static - set whether messages get printed to console or not
-//
-// ----------------------------------------------------------------------
-
-void videoInput::setVerbose(bool _verbose){
-#ifdef _DEBUG
- gs_verbose = _verbose;
-#else
- (void)_verbose; // Suppress 'unreferenced parameter' warning
-#endif
-}
-
// ----------------------------------------------------------------------
// change to use callback or regular capture
// callback tells you when a new frame has arrived
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git
More information about the debian-science-commits
mailing list