Skip to content

Api improvements for industrial cameras#135

Open
amingozzi wants to merge 9 commits into
Touseefelahi:masterfrom
onitgroup:api_improvements
Open

Api improvements for industrial cameras#135
amingozzi wants to merge 9 commits into
Touseefelahi:masterfrom
onitgroup:api_improvements

Conversation

@amingozzi

Copy link
Copy Markdown

Summary

This PR improves the reliability and correctness of the core GigE Vision stack across GVCP control, GVSP streaming, and GenICam integration.

Fundamental Changes

  • Hardened the GVCP control path by serializing command traffic, generating request IDs safely, correlating replies to the originating request, and avoiding stale socket state after timeouts.
  • Fixed stream startup and shutdown flow so receiver setup, control ownership, and rollback paths are handled more safely on failure.
  • Corrected frame reception issues in the default receiver, including buffer handoff, first-frame handling, receive-port selection, and final-packet behavior.
  • Replaced heuristic pixel and payload sizing with PFNC-based sizing so packed, monochrome, Bayer, and color formats are handled more accurately.
  • Fixed GenPort register and memory access behavior, including proper 32-bit address encoding, aligned access handling, and safe partial writes.
  • Improved GenICam type handling by making converter and SwissKnife evaluation stateless and enabling proper float-backed feature access.
  • Expanded the camera parameter API to support unified reads and writes for integer, boolean, and floating-point features.
  • Corrected protocol constants and reply parsing to improve standards alignment and device interoperability.

Notes

Most of the implementation work in this PR was done with AI-assisted coding. The current result is working as-is, but additional review, cleanup, and refinement may still improve maintainability and edge-case handling.

Impact

  • More reliable camera control under concurrent or timeout-prone conditions
  • More stable stream startup and frame delivery
  • More accurate payload sizing and raw frame allocation
  • Better compatibility with vendor XML definitions and converter-backed GenICam features
  • Cleaner public API for camera parameter access

Validation

  • dotnet build GigeVision.Core.csproj -c Debug succeeded

If you want a slightly more polished phrasing for the AI note, use this instead:

Most of the changes in this PR were produced with AI assistance. The implementation is functional in its current state, but further refinement and manual review are recommended to improve robustness and maintainability.

amingozzi and others added 9 commits April 27, 2026 11:09
…r management

- Updated image allocation to use computed raw image size instead of height and width.
- Introduced logic to skip processing until the next frame boundary to prevent premature frame handling.
- Enhanced final packet handling to correctly account for exact-multiple payload sizes.
- Improved frame loss reporting with detailed messages on missing or extra packets.
- Ensured the correct buffer is published to the FrameReady event to avoid data corruption.

Update GigeVision.OpenCV project versioning for local development

- Changed version from 1.1 to 1.1-local for local builds.
- Updated GigeVision.Core package reference to version 2.7.3-local for compatibility with local changes.

Enhance README with usage examples and API details

- Expanded basic usage section with clear examples for discovering cameras, reading and writing registers, and streaming.
- Added details on the unified parameter API for better clarity on camera control.
- Included examples for setting camera parameters and receiving frames.

Create changes.md to document implemented fixes and improvements

- Summarized key changes made during the GigeVision.Core audit, including improvements to GVCP control, stream reception, pixel format handling, and camera control APIs.

Add examples.md for minimal working examples

- Provided a collection of small examples demonstrating the current APIs, including opening a camera, reading and setting parameters, and receiving frames.

Document improvements in improvements.md

- Detailed findings from the GigeVision.Core audit, highlighting critical issues, suggested improvements, and additional cleanup items.
- Introduced FrameReadyWithInfo event to provide per-frame metadata (timestamp and frame ID).
- Added GvspFrameInfo struct to encapsulate frame metadata.
- Implemented PixelFormatRegistry for vendor-specific pixel formats.
- Enhanced StreamReceiverBase to handle chunk data mode and extended frame sizes.
- Documented chunk data mode implementation in chunkMode.md.

Co-authored-by: Copilot <copilot@github.com>
…xelFormat enum to uint

Co-authored-by: Copilot <copilot@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant