Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/gscam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down Expand Up @@ -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);
}
Expand Down