Fix NV12 crash issue when recreate camera object

This commit is contained in:
2026-04-02 22:07:27 +11:00
parent 4bedf3a3a2
commit 958cab6ae3
25 changed files with 1459 additions and 393 deletions

View File

@@ -3,6 +3,7 @@
#include "sys_inc.h"
#include "media_format.h"
#include <string>
#include <atomic>
#include <mutex>
#include <vector>
extern "C"
@@ -152,7 +153,7 @@ private:
int hwDecoderInit(AVCodecContext* ctx, int hwMode, int preferredGpu = -1);
private:
BOOL m_bInited;
BOOL m_bRunning;
std::atomic<BOOL> m_bRunning;
BOOL m_bHardwareDecoderEnabled; // Track if hardware decoder is enabled
bool m_bCudaHWAccel; // true when using AV_HWDEVICE_TYPE_CUDA
int m_hwGpuIndex; // GPU index assigned by HWDecoderPool (-1 = legacy)