mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
Merge pull request #9157 from zhmu:opencv-dshow-allow-enable-disable-of-debug-messages
This commit is contained in:
commit
d07eb9ad60
@ -337,11 +337,17 @@ interface ISampleGrabber : public IUnknown
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
|
|
||||||
//change for verbose debug info
|
|
||||||
static bool gs_verbose = true;
|
|
||||||
|
|
||||||
static void DebugPrintOut(const char *format, ...)
|
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)
|
if (gs_verbose)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
@ -487,9 +493,6 @@ class videoInput{
|
|||||||
videoInput();
|
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.
|
//Functions in rough order they should be used.
|
||||||
static int listDevices(bool silent = false);
|
static int listDevices(bool silent = false);
|
||||||
|
|
||||||
@ -1130,20 +1133,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
|
// change to use callback or regular capture
|
||||||
// callback tells you when a new frame has arrived
|
// callback tells you when a new frame has arrived
|
||||||
|
Loading…
Reference in New Issue
Block a user