Skip to content

Commit

Permalink
Merge pull request #38 from basler/feature/ace1_gige_introspection
Browse files Browse the repository at this point in the history
Feature/ace1 gige introspection
  • Loading branch information
thiesmoeller authored Mar 29, 2023
2 parents 880f32f + dbd3ef2 commit 78166a5
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 23 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
33 changes: 22 additions & 11 deletions gst-libs/gst/pylon/gstpylonfeaturewalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ void gst_pylon_camera_install_specs(const std::vector<GParamSpec*>& specs_list,
GObjectClass* oclass, gint& nprop);
std::vector<GParamSpec*> 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<std::string> propfilter_set = {
"Width",
Expand All @@ -84,25 +81,39 @@ static const std::unordered_set<std::string> 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 */
};

/* filter for selector nodes */
std::unordered_set<std::string> 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<std::string> selectorfilter_set = {
"DeviceLinkSelector",
};
return res;
}

/* filter for selectors and categories that are supported */
bool is_unsupported_selector(const std::string& feature_name) {
Expand Down Expand Up @@ -182,8 +193,8 @@ std::vector<std::string> 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;
Expand Down
9 changes: 9 additions & 0 deletions gst-libs/gst/pylon/gstpylonfeaturewalker.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,13 @@ 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);

/* filter for selectors that are not supported */
bool is_unsupported_selector(const std::string& feature_name);

#endif
36 changes: 25 additions & 11 deletions gst-libs/gst/pylon/gstpylonintrospection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#endif

#include "gstpylondebug.h"
#include "gstpylonfeaturewalker.h"
#include "gstpylonformatmapping.h"
#include "gstpylonintrospection.h"
#include "gstpylonobject.h"
Expand Down Expand Up @@ -278,7 +279,8 @@ static std::vector<GenApi::INode *> gst_pylon_get_valid_categories(
const std::vector<GenApi::INode *> &feature_list) {
std::vector<GenApi::INode *> 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);
}
}
Expand Down Expand Up @@ -392,6 +394,10 @@ std::vector<std::vector<GstPylonActions *>> 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());
Expand Down Expand Up @@ -439,6 +445,10 @@ std::vector<GstPylonActions *> 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());
Expand Down Expand Up @@ -519,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(
Expand All @@ -551,7 +561,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"));
Expand All @@ -562,7 +573,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"));
Expand All @@ -573,7 +585,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"));
Expand All @@ -583,7 +596,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"));
Expand Down
5 changes: 5 additions & 0 deletions gst-libs/gst/pylon/gstpylonparamfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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' ])
Expand Down

0 comments on commit 78166a5

Please sign in to comment.