Skip to content

v0.5.0

Latest

Choose a tag to compare

@vladimirvivien vladimirvivien released this 22 Mar 22:56
· 12 commits to main since this release
86ee959

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 calling Start() before selecting a
    streaming API
  • Start() now handles buffer queueing and StreamOn directly, without requiring a streaming mode to be
    pre-selected
  • GetOutput() / GetFrames() can be called after Start()
  • 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_CMD and VIDIOC_DECODER_CMD ioctls including START, STOP, PAUSE, RESUME, and FLUSH operations
  • 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/CAPTURE queue 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

Full Changelog: 0.4.0...v0.5.0