Commit Graph

7 Commits

Author SHA1 Message Date
jcm
bf7e82de80 mac-avcapture: Use list-based format selector 2025-04-02 15:03:52 -04:00
jcm
68c4617927 mac-avcapture: Clear memory when creating frame struct 2025-03-18 17:35:53 -04:00
jcm
4fd671ee89 mac-avcapture: Prevent race condition in source init/deinit 2025-03-07 13:51:17 -05:00
gxalpha
a92852f96b mac-avcapture: Improve av_capture_sync_info formatting 2024-05-25 17:14:24 -07:00
PatTheMav
03c42e5b93 mac-avcapture: Fix crash issues on Intel-based Macs and older macOS
Fixes several possible crash issues that might occur on Intel-based Macs
and older macOS versions:

On modern macOS versions (13+) allocated memory is zero-allocated by
default which makes NULL pointer checks work correctly after allocation.

On older macOS versions this is not the case, so the OBSAVCaptureInfo
struct needs to be zero-allocated to ensure the guards in the tick and
render functions bail out correctly.

On Intel-based Macs and/or older macOS versions passing a reference to
the OBSAVCapture instance inside the OBSAVCapture struct can lead to a
crash because of a possible circular reference that cannot be resolved
at runtime.

Passing only a reference of the OBSAVCapture to libobs and incrementing
the retain count at source creation (decrementing in when the source is
destroyed) avoids this issue entirely.
2024-02-20 17:57:09 -05:00
PatTheMav
ee28503726 mac-avcapture: Add color format selection for capture card source
Some devices do not support all color formats at all resolutions, but
the capture card source automatically uses an available color format
and compares it against the available format for a specific resolution.

Without being able to change this format, some resolutions do not
work as CMIO will not be able to find a compatible format. Thus the
color format needs to be manually selected for capture card sources
as well.
2024-02-17 19:28:28 -05:00
PatTheMav
e284a79b48 mac-avcapture: Update plugin to ObjC and modern APIs
Marks old AVFoundation capture source as deprecated.
2024-01-19 16:56:10 -05:00