24 Commits

Author SHA1 Message Date
David von Wrangel 09fe4a9a6e Move AVFoundation to parent directory (#677) 2026-01-08 18:36:41 +01:00
sean yu 03900dcb1b Add darwin runtime device observer support (#670)
* wip

* wip

* Organize

* Remove unnecessary change in camera_darwin.go filtering

* wip

* Make observer stop safe during startup

* wip IsAvailable impl

* Fix non-darwin builds

* Lock bg loop to main thread and add comment

* Remove fmt prints

* Simplify isAvailable; Add timeout for Read darwin

* Match comment with code

* Change to singleton pattern; Add clearer safer state machine states; Change language from Stop to Destroy; Add new error for when observer is unavailable;

* Add stubs for linux

* Move cancel() up so its not dead code sometimes

* Add stubs for Windows too

* Remove StopObserver usage

* Add camera tests

* Add device observer tests

* Fix multiple destroy calls bug; Call setup in start

* Improve isAvailable

* Improve string handling in device observer c

* Add error handling in example

* Add comment about setup vs start

* Rename and organize device observer darwin

* Explicitly case initial state for setup

* Fix potential destroy goroutine leak; Use only modern build tag; Return err not nil for stubs; Improve comments

* Close startDone channel on device observer stop not wait
2025-12-28 13:33:36 -08:00
sean yu 0e726eac75 Add context with timeout to darwin Read() calls (#674)
* Add timeout

* Clean
2025-12-10 22:30:30 -05:00
sean yu a9046e6ac1 Add fix that strips unexpected padding for NV12 frames (#556) 2024-03-01 12:23:05 -05:00
hexbabe 09b497727d Removed 'unreachable' else initialization and replaced with error indicating a wtf 2023-10-31 14:48:49 -04:00
hexbabe 7ae82fbda7 Remove old unnecessary macro 2023-10-31 14:48:49 -04:00
hexbabe 4477898296 Use new macro and also use @ available 2023-10-31 14:48:49 -04:00
hexbabe d5d41e9ca5 Switch to what I think is the correct preprocessor method 2023-10-31 14:48:49 -04:00
hexbabe 9fb24fb036 Use identifier conditional compilation (hackier) but might work and is still decently readable 2023-10-31 14:48:49 -04:00
hexbabe 1cd1b136cc This @available compile time directive really should work... confused 2023-10-31 14:48:49 -04:00
hexbabe 08fb3e8a48 Change code conditional to conditional compilation directive to avoid CI failure 2023-10-31 14:48:49 -04:00
hexbabe 4aae1bc842 Add conditional to choose types based on pre vs. post sonoma update 2023-10-31 14:48:49 -04:00
Ryan Boring e64f0d8697 Replace YUY2 with YUYV for Mac 2023-06-05 12:37:57 -04:00
martha-johnston 57c9ba0fc5 reveal Name var for driver.info 2023-03-31 16:54:09 -04:00
Valentin Cocaud 14db2b8130 allow to close the avfoundation device multiple time (#419)
Co-authored-by: Atsushi Watanabe <atsushi.w@ieee.org>
2022-08-01 09:50:47 +02:00
Valentin Cocaud 2af325d1a5 Fix closing a camera not closing the associated track (#414) 2022-07-27 14:15:17 +02:00
Eric Daniels 70261260cb Release AVFoundation ReadCloser on camera close (#375) 2022-03-28 06:57:15 -04:00
Markus Tzoe acd2cb992b Fixes pixel format mapping in avfoundation 2021-03-11 10:18:42 +09:00
Markus b5b0653697 Fixes avfoundation panic when using NV12 frame (#302)
* Fixes frame.FormatI420 in avfoundation

* Fixes avfoundation: frame size

which causes panic when using NV12

* avfoundation: uses CVPixelBufferGetDataSize() as frame buffer size

frame: fix frame size checking for YUY2, UYVY

* add camera_darwin_test
2021-02-21 12:13:04 -08:00
Lukas Herman 60b8e3ae1b Add logging for unincluded raw frame formats 2021-02-03 08:59:06 -08:00
Lukas Herman 7df3114cdc Add NV12 support for avfoundation 2021-02-03 08:59:06 -08:00
Andrei Nistor 5a1bd11087 Add AVBindFrameFormatYUY2 mapping in AVFoundationBind 2021-01-14 21:25:24 -08:00
Lukas Herman 559c6a13a1 Update readers to be memory pool friendly 2020-10-29 00:04:12 -07:00
Lukas Herman fad6c3ec4b Add darwin camera support
* Add avfoundation Go and C bindings
* Add darwin camera adapter
* Add darwin camera support to README
2020-06-03 10:18:06 -04:00