diff --git a/README.md b/README.md index c4ba620..9a9e269 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Note that GStreamer is licensed under the LGPL, and GStreamer plugins have their * `reopen_on_eof`: Re-open the stream if it ends (EOF) * `sync_sink`: Synchronize the app sink (sometimes setting this to `false` can resolve problems with sub-par framerates) * `use_gst_timestamps`: Use the GStreamer buffer timestamps for the image message header timestamps (setting this to `false` results in header timestamps being the time that the image buffer transfer is completed) -* `image_encoding`: image encoding ("rgb8", "mono8", "yuv422", "jpeg") +* `image_encoding`: image encoding ("rgb8", "mono8", "yuv422", "rgba8", "jpeg") * `use_sensor_data_qos`: The flag to use sensor data qos for camera topic(image, camera_info) ## Examples diff --git a/src/gscam.cpp b/src/gscam.cpp index e670b21..9ed1e19 100644 --- a/src/gscam.cpp +++ b/src/gscam.cpp @@ -110,6 +110,7 @@ bool GSCam::configure() if (image_encoding_ != sensor_msgs::image_encodings::RGB8 && image_encoding_ != sensor_msgs::image_encodings::MONO8 && image_encoding_ != sensor_msgs::image_encodings::YUV422 && + image_encoding_ != sensor_msgs::image_encodings::RGBA8 && image_encoding_ != "jpeg") { RCLCPP_FATAL_STREAM(get_logger(), "Unsupported image encoding: " + image_encoding_); @@ -177,6 +178,11 @@ bool GSCam::init_stream() "video/x-raw", "format", G_TYPE_STRING, "UYVY", NULL); + } else if (image_encoding_ == sensor_msgs::image_encodings::RGBA8) { + caps = gst_caps_new_simple( + "video/x-raw", + "format", G_TYPE_STRING, "RGBA", + NULL); } else if (image_encoding_ == "jpeg") { caps = gst_caps_new_simple("image/jpeg", NULL, NULL); }