|
@@ -964,6 +964,7 @@ Frames::processFrameAsync(const RawFrame& frame){
|
|
|
diagCvtUs += cvtUs;
|
|
diagCvtUs += cvtUs;
|
|
|
diagMapUs += mapUs;
|
|
diagMapUs += mapUs;
|
|
|
diagCopyUs += copyUs;
|
|
diagCopyUs += copyUs;
|
|
|
|
|
+#if 0
|
|
|
if (diagProcN >= 30) {
|
|
if (diagProcN >= 30) {
|
|
|
LOG("[diag] proc: avg cvt={}us avg map={}us avg copy={}us", diagCvtUs/diagProcN, diagMapUs/diagProcN, diagCopyUs/diagProcN);
|
|
LOG("[diag] proc: avg cvt={}us avg map={}us avg copy={}us", diagCvtUs/diagProcN, diagMapUs/diagProcN, diagCopyUs/diagProcN);
|
|
|
diagProcN = 0;
|
|
diagProcN = 0;
|
|
@@ -971,7 +972,7 @@ Frames::processFrameAsync(const RawFrame& frame){
|
|
|
diagMapUs = 0;
|
|
diagMapUs = 0;
|
|
|
diagCopyUs = 0;
|
|
diagCopyUs = 0;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+#endif
|
|
|
// ✅ 投递回 UI 线程(节流:UI线程未消费完上一帧时丢弃本帧,避免事件队列积压导致内存暴涨)
|
|
// ✅ 投递回 UI 线程(节流:UI线程未消费完上一帧时丢弃本帧,避免事件队列积压导致内存暴涨)
|
|
|
if (m_displayPending.testAndSetRelaxed(0, 1)) {
|
|
if (m_displayPending.testAndSetRelaxed(0, 1)) {
|
|
|
QMetaObject::invokeMethod(m_videoSink, [this, vf]() {
|
|
QMetaObject::invokeMethod(m_videoSink, [this, vf]() {
|
|
@@ -1062,6 +1063,7 @@ Frames::handleGrab(bool sta_cam){
|
|
|
processFrameAsync(frame);
|
|
processFrameAsync(frame);
|
|
|
// ----- FPS -----
|
|
// ----- FPS -----
|
|
|
m_fps_timer->incrementFrame();
|
|
m_fps_timer->incrementFrame();
|
|
|
|
|
+#if 0
|
|
|
// [diag] 节流统计:每30帧打印一次平均耗时
|
|
// [diag] 节流统计:每30帧打印一次平均耗时
|
|
|
diagGrabN++;
|
|
diagGrabN++;
|
|
|
diagGrabWaitUs += waitUs;
|
|
diagGrabWaitUs += waitUs;
|
|
@@ -1075,6 +1077,7 @@ Frames::handleGrab(bool sta_cam){
|
|
|
diagGrabWaitUs = 0;
|
|
diagGrabWaitUs = 0;
|
|
|
diagGrabCopyUs = 0;
|
|
diagGrabCopyUs = 0;
|
|
|
}
|
|
}
|
|
|
|
|
+#endif
|
|
|
#if 1
|
|
#if 1
|
|
|
if (param::camera_tc == -1) {
|
|
if (param::camera_tc == -1) {
|
|
|
emit stopGrabbing(false);
|
|
emit stopGrabbing(false);
|