[libcamera-devel] [PATCH v1] gstreamer: Simplify camera config generation call

Barnabás Pőcze pobrn at protonmail.com
Wed May 3 14:31:15 CEST 2023


Hi


2023. május 3., szerda 6:31 keltezéssel, Umang Jain <umang.jain at ideasonboard.com> írta:

> [...]
> >>> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp
> >>> index 6eb0a0eb..4f325ad4 100644
> >>> --- a/src/gstreamer/gstlibcameraprovider.cpp
> >>> +++ b/src/gstreamer/gstlibcameraprovider.cpp
> >>> @@ -128,11 +128,9 @@ gst_libcamera_device_new(const std::shared_ptr<Camera> &camera)
> >>>    {
> >>>    	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()) {
> >> I would leave it as it is, as it's easier to add new roles (just a
> >> .push_back() call) and the adjoining pieces automatically makes it fall
> >> into place..
> > That is a fair point, I did not really explain the motivation. I would like to
> > post a second version of https://patchwork.libcamera.org/patch/18285/ that would
> > also remove the `StreamRoles` alias altogether.
> 
> If there's are adjoining changes, I suggest clubbing all that in a
> single series and posting.
> 
> For e.g. I would remove `StreamRoles` from every place in the codebase
> and then remove the `StreamRoles` definition / implementation from the
> concerned class. This provides a more holisitic view.

Good point. Please disregard this patch.


> [...]


Regards,
Barnabás Pőcze


More information about the libcamera-devel mailing list