Add log info

This commit is contained in:
2026-04-03 15:16:26 +11:00
parent 6fb09830c5
commit c2f30b18ab
2 changed files with 33 additions and 9 deletions

View File

@@ -55,8 +55,15 @@ GpuNV12Slot* GpuNV12SlotPool::acquire(int gpuIdx, int w, int h) {
// 3. No matching free slot — allocate a new one if under the limit
if (static_cast<int>(m_slots.size()) >= GPU_NV12_POOL_MAX_SLOTS) {
NV12POOL_DBG("acquire: POOL FULL (%zu slots) — fallback to CPU path",
m_slots.size());
// Always log POOL FULL to DebugView — this is a critical diagnostic.
{
char _buf[128];
snprintf(_buf, sizeof(_buf), "[NV12Pool] POOL FULL (%zu slots) — fallback to CPU\n", m_slots.size());
#ifdef _WIN32
OutputDebugStringA(_buf);
#endif
fprintf(stderr, "%s", _buf);
}
return nullptr;
}
@@ -100,6 +107,19 @@ GpuNV12Slot* GpuNV12SlotPool::acquire(int gpuIdx, int w, int h) {
GpuNV12Slot* raw = slot.get();
m_slots.push_back(std::move(slot));
// Always log new slot allocation to DebugView (rare event — once per resolution per camera).
{
char _buf[256];
snprintf(_buf, sizeof(_buf),
"[NV12Pool] NEW slot #%zu: %dx%d gpu=%d Y=%p UV=%p pitchY=%zu stream=%p\n",
m_slots.size(), w, h, gpuIdx, raw->bufY, raw->bufUV, raw->pitchY, raw->copyStream);
#ifdef _WIN32
OutputDebugStringA(_buf);
#endif
fprintf(stderr, "%s", _buf);
}
// Also log POOL FULL to DebugView (important diagnostic).
NV12POOL_DBG("acquire: NEW slot Y=%p UV=%p pitchY=%zu pitchUV=%zu %dx%d gpu=%d stream=%p (total=%zu)",
raw->bufY, raw->bufUV, raw->pitchY, raw->pitchUV,
w, h, gpuIdx, raw->copyStream, m_slots.size());