Skip to content

feat(pkg): compat.opencv full-platform full-function — windows videoio + macOS dnn (mcpp 0.0.101)#103

Merged
Sunrisepeak merged 7 commits into
mainfrom
feat/opencv-full-func
Jul 20, 2026
Merged

feat(pkg): compat.opencv full-platform full-function — windows videoio + macOS dnn (mcpp 0.0.101)#103
Sunrisepeak merged 7 commits into
mainfrom
feat/opencv-full-func

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Makes compat.opencv full-platform full-function on mcpp 0.0.101: windows gains the FFmpeg videoio backend, macOS-arm64 gains the dnn module, and the dnn feature is restructured per-OS (mcpp#253). Consumers just do opencv = { features = ["dnn"] } and it works on linux/macOS (windows videoio available now; windows dnn is a follow-up).

What changed

Windows videoio (the deep HAVE_FFMPEG handoff — solved).
OpenCV's videoio gates cap_ffmpeg.cpp on the CMake target ocv.3rdparty.ffmpeg (created by ocv_add_external_target in detect_ffmpeg.cmake), not on the HAVE_FFMPEG variable — so forcing the variable never helped. Fix: the sanctioned OPENCV_FFMPEG_USE_FIND_PACKAGE=FFMPEG + a FindFFMPEG.cmake shim, which sets HAVE_FFMPEG=TRUE before the target is created. CI confirms TARGET ocv.3rdparty.ffmpeg CREATED → cap_ffmpeg: YES (2 TUs) under clang-cl.

macOS dnn (per-OS NEON).
The dnn feature's payload is now split (mcpp#253 per-OS features): neutral features.dnn carries the cross-platform common payload (dnn/protobuf/mlas C++ + mlas_hgemm_stub), and each OS's SIMD delta rides mcpp.<os>.features.dnn — x86 (mlas/lib/x86_64/*.S + avx/avx2/avx512 kernels) on linux/windows, arm (mlas/lib/aarch64/*.S + neon/neon_fp16 kernels) on macOS. Snapshot built core+imgproc+…+dnn on macos-15 (NEON): 70 .neon.cpp kernels.

Dead-glob warning cleared (mcpp 0.0.101 per-feature flags).
dnn-group flag-globs (mlas/protobuf/mlasgemm + per-ISA) moved out of the feature-off base flags into features.dnn.flags, so they no longer matched no source file when dnn is off.

Tooling

  • gen_descriptor.py: route dnn flag-globs → features.dnn.flags; fix empty-baseline (arm) cxxflags = { , "-w" } lua syntax bug.
  • merge_opencv.lua: per-OS dnn common/delta split + flag relocation (format-robust across pre/post-warnfix inputs).
  • Snapshot workflows: windows/macOS full profile + dnn.

Validation

  • mcpp 0.0.101 xpkg parse clean on all 3 OSes.
  • opencv-dnn + opencv-module-dnn test members widened to macOS — this PR's workspace (macos) job builds the full dnn closure from source and runs the blobFromImage NCHW assertion + import opencv.dnn; on macos-arm64.

…cpp 0.0.101 per-feature flags — clears feature-off dead-glob warnings; per-OS deltas land via merge)
…ntax error; merge_opencv: per-OS dnn common/delta split (mcpp#253) + warn-fix flag relocation
…-OS NEON dnn build + import opencv.dnn on macos-arm64)
…o + macOS dnn (per-OS NEON) + warning-free (mcpp 0.0.101)
…-cl dnn+protobuf CI-clean) + widen dnn tests to windows
@Sunrisepeak

Copy link
Copy Markdown
Member Author

Upgraded: windows now has dnn too. The windows full+videoio+dnn snapshot succeeded — dnn + vendored protobuf compile clean under clang-cl (cap_ffmpeg: YES, 309 dnn TUs, 0 errors). Descriptor now carries videoio and dnn on all three platforms (x86 delta on linux/windows, NEON on macOS). dnn tests widened to windows as well.

@Sunrisepeak
Sunrisepeak merged commit 5ca1e46 into main Jul 20, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant