Disable NV12 path for ANSCV by default. Currenly use cv::Mat** directly

This commit is contained in:
2026-04-04 10:09:47 +11:00
parent 445abefebe
commit 3a21026790
19 changed files with 575 additions and 232 deletions

View File

@@ -35,6 +35,7 @@ namespace ANSCENTER
int _imageWidth, _imageHeight;
int64_t _pts;
bool _isPlaying;
bool _useNV12FastPath = false;
std::recursive_mutex _mutex;
public:
ANSSRTClient();
@@ -70,6 +71,9 @@ namespace ANSCENTER
int GetHWDecodingGpuIndex();
void SetDisplayResolution(int width, int height); // Set display output size; 0,0 = original (no resize)
void SetImageQuality(int mode); // 0=fast (AI), 1=quality (display)
void SetTargetFPS(double intervalMs); // Set min interval between processed frames in ms (0 = no limit, 100 = ~10 FPS, 200 = ~5 FPS)
void SetNV12FastPath(bool enable); // true = NV12 GPU fast path, false = original CPU path (stable)
bool IsNV12FastPath() const { return _useNV12FastPath; }
AVFrame* GetNV12Frame(); // Returns cloned NV12 frame for GPU fast-path (caller must av_frame_free)
AVFrame* GetCudaHWFrame(); // Returns CUDA HW frame (device ptrs) for zero-copy inference
bool IsCudaHWAccel(); // true when decoder uses CUDA (NV12 stays in GPU VRAM)
@@ -107,4 +111,6 @@ extern "C" __declspec(dllexport) int IsSRTHWDecodingActive(ANSCENTER::ANSSRTCli
extern "C" __declspec(dllexport) int GetSRTHWDecodingGpuIndex(ANSCENTER::ANSSRTClient** Handle);
extern "C" __declspec(dllexport) void SetSRTImageQuality(ANSCENTER::ANSSRTClient** Handle, int mode);
extern "C" __declspec(dllexport) void SetSRTDisplayResolution(ANSCENTER::ANSSRTClient** Handle, int width, int height);
extern "C" __declspec(dllexport) void SetSRTTargetFPS(ANSCENTER::ANSSRTClient** Handle, double intervalMs);
extern "C" __declspec(dllexport) void SetSRTNV12FastPath(ANSCENTER::ANSSRTClient** Handle, int enable);
#endif