Commit ebf6708
committed
qb/Makefile: wire up AVFoundation camera + recording drivers (HAVE_AVF, macOS 10.7+)
camera/drivers/avfoundation.m and record/drivers/record_avfoundation.m
were already included by the Xcode builds (via griffin_objc.m under
HAVE_AVF) but had no path to get compiled by the qb-driven top-level
Makefile. On a plain 'make' on macOS the AVFoundation camera driver
simply did not exist in the binary.
Wire it up:
* qb/config.params.sh: add 'HAVE_AVF=auto'. The qb machinery
auto-derives USER_AVF and the --enable-avf / --disable-avf flags
from this declaration.
* qb/config.libs.sh: inside the Darwin block, decide HAVE_AVF
based on (user override) && (framework available) && either
HAVE_COCOATOUCH (iOS/tvOS builds - always modern enough) or
macos_target_pre_10_7 = no. Matches the 10.7 gate already
used for Metal / Vulkan / microphone in the same block. The
pre-existing 'check_lib "" AVFOUNDATION "-framework AVFoundation"'
was detecting the framework but its result was never consumed
anywhere; move it up so the version gate and framework gate run
together before macos_target_* are unset, and consume HAVE_AVFOUNDATION
directly. A forced --enable-avf on a target missing the framework
now fails loudly instead of silently.
* Makefile.common: add a new block (next to Video4Linux 2) that
compiles camera/drivers/avfoundation.o and record/drivers/
record_avfoundation.o when HAVE_AVF is on, defines -DHAVE_AVF
so camera_driver.c / record_driver.c register the drivers, and
links -framework AVFoundation/CoreVideo/CoreMedia/Accelerate
(plus UIKit on HAVE_COCOATOUCH for the rotation-detection code
path in avfoundation.m).
The 10.7 floor is chosen to match the APIs the two .m files actually
use: AVCaptureSession, dispatch_queue_t blocks, @autoreleasepool as
a statement. On Tiger/Leopard / PowerPC / Xcode 3.1 those are
absent, so the drivers can't be built there; they're silently
disabled with a die:notice matching the pattern used for microphone
and Metal.
Note: -framework AVFoundation already appears on the link line when
HAVE_MICROPHONE=1 (coreaudio_mic_macos.o) or HAVE_COREAUDIO3=1. make
tolerates the repeat and the linker de-duplicates; cleaning this up
into a shared AVFOUNDATION_LIBS guard is a separate refactor.
No behavior change for non-Darwin builds or for Xcode/iOS builds
(both paths already define HAVE_AVF through their own toolchains).1 parent 141d2a6 commit ebf6708
3 files changed
Lines changed: 46 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2263 | 2263 | | |
2264 | 2264 | | |
2265 | 2265 | | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
2266 | 2283 | | |
2267 | 2284 | | |
2268 | 2285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
333 | 360 | | |
334 | 361 | | |
335 | 362 | | |
| |||
338 | 365 | | |
339 | 366 | | |
340 | 367 | | |
341 | | - | |
342 | 368 | | |
343 | 369 | | |
344 | 370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
0 commit comments