[libcamera-devel] [RFC PATCH 6/6] gst: utils: Add framerate to caps
Marian Cichy
m.cichy at pengutronix.de
Tue Mar 16 16:52:11 CET 2021
The framerate of a stream is the inverse of the frame interval from the
stream configuration.
Signed-off-by: Marian Cichy <m.cichy at pengutronix.de>
---
src/gstreamer/gstlibcamera-utils.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
index 61370d5f..7516f84a 100644
--- a/src/gstreamer/gstlibcamera-utils.cpp
+++ b/src/gstreamer/gstlibcamera-utils.cpp
@@ -125,6 +125,8 @@ gst_libcamera_stream_configuration_to_caps(const StreamConfiguration &stream_cfg
gst_structure_set(s,
"width", G_TYPE_INT, stream_cfg.size.width,
"height", G_TYPE_INT, stream_cfg.size.height,
+ "framerate", GST_TYPE_FRACTION, stream_cfg.frameInterval.denominator,
+ stream_cfg.frameInterval.numerator,
nullptr);
gst_caps_append_structure(caps, s);
--
2.29.2
More information about the libcamera-devel
mailing list