Skip to content

Commit 8c03e83

Browse files
committed
fix param dump bug by changing decoder param sep from . to _
1 parent b17b536 commit 8c03e83

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ command to find out what the proper parameter path is.
105105
to the decoder, like ``foo:bar,foobar:baz``. Default: empty string.
106106
- ``decoder_measure_performance`` enables performance
107107
measurements. Default: false.
108-
- ``decoders.<codec>.<av_source_pixel_format>.<cv_bridge_target_format>.<original_ros_encoding>`` specifies the decoders to use for a given FFMPEGPacket encoding.
109-
If no decoders are specified for the full encoding, a less specific parameter will be tested, i.e. ``decoders.<codec>.<av_source_pixel_format>.<cv_bridge_target_format>``, then ``decoders.<codec>.<av_source_pixel_format>``, and finally ``decoders.<codec>``.
108+
- ``decoders.<codec>_<av_source_pixel_format>_<cv_bridge_target_format>_<original_ros_encoding>`` specifies the decoders to use for a given FFMPEGPacket encoding.
109+
If no decoders are specified for the full encoding, a less specific parameter will be tested, i.e. ``decoders.<codec>_<av_source_pixel_format>_<cv_bridge_target_format>``, then ``decoders.<codec>_<av_source_pixel_format>``, and finally ``decoders.<codec>``.
110110
If all parameters are found to be empty, the Subscriber plugin will try to decode with a default set of libav decoders that support the appropriate codec.
111111

112112
All parameters are prefixed again by the image topic and the transport, just like for the publisher node.

‎src/ffmpeg_subscriber.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ std::string FFMPEGSubscriber::getDecodersFromMap(const std::string & encoding)
122122
for (int i = static_cast<int>(x.size()); i > 0; --i) {
123123
std::string p_name;
124124
for (int j = 0; j < i; j++) {
125-
p_name += "." + x[j];
125+
p_name += (j == 0 ? "." : "_") + x[j];
126126
}
127127
ParameterDefinition pdef{
128128
PValue(""), PDescriptor()

‎test/test_1.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void lossless_compression_test(
192192
auto sub_node = std::make_shared<TestSubscriber>(ns, sub_options);
193193
// must use hevc, for some reason hevc_cuvid will not deliver the last frame
194194
sub_node->setParameterBase(parameter_base);
195-
sub_node->setParameter<std::string>("decoders.hevc.gray.bgr8.mono8", decoders);
195+
sub_node->setParameter<std::string>("decoders.hevc_gray_bgr8_mono8", decoders);
196196
sub_node->initialize(); // only after params have been set!
197197
exec.add_node(sub_node);
198198
while (pub_node->publish_next() && rclcpp::ok()) {

0 commit comments

Comments
 (0)