Refactor project structure
This commit is contained in:
23
modules/ANSFR/ANSGpuFrameRegistry.cpp
Normal file
23
modules/ANSFR/ANSGpuFrameRegistry.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// ANSGpuFrameRegistry.cpp — Cross-DLL singleton resolver for ANSFR.dll.
|
||||
//
|
||||
// Finds the canonical ANSGpuFrameRegistry instance exported by ANSCV.dll
|
||||
// via GetProcAddress. No link dependency on ANSCV.lib needed.
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
#include <windows.h>
|
||||
#include "ANSGpuFrameRegistry.h"
|
||||
|
||||
ANSGpuFrameRegistry* ANSGpuFrameRegistry::resolveProcessWide() {
|
||||
// ANSCV.dll is always loaded before inference starts (it provides RTSP).
|
||||
HMODULE hMod = GetModuleHandleA("ANSCV.dll");
|
||||
if (hMod) {
|
||||
typedef ANSGpuFrameRegistry* (*GetInstanceFn)();
|
||||
auto fn = reinterpret_cast<GetInstanceFn>(
|
||||
GetProcAddress(hMod, "ANSGpuFrameRegistry_GetInstance"));
|
||||
if (fn) return fn();
|
||||
}
|
||||
// Fallback: local instance (unit tests without ANSCV.dll).
|
||||
static ANSGpuFrameRegistry local;
|
||||
return &local;
|
||||
}
|
||||
Reference in New Issue
Block a user