Use software decoder by default

This commit is contained in:
2026-04-04 20:19:54 +11:00
parent 3a21026790
commit e134ebdf15
24 changed files with 693 additions and 215 deletions

View File

@@ -1,6 +1,33 @@
#ifndef ANSLICENSE_H
#define ANSLICENSE_H
// ============================================================================
// Global debug toggle for DebugView (DbgView) logging.
// Define ANSCORE_DEBUGVIEW=1 to enable verbose OutputDebugStringA logging
// across all ANSCORE modules (ANSCV, ANSODEngine, TensorRT engine, etc.).
// Set to 0 for production builds to eliminate all debug output overhead.
// ============================================================================
#ifndef ANSCORE_DEBUGVIEW
#define ANSCORE_DEBUGVIEW 1 // 1 = enabled (debug), 0 = disabled (production)
#endif
// ANS_DBG: Debug logging macro for DebugView (OutputDebugStringA on Windows).
// Usage: ANS_DBG("MyModule", "value=%d ptr=%p", val, ptr);
// Output: [MyModule] value=42 ptr=0x1234
// When ANSCORE_DEBUGVIEW=0, compiles to nothing (zero overhead).
// NOTE: We avoid #include <windows.h> here to prevent winsock.h/winsock2.h
// conflicts. Instead, forward-declare OutputDebugStringA directly.
#if ANSCORE_DEBUGVIEW && defined(_WIN32)
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString);
#define ANS_DBG(tag, fmt, ...) do { \
char _ans_dbg_buf[1024]; \
snprintf(_ans_dbg_buf, sizeof(_ans_dbg_buf), "[" tag "] " fmt "\n", ##__VA_ARGS__); \
OutputDebugStringA(_ans_dbg_buf); \
} while(0)
#else
#define ANS_DBG(tag, fmt, ...) ((void)0)
#endif
#ifdef ANSLICENSE_EXPORTS
#define ANSLICENSE_API __declspec(dllexport)
#else