@@ -337,11 +337,17 @@ interface ISampleGrabber : public IUnknown
337
337
#ifdef _DEBUG
338
338
#include < strsafe.h>
339
339
340
- // change for verbose debug info
341
- static bool gs_verbose = true ;
342
-
343
340
static void DebugPrintOut (const char *format, ...)
344
341
{
342
+ static int gs_verbose = -1 ;
343
+ if (gs_verbose < 0 )
344
+ {
345
+ // Fetch initial debug state from environment - defaults to disabled
346
+ const char * s = getenv (" OPENCV_DSHOW_DEBUG" );
347
+ gs_verbose = s != NULL && atoi (s) != 0 ;
348
+ }
349
+
350
+
345
351
if (gs_verbose)
346
352
{
347
353
va_list args;
@@ -487,9 +493,6 @@ class videoInput{
487
493
videoInput ();
488
494
~videoInput ();
489
495
490
- // turns off console messages - default is to print messages
491
- static void setVerbose (bool _verbose);
492
-
493
496
// Functions in rough order they should be used.
494
497
static int listDevices (bool silent = false );
495
498
@@ -1130,20 +1133,6 @@ videoInput::videoInput(){
1130
1133
1131
1134
}
1132
1135
1133
-
1134
- // ----------------------------------------------------------------------
1135
- // static - set whether messages get printed to console or not
1136
- //
1137
- // ----------------------------------------------------------------------
1138
-
1139
- void videoInput::setVerbose (bool _verbose){
1140
- #ifdef _DEBUG
1141
- gs_verbose = _verbose;
1142
- #else
1143
- (void )_verbose; // Suppress 'unreferenced parameter' warning
1144
- #endif
1145
- }
1146
-
1147
1136
// ----------------------------------------------------------------------
1148
1137
// change to use callback or regular capture
1149
1138
// callback tells you when a new frame has arrived
0 commit comments