@@ -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
@@ -1120,20 +1123,6 @@ videoInput::videoInput(){
1120
1123
1121
1124
}
1122
1125
1123
-
1124
- // ----------------------------------------------------------------------
1125
- // static - set whether messages get printed to console or not
1126
- //
1127
- // ----------------------------------------------------------------------
1128
-
1129
- void videoInput::setVerbose (bool _verbose){
1130
- #ifdef _DEBUG
1131
- gs_verbose = _verbose;
1132
- #else
1133
- (void )_verbose; // Suppress 'unreferenced parameter' warning
1134
- #endif
1135
- }
1136
-
1137
1126
// ----------------------------------------------------------------------
1138
1127
// change to use callback or regular capture
1139
1128
// callback tells you when a new frame has arrived
0 commit comments