Fix NV12 crash issue when recreate camera object

(new structure) does not work
This commit is contained in:
2026-04-03 14:51:52 +11:00
parent 958cab6ae3
commit 6fb09830c5
16 changed files with 854 additions and 209 deletions

View File

@@ -5,6 +5,7 @@ set(ANSFR_SOURCES
ANSFRCommon.cpp
ANSFaceRecognizer.cpp
ANSGpuFrameRegistry.cpp
GpuNV12SlotPool.cpp
FaceDatabase.cpp
FaceNet.cpp
dllmain.cpp

View File

@@ -0,0 +1,23 @@
// GpuNV12SlotPool.cpp — Cross-DLL singleton resolver for ANSODEngine.dll.
//
// Finds the canonical GpuNV12SlotPool 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 "GpuNV12SlotPool.h"
GpuNV12SlotPool* GpuNV12SlotPool::resolveProcessWide() {
// ANSCV.dll is always loaded before inference starts (it provides RTSP).
HMODULE hMod = GetModuleHandleA("ANSCV.dll");
if (hMod) {
typedef GpuNV12SlotPool* (*GetInstanceFn)();
auto fn = reinterpret_cast<GetInstanceFn>(
GetProcAddress(hMod, "GpuNV12SlotPool_GetInstance"));
if (fn) return fn();
}
// Fallback: local instance (unit tests without ANSCV.dll).
static GpuNV12SlotPool local;
return &local;
}