感谢你考虑为 wgc-python 贡献代码!
- Windows 10 1903+ (Build 18362)
- Visual Studio 2022 + C++ 桌面开发工具集
- Python 3.8+
# 构建 DLL
cd wgc_python_dll
msbuild wgc_python_dll.vcxproj /p:Configuration=Release /p:Platform=x64
# 复制到工作目录
copy x64\Release\wgc_python.dll ..\wgc_python\- 遵循现有代码风格:
WGCWindowCapture类处理核心逻辑,WGCExport处理 FFI - 所有公开接口必须通过
g_managerMutex保护 - 错误信息通过
SetError/GetLastError机制传递(线程安全) - 避免在
FrameArrived回调中做重量级操作
capture_one()作为推荐入口,屏蔽 Pause/Resume 细节get_frame()/release_frame()保留零拷贝路径给高级用户- 函数参数和返回值必须有类型标注
- numpy 数组默认 BGRA 格式
python test.py # 功能测试
python test_mt.py # 多线程压测确保修改后所有测试通过。
- Fork 本仓库
- 创建特性分支 (
git checkout -b feat/amazing-feature) - 提交修改 (
git commit -m 'feat: ...') - 推送到分支 (
git push origin feat/amazing-feature) - 创建 Pull Request
feat:新功能fix:修复docs:文档refactor:重构perf:性能优化test:测试chore:构建/工具
贡献即代表你同意你的代码将按 MIT 许可证发布。