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 <nicolas.dufresne@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
17cccc68a8
commit
eee8f56f0a
3 changed files with 125 additions and 0 deletions
19
src/gstreamer/gstlibcamera-utils.h
Normal file
19
src/gstreamer/gstlibcamera-utils.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
/*
|
||||
* Copyright (C) 2020, Collabora Ltd.
|
||||
* Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
|
||||
*
|
||||
* gstlibcamera-utils.h - GStreamer libcamera Utility Functions
|
||||
*/
|
||||
|
||||
#ifndef __GST_LIBCAMERA_UTILS_H__
|
||||
#define __GST_LIBCAMERA_UTILS_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#include <libcamera/stream.h>
|
||||
|
||||
GstCaps *gst_libcamera_stream_formats_to_caps(const libcamera::StreamFormats &formats);
|
||||
|
||||
#endif /* __GST_LIBCAMERA_UTILS_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue