Lyrical support.

This commit is contained in:
James Pace 2026-06-12 21:18:47 -04:00
parent 2ba0f2e9f6
commit 7eda1b11f7
2 changed files with 7 additions and 4 deletions

View File

@ -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}

View File

@ -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;