Fix other ANSCV classes

This commit is contained in:
2026-05-09 16:47:46 +10:00
parent aa323a07a3
commit a94bf88a5b
16 changed files with 1197 additions and 197 deletions
+12
View File
@@ -35,6 +35,11 @@ namespace ANSCENTER
std::string _lastJpegImage;
int _imageWidth, _imageHeight;
int64_t _pts;
// Last currentPts seen from the inner getImage(). Used for duplicate
// detection separately from _pts so the invariant
// same image -> same pts
// holds for callers comparing pts (or calling areImagesIdentical()).
int64_t _lastInnerPts = -1;
bool _isPlaying;
bool _useNV12FastPath = false;
std::recursive_mutex _mutex;
@@ -73,6 +78,11 @@ namespace ANSCENTER
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)
// Jitter buffer for the BGR delivery path (forwarded to CVideoPlayer).
// 0 = no buffering (today's getLatest semantics). Default 200 ms (set
// inside CVideoPlayer constructor). Adaptive: slow consumers bypass it.
void SetJitterBufferMs(int ms);
int GetJitterBufferMs() const;
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)
@@ -113,4 +123,6 @@ extern "C" __declspec(dllexport) void SetRTMPImageQuality(ANSCENTER::ANSRTMPClie
extern "C" __declspec(dllexport) void SetRTMPDisplayResolution(ANSCENTER::ANSRTMPClient** Handle, int width, int height);
extern "C" __declspec(dllexport) void SetRTMPTargetFPS(ANSCENTER::ANSRTMPClient** Handle, double intervalMs);
extern "C" __declspec(dllexport) void SetRTMPNV12FastPath(ANSCENTER::ANSRTMPClient** Handle, int enable);
extern "C" __declspec(dllexport) void SetRTMPJitterBuffer(ANSCENTER::ANSRTMPClient** Handle, int jitterMs);
extern "C" __declspec(dllexport) int GetRTMPJitterBuffer(ANSCENTER::ANSRTMPClient** Handle);
#endif