diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-23 02:51:10 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-11-25 10:52:06 +0200 |
commit | 81e7689bb168a74c0822846729d992128da97322 (patch) | |
tree | 9814d804ce74030697d411710170f3d03b180b05 /src/gstreamer | |
parent | baf3be12effed489770aaf02b9df3b743d4b7e50 (diff) |
libcamera: stream: Turn StreamRole into scoped enumeration
The StreamRole enum has enumerators such as 'Raw' that are too generic
to be in the global libcamera namespace. Turn it into a scoped enum to
avoid namespace clashes, and update users accordingly.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/gstreamer')
-rw-r--r-- | src/gstreamer/gstlibcamerapad.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp index 87b4057a..9e710a47 100644 --- a/src/gstreamer/gstlibcamerapad.cpp +++ b/src/gstreamer/gstlibcamerapad.cpp @@ -54,7 +54,7 @@ gst_libcamera_pad_get_property(GObject *object, guint prop_id, GValue *value, switch (prop_id) { case PROP_STREAM_ROLE: - g_value_set_enum(value, self->role); + g_value_set_enum(value, static_cast<gint>(self->role)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -87,9 +87,19 @@ gst_libcamera_stream_role_get_type() { static GType type = 0; static const GEnumValue values[] = { - { StillCapture, "libcamera::StillCapture", "still-capture" }, - { VideoRecording, "libcamera::VideoRecording", "video-recording" }, - { Viewfinder, "libcamera::Viewfinder", "view-finder" }, + { + static_cast<gint>(StreamRole::StillCapture), + "libcamera::StillCapture", + "still-capture", + }, { + static_cast<gint>(StreamRole::VideoRecording), + "libcamera::VideoRecording", + "video-recording", + }, { + static_cast<gint>(StreamRole::Viewfinder), + "libcamera::Viewfinder", + "view-finder", + }, { 0, NULL, NULL } }; @@ -110,7 +120,7 @@ gst_libcamera_pad_class_init(GstLibcameraPadClass *klass) auto *spec = g_param_spec_enum("stream-role", "Stream Role", "The selected stream role", gst_libcamera_stream_role_get_type(), - VideoRecording, + static_cast<gint>(StreamRole::VideoRecording), (GParamFlags)(GST_PARAM_MUTABLE_READY | G_PARAM_CONSTRUCT | G_PARAM_READWRITE |