702 Commits

Author SHA1 Message Date
sean yu 3d4fceab3d (3/3) Fix concurrency webcam windows (#684)
* Import wmcodecdsp and try to use their nv12 const

* Remove ifndef

* Enhance getCameraName function to retrieve friendly name from IPropertyBag, with fallback to display name. Update LDFLAGS in camera_windows.go to include oleaut32 library.

* Don't mistake label for friendly name

* Initialize COM for thread safety in Open and VideoRecord methods of camera_windows.go

* Refactor camera handling in camera_windows.go and camera_windows.cpp

- Introduced mutex for thread safety in camera struct to protect shared resources.
- Updated Open method to initialize done channel and manage camera state.
- Enhanced Close method to ensure proper cleanup and prevent double closing.
- Improved resolution listing logic in camera_windows.cpp by ensuring media types are freed correctly.
- Changed memory deletion from single to array deletion for camera properties.

* Fix issues post-rebase

* Refactor Close method

* Transfer golang buffer management to c to avoid gc

* Fix race condition in imageCallback by fixing unlock code location
v0.10.0
2026-04-21 09:25:31 -04:00
sean yu 63c09cb1f4 Expose LogLevel param for x264 codec (#685)
* Suppress noisy x264 [info] log messages and expose LogLevel param

x264's default log level (X264_LOG_INFO) causes it to write encoder
stats, CPU capabilities, and profile info to stderr. When used with
viam-server, these appear as warn-level logs and create noise.

Default to LogWarning to suppress info messages while preserving
actual warnings and errors. Expose a LogLevel field on Params so
consumers can control the verbosity themselves.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Default to info to avoid breaking change; Fix comment

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 10:39:48 -04:00
sean yu 9a3d191368 (2/3) Fix windows camera names (#683)
* Add NV12 support

* Fix camera resolution listing by supporting FORMAT_VideoInfo2 in addition to FORMAT_VideoInfo. This change allows for better compatibility with various video formats by correctly retrieving width, height, and compression details from both format types (NV12 and YUY2)

* Add support for configuring video capture pin format in open method

* Import wmcodecdsp and try to use their nv12 const

* Remove ifndef

* Use subtype.Data1 instead of biCompression

* Enhance getCameraName function to retrieve friendly name from IPropertyBag, with fallback to display name. Update LDFLAGS in camera_windows.go to include oleaut32 library.

* Don't mistake label for friendly name

* Improve camera device name handling and memory management in Windows driver. Added checks for valid device names and initialized camera lists to prevent memory issues. Enhanced resolution listing by ensuring proper media type handling and freeing resources appropriately.
2026-03-17 09:02:45 -04:00
sean yu d8f14db1ef (1/3) Add NV12 frame format support for windows (#682)
* Add NV12 support

* Fix camera resolution listing by supporting FORMAT_VideoInfo2 in addition to FORMAT_VideoInfo. This change allows for better compatibility with various video formats by correctly retrieving width, height, and compression details from both format types (NV12 and YUY2)

* Add support for configuring video capture pin format in open method

* Import wmcodecdsp and try to use their nv12 const

* Remove ifndef
2026-03-02 06:40:45 -05:00
sean yu 932e23af03 Add conditional build tag to exclude microphones for camera-only builds (#679)
* Add tag

* Add nomicrophone build tag for optional microphone support

- Changed from platform-specific (!windows) to opt-out build tag (!nomicrophone)
- Microphone support included by default (non-breaking)
- Use -tags nomicrophone to exclude when malgo deps unavailable
- Useful for cross-compilation and minimal builds
- Renamed microphone_windows.go to microphone_stub.go for clarity

* Update README
v0.9.4
2026-02-05 13:30:34 -05:00
sean yu 85194b499f Fix null camera enum windows (#681) v0.9.3 2026-02-04 08:34:58 -05:00
sean yu 0bee5c1f8f Fix av1 SVT_AV1_PRED_LOW_DELAY_B deprecation in their latest release (4.0.0+) (#680)
* Change

* Remove

* Polyfill based on docs recommendation

* Update comment

* Update pkg/codec/svtav1/bridge.h comment to actual repo

Co-authored-by: Atsushi Watanabe <atsushi.w@ieee.org>

---------

Co-authored-by: Atsushi Watanabe <atsushi.w@ieee.org>
2026-02-03 14:03:16 -05:00
Jo Turk 347f2ddb0e Add .goreleaser.yml v0.9.2 2026-01-08 19:47:31 +02:00
David von Wrangel 09fe4a9a6e Move AVFoundation to parent directory (#677) v0.9.1 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
v0.9.0
2025-12-28 13:33:36 -08:00
renovate[bot] 7d8cbdbf23 fix(deps): update module github.com/pion/webrtc/v4 to v4.1.8 (#673)
* fix examples/ tidy from actions bump

* fix(deps): update module github.com/pion/webrtc/v4 to v4.1.8

Generated by Renovate Bot

---------

Co-authored-by: philipch07 <philipch07@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 00:25:57 -05:00
Joe Turki 2f807f66f9 Add release workflow 2025-12-11 10:13:29 +02:00
sean yu 0e726eac75 Add context with timeout to darwin Read() calls (#674)
* Add timeout

* Clean
v0.8.0
2025-12-10 22:30:30 -05:00
renovate[bot] 7b76fa0ce4 chore(deps): update actions/checkout action to v6 (#669)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-25 10:03:37 +09:00
renovate[bot] 98fa96e863 fix(deps): update module github.com/pion/rtp to v1.8.25 (#664)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-10 10:27:10 +09:00
renovate[bot] d8fdd3e9da fix(deps): update module github.com/pion/webrtc/v4 to v4.1.6 (#665)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-10 09:57:56 +09:00
Atsushi Watanabe 810921d448 Add SVT-AV1 codec (#660) 2025-11-10 09:26:21 +09:00
Atsushi Watanabe 5aad703236 Tidy examples/go.mod (#663)
- Run go mod tidy under examples
- Automatically tidy examples/go.mod on Renovate PR
2025-10-23 13:46:16 +09:00
renovate[bot] e15e8f6880 fix(deps): update module github.com/pion/rtcp to v1.2.16 (#658)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-22 18:57:27 +09:00
renovate[bot] dd99235d6f fix(deps): update module github.com/pion/rtp to v1.8.24 (#659)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-22 18:51:47 +09:00
Haily Nguyen a5e2538787 Revert "Add VPX wrappers (#652)" (#662)
This reverts commit a68a5ba4a6.
2025-10-22 02:45:06 -07:00
Haily Nguyen a68a5ba4a6 Add VPX wrappers (#652)
* Add VPX improvements from pion-mediadevices

- Add vpx_image.go: VpxImage wrapper for vpx_image_t with convenient methods
- Move BitrateTracker to vpx package: More specific to VPX codec usage
- Add bitrate_tracker_test.go: Test coverage for VPX-specific bitrate tracking
- Remove generic codec-level BitrateTracker: Replaced by VPX-specific version

These changes improve VPX codec functionality and organization by:
1. Adding image handling utilities specific to VPX
2. Providing better bitrate tracking for VPX codecs
3. Improving code organization by moving VPX-specific code to VPX package

* Revert bitrate tracker changes

- Remove vpx-specific bitrate tracker files
- Restore original codec-level bitrate tracker and test
- Keep only the vpx_image.go addition from pion-mediadevices

* Add comprehensive unit tests for VpxImage

- Add vpx_image_test.go with full test coverage for VpxImage wrapper
- Test interface compliance and constructor behavior
- Test nil pointer handling (documents expected panic behavior)
- Test common video format constants and plane indices
- All tests pass and integrate with existing VPX test suite

This improves test coverage for the new VpxImage utility from pion-mediadevices.

* Add comprehensive unit tests for VpxImage

- Add vpx_image_test.go with full test coverage for VpxImage wrapper
- Test interface compliance and constructor behavior
- Test nil pointer handling (documents expected panic behavior)
- Test common video format constants and plane indices
- All tests pass and integrate with existing VPX test suite

This improves test coverage for the new VpxImage utility from pion-mediadevices.
2025-10-09 16:15:33 -07:00
philipch07 5a0a5b00d4 Use isZero for reflection (#655) 2025-10-07 16:36:03 -04:00
renovate[bot] d864136608 fix(deps): update module github.com/gen2brain/malgo to v0.11.24 (#651)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-07 19:11:49 +03:00
Joe Turki 9a9a5631ed Update Go version in tests (#654) 2025-10-07 18:45:16 +03:00
renovate[bot] 799d1efb81 fix(deps): update module github.com/pion/webrtc/v4 to v4.1.5 (#642)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-07 18:17:41 +03:00
renovate[bot] 92dfa9bc75 fix(deps): update module github.com/pion/interceptor to v0.1.41 (#653)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-07 18:15:44 +03:00
renovate[bot] 077ff4c0f2 fix(deps): update module github.com/pion/rtp to v1.8.23 (#641)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-07 18:05:59 +03:00
renovate[bot] f5fbc53145 chore(deps): update actions/checkout action to v5 (#643)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-07 18:05:27 +03:00
Lei Kang cb394eb4c5 resolve comment v0.7.2 2025-09-17 16:50:52 -07:00
Atsushi Watanabe e9f3dc20b6 Fix reading multiple decoded frames 2025-09-17 16:50:52 -07:00
Lei Kang 0710906fc7 fix the test 2025-09-17 16:50:52 -07:00
Lei Kang 7fdafa9598 add codec decoder interface 2025-09-17 16:50:52 -07:00
Lei Kang 5a19127623 add return error code 2025-09-17 16:50:52 -07:00
Lei Kang 8ca6903676 add null pointer from C 2025-09-17 16:50:52 -07:00
Lei Kang de517d790b wrap vpx_image into a struct 2025-09-17 16:50:52 -07:00
Lei Kang 81cfc047d5 add vpx decoder 2025-09-17 16:50:52 -07:00
renovate[bot] 1406108fb2 fix(deps): update module github.com/stretchr/testify to v1.11.1
Generated by Renovate Bot
2025-09-14 22:46:53 -04:00
renovate[bot] a2a211857c chore(deps): update actions/setup-go action to v6
Generated by Renovate Bot
2025-09-14 22:41:32 -04:00
philipch07 c0721738c4 Apply go modernize (#650) 2025-09-14 21:55:37 -04:00
Leo (Lei) Kang 6047a32ea0 [VPX] vpx dynamic encoding (#647)
* Add vp8 decoder and dynamic vp8 decoding

* Add QPController

* change parameters into const

* move decoder into another PR

* use explicit parameter name
2025-09-04 14:33:07 -07:00
Leo (Lei) Kang 60bf158757 [CODEC] Add encoder bitrate tracker (#646)
add encoder bitrate tracker
2025-09-03 15:55:37 -07:00
renovate[bot] c4fd28c7df fix(deps): update github.com/kbinani/screenshot digest to 089614a (#640)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 11:33:19 +09:00
renovate[bot] c79e16706b fix(deps): update module github.com/pion/logging to v0.2.4 (#639)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 11:31:48 +09:00
renovate[bot] 89420ae84d fix(deps): update module github.com/pion/rtp to v1.8.19 (#632)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 11:31:16 +09:00
renovate[bot] 4db71e5b52 fix(deps): update module github.com/pion/webrtc/v4 to v4.1.2 (#637)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-16 10:38:39 +08:00
Jackie Li a45a5e50cd fix track.unbind panic (#634)
Fix #633

Here the signalCh could have been closed by another goroutine, we should
use returned signalCh from `track.removeActivePeerConnection()` to close
the channel.

Actually, I don't know why we need to close the signalCh, we're using it
to send over the doneCh, why ever close it?
2025-06-13 13:31:00 +08:00
renovate[bot] d90220699e fix(deps): update module github.com/pion/webrtc/v4 to v4.1.1 (#629)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-09 15:20:59 +08:00
renovate[bot] 71deb52047 fix(deps): update module github.com/pion/interceptor to v0.1.39 (#628)
Generated by Renovate Bot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-09 15:12:30 +08:00
Jingyang Kang 84ccb15157 Align H265 payloadType in NewRTPH265Codec with RegisterDefaultCodecs (#631) 2025-06-01 23:37:30 +08:00