From eee8f56f0a7f34574752948027843bf6a1912e90 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 14 Jan 2020 10:55:01 -0500 Subject: gst: Add utility to convert StreamFormats to GstCaps This transforms the basic information found in StreamFormats to GstCaps. This can be handy to reply to early caps query or inside a device provider. Note that we ignored generated range as they are harmful to caps negotiation. We also don't simplify the caps for readability reasons, so some of the discrete value may be included in a range. Signed-off-by: Nicolas Dufresne Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/gstreamer/gstlibcamera-utils.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/gstreamer/gstlibcamera-utils.h (limited to 'src/gstreamer/gstlibcamera-utils.h') diff --git a/src/gstreamer/gstlibcamera-utils.h b/src/gstreamer/gstlibcamera-utils.h new file mode 100644 index 00000000..2e4e3042 --- /dev/null +++ b/src/gstreamer/gstlibcamera-utils.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2020, Collabora Ltd. + * Author: Nicolas Dufresne + * + * gstlibcamera-utils.h - GStreamer libcamera Utility Functions + */ + +#ifndef __GST_LIBCAMERA_UTILS_H__ +#define __GST_LIBCAMERA_UTILS_H__ + +#include +#include + +#include + +GstCaps *gst_libcamera_stream_formats_to_caps(const libcamera::StreamFormats &formats); + +#endif /* __GST_LIBCAMERA_UTILS_H__ */ -- cgit v1.2.1