Skip to content

Adding better auto caps negotiation based on the ZED SDK API feat.#91

Open
adujardin wants to merge 6 commits intomasterfrom
auto_size_caps
Open

Adding better auto caps negotiation based on the ZED SDK API feat.#91
adujardin wants to merge 6 commits intomasterfrom
auto_size_caps

Conversation

@adujardin
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements improved automatic capabilities negotiation for GStreamer ZED camera source elements (zedsrc and zedxonesrc), leveraging the ZED SDK API to dynamically detect supported resolutions, formats, and frame rates based on the connected camera model.

Changes:

  • Adds AUTO resolution mode that selects the best resolution for requested FPS based on camera model capabilities
  • Implements flexible output resolution negotiation with ranged caps for non-NVMM formats (BGRA, BGR, GRAY8)
  • Adds fixate callback to handle caps negotiation during pipeline setup
  • Removes deprecated async-image-retrieval property from zedsrc
  • Changes default camera FPS from 15 to 30 and default resolution to AUTO
  • Updates SDK version requirement to 5.2

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
gst-zedxone-src/gstzedxonesrc.h Adds resolution and format tracking fields for flexible output negotiation
gst-zedxone-src/gstzedxonesrc.cpp Implements AUTO resolution detection, ranged caps, multi-format support (BGRA/BGR/GRAY8), and dynamic FPS validation
gst-zed-src/gstzedsrc.h Adds resolution and format tracking fields, removes async_image_retrieval property
gst-zed-src/gstzedsrc.cpp Implements AUTO resolution detection, ranged caps, multi-format support, dynamic FPS validation, and removes async_image_retrieval property/parameter
README.md Updates SDK version to 5.2, documents new default FPS (30), corrects coordinate-system enum name, adds new properties documentation
.ci/test.sh Adds comprehensive test suites for AUTO resolution negotiation, FPS clamping, and downstream resize scenarios for both zedsrc and zedxonesrc

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gst-zed-src/gstzedsrc.cpp
Comment thread gst-zedxone-src/gstzedxonesrc.cpp Outdated
Comment thread gst-zed-src/gstzedsrc.cpp
Comment thread gst-zedxone-src/gstzedxonesrc.cpp
Comment thread gst-zedxone-src/gstzedxonesrc.cpp
@adujardin adujardin changed the title Adding better auto caps negociation based on the ZED SDK API feat. Adding better auto caps negotiation based on the ZED SDK API feat. Feb 12, 2026
Comment thread gst-zed-src/gstzedsrc.cpp Outdated
auto devices = sl::Camera::getDeviceList();
if (devices.empty()) {
GST_WARNING("No ZED cameras detected, falling back to ZED2");
return sl::MODEL::ZED2;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why fall back to ZED 2 instead of returning an error?

Comment thread gst-zed-src/gstzedsrc.cpp Outdated
if (src->output_width > 0 && src->output_height > 0) {
gst_structure_fixate_field_nearest_int(structure, "width", src->output_width);
gst_structure_fixate_field_nearest_int(structure, "height", src->output_height);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not happen, but I think you should add an "else" branch to raise an error if the width or height is null

Comment thread gst-zedxone-src/gstzedxonesrc.cpp Outdated
auto devices = sl::CameraOne::getDeviceList();
if (devices.empty()) {
GST_WARNING("No ZED X One cameras detected, falling back to ZED_XM");
return sl::MODEL::ZED_XM;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like for zedsrc, why a default model instead of an error?

Comment thread gst-zedxone-src/gstzedxonesrc.cpp Outdated
if (src->_outputWidth > 0 && src->_outputHeight > 0) {
gst_structure_fixate_field_nearest_int(structure, "width", src->_outputWidth);
gst_structure_fixate_field_nearest_int(structure, "height", src->_outputHeight);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an else to return an error if one or both are NULL?

- Force close() in finalize() for abnormal shutdown safety
- Return MODEL::LAST instead of blind ZED2/ZED_XM fallback
- Validate isCameraOne() on SN/ID matches (bugged getDeviceList)
- Fail early when no mono camera found instead of opening stereo
- Guard resolve_auto_resolution against no-camera-detected
- Always fixate width/height unconditionally
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 30 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment on lines +438 to 440
Boolean. Default: false
od-max-range : Maximum Detection Range
flags: readable, writable
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate property documentation: od-max-range appears twice with different types (Boolean on line 438, Float on line 441). Remove the Boolean entry on lines 436-438 as the Float type is correct for a range property.

Suggested change
Boolean. Default: false
od-max-range : Maximum Detection Range
flags: readable, writable

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants