fix(video): track latency timestamps by encoded frame#705
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)src/**/*.{cpp,c,h}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (7)
Summary by CodeRabbitBug Fixes
Walkthrough采用固定大小环形缓冲区(256 槽)存储帧号与采集时间戳的映射,在 AVCodec、NVENC、AMF 三种编码器会话中集成该缓冲,于帧提交时记录时间戳、输出时根据编码器返回的帧索引回查对应时间戳,替代之前的直接时间戳传递或基于 pts 匹配的逻辑。 Changes编码器时间戳追踪与环形缓冲集成
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Infer (1.2.0)src/video.cppsrc/video.cpp:16:10: fatal error: 'boost/pointer_cast.hpp' file not found ... [truncated 2200 characters] ... clang/cTrans.ml", line 4784, characters 10-1023 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4db4aa3 to
e5579b9
Compare
改了啥呀,杂鱼
encoded_frame.frame_index回查 timestamp。为啥这样改
之前 host processing latency 的 packet timestamp 直接来自当前 encode 调用的
frame_timestamp。当编码器输出落后于提交帧时,尤其 AMF 每帧分片/流水线输出场景,会低估完整帧从 capture 到 packet 出队的时间。这个实现只做 O(1) 数组读写,没有 map、堆分配、新计时点或额外日志,默认路径上的性能开销保持很低。
验证
git diff --check -- src/video.cppninja -C build CMakeFiles/sunshine.dir/src/video.cpp.obj被 MSYS GCC 前端崩溃阻塞:cc1plus.exe --version直接退出-1073741511,最小 C++ 文件编译也同样静默失败,无法作为该 diff 的编译诊断。