summaryrefslogtreecommitdiff
path: root/src/gstreamer/gstlibcamera-utils.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-16 10:07:26 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-03-18 18:02:40 +0100
commit718f5e99a966246de8d129902ad470872652b749 (patch)
tree0e16bc1b512304c8341c4a1334654d508631a7a7 /src/gstreamer/gstlibcamera-utils.cpp
parent8c0bbcd3d3751a716eb8bf03e703aa6fdbe1bd3f (diff)
libcamera: PixelFormat: Make constructor explicit
To achieve the goal of preventing unwanted conversion between a DRM and a V4L2 FourCC, make the PixelFormat constructor that takes an integer value explicit. All users of pixel formats flagged by the compiler are fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/gstreamer/gstlibcamera-utils.cpp')
-rw-r--r--src/gstreamer/gstlibcamera-utils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
index 3b3973bc..a3cb0746 100644
--- a/src/gstreamer/gstlibcamera-utils.cpp
+++ b/src/gstreamer/gstlibcamera-utils.cpp
@@ -154,9 +154,9 @@ gst_libcamera_configure_stream_from_caps(StreamConfiguration &stream_cfg,
if (gst_structure_has_name(s, "video/x-raw")) {
const gchar *format = gst_structure_get_string(s, "format");
gst_format = gst_video_format_from_string(format);
- stream_cfg.pixelFormat = gst_format_to_drm(gst_format);
+ stream_cfg.pixelFormat = PixelFormat(gst_format_to_drm(gst_format));
} else if (gst_structure_has_name(s, "image/jpeg")) {
- stream_cfg.pixelFormat = DRM_FORMAT_MJPEG;
+ stream_cfg.pixelFormat = PixelFormat(DRM_FORMAT_MJPEG);
} else {
g_critical("Unsupported media type: %s", gst_structure_get_name(s));
}