From 41d98e4ab6a987efa8c4588fcd774f7b596226da Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Mon, 27 Mar 2023 11:53:54 +0200 Subject: [PATCH 1/8] add alternative category name for sequencer --- gst-libs/gst/pylon/gstpylonfeaturewalker.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gst-libs/gst/pylon/gstpylonfeaturewalker.cpp b/gst-libs/gst/pylon/gstpylonfeaturewalker.cpp index aa6fb506..8666eed0 100644 --- a/gst-libs/gst/pylon/gstpylonfeaturewalker.cpp +++ b/gst-libs/gst/pylon/gstpylonfeaturewalker.cpp @@ -84,6 +84,7 @@ static const std::unordered_set categoryfilter_set = { "FileAccessControl", /* has to be implemented in access library */ "EventControl", /* disable full event section until mapped to gst events/msgs */ + "SequenceControl", /* sequencer control relies on cmd feature */ "SequencerControl", /* sequencer control relies on cmd feature */ "MultipleROI", /* workaround skip to avoid issues with ace2/dart2 FIXME: this has to be fixed in feature walker */ From 5d31d11c9a483778dd3e0d739372e1272f4d6cf4 Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Mon, 27 Mar 2023 11:54:47 +0200 Subject: [PATCH 2/8] check for property creation failure --- gst-libs/gst/pylon/gstpylonparamfactory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/pylon/gstpylonparamfactory.cpp b/gst-libs/gst/pylon/gstpylonparamfactory.cpp index 1fc2c0c6..47441d73 100644 --- a/gst-libs/gst/pylon/gstpylonparamfactory.cpp +++ b/gst-libs/gst/pylon/gstpylonparamfactory.cpp @@ -282,5 +282,10 @@ GParamSpec *GstPylonParamFactory::GstPylonParamFactory::make_param( throw Pylon::GenericException(msg, __FILE__, __LINE__); } + if (!spec) { + Pylon::String_t msg = "Property creation failed for " + node->GetName(); + throw Pylon::GenericException(msg, __FILE__, __LINE__); + } + return spec; } From a11e164ea4dff4cf54b09ce031f20cc1fbb6db01 Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Mon, 27 Mar 2023 13:19:42 +0200 Subject: [PATCH 3/8] apply suppressed categories in introspection --- gst-libs/gst/pylon/gstpylonfeaturewalker.h | 6 ++++++ gst-libs/gst/pylon/gstpylonintrospection.cpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/pylon/gstpylonfeaturewalker.h b/gst-libs/gst/pylon/gstpylonfeaturewalker.h index 36fd007c..edc84677 100644 --- a/gst-libs/gst/pylon/gstpylonfeaturewalker.h +++ b/gst-libs/gst/pylon/gstpylonfeaturewalker.h @@ -47,4 +47,10 @@ class GstPylonFeatureWalker { GenApi::INode* node, GenApi::INode** selector_node); }; +/* filter for features that are not supported */ +bool is_unsupported_feature(const std::string& feature_name); + +/* filter for categories that are not supported */ +bool is_unsupported_category(const std::string& category_name); + #endif diff --git a/gst-libs/gst/pylon/gstpylonintrospection.cpp b/gst-libs/gst/pylon/gstpylonintrospection.cpp index 098959c5..150cb85a 100644 --- a/gst-libs/gst/pylon/gstpylonintrospection.cpp +++ b/gst-libs/gst/pylon/gstpylonintrospection.cpp @@ -35,6 +35,7 @@ #endif #include "gstpylondebug.h" +#include "gstpylonfeaturewalker.h" #include "gstpylonformatmapping.h" #include "gstpylonintrospection.h" #include "gstpylonobject.h" @@ -278,7 +279,8 @@ static std::vector gst_pylon_get_valid_categories( const std::vector &feature_list) { std::vector valid_features; for (const auto &feature : feature_list) { - if (gst_pylon_find_node_category(feature) != "MultipleROI") { + const std::string feature_category = gst_pylon_find_node_category(feature); + if (!is_unsupported_category(feature_category)) { valid_features.push_back(feature); } } From 9d93bd88ce7da0d70eb77b637e0c7d3d6431cd25 Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Mon, 27 Mar 2023 13:20:43 +0200 Subject: [PATCH 4/8] handle Autofunction ROI and AOI --- gst-libs/gst/pylon/gstpylonintrospection.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/pylon/gstpylonintrospection.cpp b/gst-libs/gst/pylon/gstpylonintrospection.cpp index 150cb85a..9aa28293 100644 --- a/gst-libs/gst/pylon/gstpylonintrospection.cpp +++ b/gst-libs/gst/pylon/gstpylonintrospection.cpp @@ -553,7 +553,8 @@ void gst_pylon_find_limits(GenApi::INode *node, T &minimum_under_all_settings, maximum_under_all_settings = sensor_height.GetValue() - height.GetInc(); return; } - } else if (node->GetName() == "AutoFunctionROIOffsetX") { + } else if (node->GetName() == "AutoFunctionROIOffsetX" || + node->GetName() == "AutoFunctionAOIOffsetX") { GST_DEBUG("Apply AutoFunctionROIOffsetX feature workaround"); Pylon::CIntegerParameter sensor_width( node->GetNodeMap()->GetNode("SensorWidth")); @@ -564,7 +565,8 @@ void gst_pylon_find_limits(GenApi::INode *node, T &minimum_under_all_settings, maximum_under_all_settings = sensor_width.GetValue() - width.GetInc(); return; } - } else if (node->GetName() == "AutoFunctionROIOffsetY") { + } else if (node->GetName() == "AutoFunctionROIOffsetY" || + node->GetName() == "AutoFunctionAOIOffsetY") { GST_DEBUG("Apply AutoFunctionROIOffsetY feature workaround"); Pylon::CIntegerParameter sensor_height( node->GetNodeMap()->GetNode("SensorHeight")); @@ -575,7 +577,8 @@ void gst_pylon_find_limits(GenApi::INode *node, T &minimum_under_all_settings, maximum_under_all_settings = sensor_height.GetValue() - height.GetInc(); return; } - } else if (node->GetName() == "AutoFunctionROIWidth") { + } else if (node->GetName() == "AutoFunctionROIWidth" || + node->GetName() == "AutoFunctionAOIWidth") { GST_DEBUG("Apply AutoFunctionROIWidth feature workaround"); Pylon::CIntegerParameter sensor_width( node->GetNodeMap()->GetNode("SensorWidth")); @@ -585,7 +588,8 @@ void gst_pylon_find_limits(GenApi::INode *node, T &minimum_under_all_settings, maximum_under_all_settings = sensor_width.GetValue(); return; } - } else if (node->GetName() == "AutoFunctionROIHeight") { + } else if (node->GetName() == "AutoFunctionROIHeight" || + node->GetName() == "AutoFunctionAOIHeight") { GST_DEBUG("Apply AutoFunctionROIHeight feature workaround"); Pylon::CIntegerParameter sensor_height( node->GetNodeMap()->GetNode("SensorHeight")); From 99ab06caa62772d9b1bf8ad8d7f4b82094e7868b Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Mon, 27 Mar 2023 13:45:19 +0200 Subject: [PATCH 5/8] filter event data nodes --- gst-libs/gst/pylon/gstpylonfeaturewalker.cpp | 32 +++++++++++++------- gst-libs/gst/pylon/gstpylonfeaturewalker.h | 3 ++ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/gst-libs/gst/pylon/gstpylonfeaturewalker.cpp b/gst-libs/gst/pylon/gstpylonfeaturewalker.cpp index 8666eed0..71f81caa 100644 --- a/gst-libs/gst/pylon/gstpylonfeaturewalker.cpp +++ b/gst-libs/gst/pylon/gstpylonfeaturewalker.cpp @@ -56,9 +56,6 @@ void gst_pylon_camera_install_specs(const std::vector& specs_list, GObjectClass* oclass, gint& nprop); std::vector gst_pylon_camera_handle_node( GenApi::INode* node, GstPylonParamFactory& param_factory); -bool is_unsupported_feature(const std::string& feature_name); -bool is_unsupported_category(const std::string& category_name); -bool is_unsupported_selector(const std::string& feature_name); static const std::unordered_set propfilter_set = { "Width", @@ -90,20 +87,33 @@ static const std::unordered_set categoryfilter_set = { FIXME: this has to be fixed in feature walker */ }; +/* filter for selector nodes */ +std::unordered_set selectorfilter_set = { + "DeviceLinkSelector", +}; + /* filter for features that are not supported */ bool is_unsupported_feature(const std::string& feature_name) { + /* check on exception list */ return propfilter_set.find(feature_name) != propfilter_set.end(); } /* filter for categories that are not supported */ bool is_unsupported_category(const std::string& category_name) { - return categoryfilter_set.find(category_name) != categoryfilter_set.end(); -} + bool res = categoryfilter_set.find(category_name) != categoryfilter_set.end(); + + if (!res) { + /* check on end pattern to cover events */ + std::string event_suffix = "EventData"; + if (category_name.length() >= event_suffix.length()) { + res |= 0 == category_name.compare( + category_name.length() - event_suffix.length(), + event_suffix.length(), event_suffix); + } + } -/* filter for selector nodes */ -std::unordered_set selectorfilter_set = { - "DeviceLinkSelector", -}; + return res; +} /* filter for selectors and categories that are supported */ bool is_unsupported_selector(const std::string& feature_name) { @@ -183,8 +193,8 @@ std::vector GstPylonFeatureWalker::process_selector_features( throw Pylon::GenericException(error_msg.c_str(), __FILE__, __LINE__); } - /* If the feature has no selectors then it is a "direct" feature, it does not - * depend on any other selector + /* If the feature has no selectors then it is a "direct" feature, it does + * not depend on any other selector */ if (selectors.empty()) { is_direct_feature = true; diff --git a/gst-libs/gst/pylon/gstpylonfeaturewalker.h b/gst-libs/gst/pylon/gstpylonfeaturewalker.h index edc84677..7fc6e492 100644 --- a/gst-libs/gst/pylon/gstpylonfeaturewalker.h +++ b/gst-libs/gst/pylon/gstpylonfeaturewalker.h @@ -53,4 +53,7 @@ bool is_unsupported_feature(const std::string& feature_name); /* filter for categories that are not supported */ bool is_unsupported_category(const std::string& category_name); +/* filter for selectors that are not supported */ +bool is_unsupported_selector(const std::string& feature_name); + #endif From 146f98bde3e5ec16345fe58b935ed2c040ff9bbd Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Mon, 27 Mar 2023 13:58:15 +0200 Subject: [PATCH 6/8] comment about skipped command nodes in introspection --- gst-libs/gst/pylon/gstpylonintrospection.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst-libs/gst/pylon/gstpylonintrospection.cpp b/gst-libs/gst/pylon/gstpylonintrospection.cpp index 9aa28293..b57a23a0 100644 --- a/gst-libs/gst/pylon/gstpylonintrospection.cpp +++ b/gst-libs/gst/pylon/gstpylonintrospection.cpp @@ -394,6 +394,10 @@ std::vector> gst_pylon_create_set_value_actions( } break; } + case GenApi::intfICommand: { + /* command node feature modification is ignored */ + continue; + } default: std::string msg = "No test for node " + std::string(node->GetName().c_str()); @@ -441,6 +445,10 @@ std::vector gst_pylon_create_reset_value_actions( param, param.GetValue())); break; } + case GenApi::intfICommand: { + /* command node feature modification is ignored */ + continue; + } default: std::string msg = "No test for node " + std::string(node->GetName().c_str()); From bc5488bd874a43db91d86908a1cb9fc196f27d21 Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Tue, 28 Mar 2023 10:58:28 +0200 Subject: [PATCH 7/8] add heuristic to cover blacklevel and exposuretime --- gst-libs/gst/pylon/gstpylonintrospection.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/pylon/gstpylonintrospection.cpp b/gst-libs/gst/pylon/gstpylonintrospection.cpp index b57a23a0..edae9a00 100644 --- a/gst-libs/gst/pylon/gstpylonintrospection.cpp +++ b/gst-libs/gst/pylon/gstpylonintrospection.cpp @@ -529,16 +529,16 @@ void gst_pylon_find_limits(GenApi::INode *node, T &minimum_under_all_settings, * dependency count * FIXME: refactor this into a filter class */ - if (node->GetName() == "ExposureTime" && - available_parent_inv.end() != - std::find_if(available_parent_inv.begin(), available_parent_inv.end(), - [](const GenApi::INode *n) { - return n->GetName() == "BslExposureTimeMode"; - })) { + if (node->GetName() == "ExposureTime") { GST_DEBUG("Apply ExposureTime feature workaround"); minimum_under_all_settings = 1.0; maximum_under_all_settings = 1e+07; return; + } else if (node->GetName() == "BlackLevel") { + GST_DEBUG("Apply BlackLevel 12bit feature workaround"); + minimum_under_all_settings = 0; + maximum_under_all_settings = 4095; + return; } else if (node->GetName() == "OffsetX") { GST_DEBUG("Apply OffsetX feature workaround"); Pylon::CIntegerParameter sensor_width( From dbd3ef2302e3fc124c3c2b9543dc1be28c3134f8 Mon Sep 17 00:00:00 2001 From: Thies Moeller Date: Mon, 27 Mar 2023 14:11:36 +0200 Subject: [PATCH 8/8] update to 0.6.1 --- CHANGELOG.md | 11 +++++++++++ meson.build | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f7f631d..a571a697 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ # Changelog All notable changes to this project will be documented in this file. +## [0.6.1] - 2023-03-27 + +### Changed +- Filter event data nodes + * exclude from registration until supported in gstreamer + +### Fixed +- Process feature limits for ace gige + * extend heuristics + * fixes #37 + ## [0.6.0] - 2023-03-24 ### Added diff --git a/meson.build b/meson.build index 333ae8c9..42945395 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gst-plugin-pylon', 'c', 'cpp', - version : '0.6.0', + version : '0.6.1', meson_version : '>= 0.61', default_options : [ 'warning_level=1', 'buildtype=debugoptimized' ])