From 7eda1b11f7a43dfdccfd66630e536f037f7875ea Mon Sep 17 00:00:00 2001 From: James Pace Date: Fri, 12 Jun 2026 21:18:47 -0400 Subject: [PATCH] Lyrical support. --- CMakeLists.txt | 7 +++++-- src/video.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0956b02..4719a26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) project(image2rtsp) # Default to C99 @@ -34,7 +34,10 @@ include_directories(${OpenCV_INCLUDE_DIRS}) file(GLOB SOURCES src/video.cpp) add_executable(image2rtsp src/image2rtsp.cpp ${SOURCES}) -ament_target_dependencies(image2rtsp rclcpp sensor_msgs) +target_link_libraries(image2rtsp + rclcpp::rclcpp + ${sensor_msgs_TARGETS} +) include_directories( ${GST_INCLUDE_DIRS} diff --git a/src/video.cpp b/src/video.cpp index bde96c5..9a208f5 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -172,7 +172,7 @@ void Image2rtsp::topic_callback(const sensor_msgs::msg::Image::SharedPtr msg){ void Image2rtsp::compressed_topic_callback(const sensor_msgs::msg::CompressedImage::SharedPtr msg){ if (appsrc == NULL) return; // Decompress the image - cv::Mat img = cv::imdecode(cv::Mat(msg->data), cv::IMREAD_UNCHANGED); + cv::Mat img = cv::imdecode(cv::Mat(msg->data.to_vector()), cv::IMREAD_UNCHANGED); if (img.empty()) { RCLCPP_ERROR(this->get_logger(), "Failed to decompress image"); return; @@ -207,4 +207,4 @@ void Image2rtsp::compressed_topic_callback(const sensor_msgs::msg::CompressedIma // Push the buffer to GStreamer gst_app_src_push_buffer(appsrc, buf); -} \ No newline at end of file +}