This release primarily introduces a new fix to the Device API which was forcing an awkward call sequence (see #95). The release also introduces many new features and enhancements.
Fixes
- Fixes
Start()/GetOutput()/GetFrames()ordering issue (#95) — allow callingStart()before selecting a
streaming API Start()now handles buffer queueing andStreamOndirectly, without requiring a streaming mode to be
pre-selectedGetOutput()/GetFrames()can be called afterStart()- Calling the wrong streaming API (e.g., GetFrames() after GetOutput()) now panics
End-to-end Testin Enhancements
Overhaul integration test infrastructure to support both real devices and v4l2loopback emulation cleanly. This allows tests to run on a device such as Raspberry Pi with a camera attached or in a CI/CD environment. End-to-end integration tests are important to catch issues that unit tests are not capable of revealing.
sudo modprobe v4l2loopback devices=2 video_nr=42,43 card_label="go4vl_test_1,go4vl_test_2" exclusive_caps=0
go test -v -tags=integration ./test/... -args -use-device-emulation=/dev/video42,/dev/video43
New test flags
-use-device=auto— auto-discover real V4L2 devices-use-device=/dev/video0— use specific real device-use-device-emulation=auto— auto-discover or load v4l2loopback-use-device-emulation=/dev/video42,/dev/video43— use specific loopback devices- No flags — auto-detect (tries loopback first, then real devices)
New Hardware Codecs
Implement new V4L2 codec support for hardware-accelerated video encoding/decoding:
- Codec Commands: Full support for
VIDIOC_ENCODER_CMDandVIDIOC_DECODER_CMDioctlsincludingSTART,STOP,PAUSE,RESUME, andFLUSHoperations - State Machine: codec state machine (Uninitialized → Initialized → Streaming → Draining → Stopped)
with validation for legal transitions - M2M Device Support: functions for memory-to-memory codec devices with dual
OUTPUT/CAPTUREqueue management - Dynamic Resolution Changes: Decoder support for handling mid-stream resolution changes via V4L2 events
- High-Level Abstractions: Channel-based Encoder and Decoder types in the device package with simple feed/receive
patterns
What's Changed
- issue-108 - chore: Implement missing data formats and flags by @vladimirvivien in #109
- issue-110: Hardware-supported encodeing/decoding by @vladimirvivien in #111
Full Changelog: 0.4.0...v0.5.0