From f28ca209602a93a3b7176d86a6329ddb2a341293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Fri, 28 Feb 2020 02:38:18 +0100 Subject: libcamera: Use PixelFormat instead of unsigned int where appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the PixelFormat instead of unsigned int where a pixel format is to be used. PixelFormat is defined as an unsigned int but is about to be turned into a class to add functionality. There is no functional change in this patch. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/gstreamer/gstlibcamera-utils.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gstreamer') diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp index 44a993fa..3b3973bc 100644 --- a/src/gstreamer/gstlibcamera-utils.cpp +++ b/src/gstreamer/gstlibcamera-utils.cpp @@ -79,16 +79,16 @@ gst_libcamera_stream_formats_to_caps(const StreamFormats &formats) { GstCaps *caps = gst_caps_new_empty(); - for (unsigned int fourcc : formats.pixelformats()) { - g_autoptr(GstStructure) bare_s = bare_structure_from_fourcc(fourcc); + for (PixelFormat pixelformat : formats.pixelformats()) { + g_autoptr(GstStructure) bare_s = bare_structure_from_fourcc(pixelformat); if (!bare_s) { GST_WARNING("Unsupported DRM format %" GST_FOURCC_FORMAT, - GST_FOURCC_ARGS(fourcc)); + GST_FOURCC_ARGS(pixelformat)); continue; } - for (const Size &size : formats.sizes(fourcc)) { + for (const Size &size : formats.sizes(pixelformat)) { GstStructure *s = gst_structure_copy(bare_s); gst_structure_set(s, "width", G_TYPE_INT, size.width, @@ -97,7 +97,7 @@ gst_libcamera_stream_formats_to_caps(const StreamFormats &formats) gst_caps_append_structure(caps, s); } - const SizeRange &range = formats.range(fourcc); + const SizeRange &range = formats.range(pixelformat); if (range.hStep && range.vStep) { GstStructure *s = gst_structure_copy(bare_s); GValue val = G_VALUE_INIT; -- cgit v1.2.1