summaryrefslogtreecommitdiff
path: root/src/gstreamer/gstlibcameraprovider.cpp
diff options
context:
space:
mode:
authorBarnabás Pőcze <pobrn@protonmail.com>2023-05-09 23:15:43 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-07-04 22:56:38 +0100
commit26a4b83d1b9443795dbcb21fa6c23117f113216a (patch)
treedf9428c963771f0501e697ac609264c19386f8d3 /src/gstreamer/gstlibcameraprovider.cpp
parent86fa7300fa915060e25257b41d8ebb514dd55435 (diff)
libcamera: Remove `StreamRoles` alias
Now that `Camera::generateConfiguration()` takes a `libcamera::Span` of `StreamRole`, remove the `StreamRoles` type, which was an alias to `std::vector<libcamera::StreamRole>`. The removal has two reasons: - it is no longer strictly necessary, - its presence may suggest that that is the preferred (or correct) way to build/pass a list of `StreamRole`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> [Kieran: Fix small checkstyle report on roles initialiser] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/gstreamer/gstlibcameraprovider.cpp')
-rw-r--r--src/gstreamer/gstlibcameraprovider.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp
index 3f5e1fd6..ce3e0a08 100644
--- a/src/gstreamer/gstlibcameraprovider.cpp
+++ b/src/gstreamer/gstlibcameraprovider.cpp
@@ -6,6 +6,8 @@
* gstlibcameraprovider.c - GStreamer Device Provider
*/
+#include <array>
+
#include "gstlibcameraprovider.h"
#include <libcamera/camera.h>
@@ -141,11 +143,10 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)
static GstDevice *
gst_libcamera_device_new(const std::shared_ptr<Camera> &camera)
{
+ static const std::array roles{ StreamRole::VideoRecording };
g_autoptr(GstCaps) caps = gst_caps_new_empty();
const gchar *name = camera->id().c_str();
- StreamRoles roles;
- roles.push_back(StreamRole::VideoRecording);
std::unique_ptr<CameraConfiguration> config = camera->generateConfiguration(roles);
if (!config || config->size() != roles.size()) {
GST_ERROR("Failed to generate a default configuration for %s", name);