[libcamera-devel,1/2] gstreamer: src: Style change
diff mbox series

Message ID 20230613103519.91370-2-robert.mader@collabora.com
State New
Headers show
Series
  • gstreamer: src: Add transform property
Related show

Commit Message

Robert Mader June 13, 2023, 10:34 a.m. UTC
Get rid of a variable and use a more common style in Gstreamer in
preparation for more properties.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
 src/gstreamer/gstlibcamerasrc.cpp | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Comments

Kieran Bingham June 13, 2023, 11:34 a.m. UTC | #1
Hi Robert,

Quoting Robert Mader via libcamera-devel (2023-06-13 11:34:49)
> Get rid of a variable and use a more common style in Gstreamer in
> preparation for more properties.
> 
> Signed-off-by: Robert Mader <robert.mader@collabora.com>
> ---
>  src/gstreamer/gstlibcamerasrc.cpp | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
> index a10cbd4f..721b35c2 100644
> --- a/src/gstreamer/gstlibcamerasrc.cpp
> +++ b/src/gstreamer/gstlibcamerasrc.cpp
> @@ -837,11 +837,12 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)
>                                                              &request_src_template,
>                                                              GST_TYPE_LIBCAMERA_PAD);
>  
> -       GParamSpec *spec = g_param_spec_string("camera-name", "Camera Name",
> -                                              "Select by name which camera to use.", nullptr,
> -                                              (GParamFlags)(GST_PARAM_MUTABLE_READY
> -                                                            | G_PARAM_CONSTRUCT
> -                                                            | G_PARAM_READWRITE
> -                                                            | G_PARAM_STATIC_STRINGS));
> -       g_object_class_install_property(object_class, PROP_CAMERA_NAME, spec);
> +       g_object_class_install_property(object_class, PROP_CAMERA_NAME,
> +               g_param_spec_string("camera-name", "Camera Name",

This sounds fine to me - but the indentation is going to drive our
clang-format crazy which means this generates a fair bit of checkstyle
noise.

In this instance, I think it's fine - as we probably expect in the
future that this component could get moved into the gstreamer project so
should be more closely aligned to styles there perhaps.

I don't think I can make clang-format/checkstyle have per file rules ;-(

Anyway, that's just checker noise. For the change:


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> +                                   "Select by name which camera to use.",
> +                                   nullptr,
> +                                   (GParamFlags)(GST_PARAM_MUTABLE_READY
> +                                                 | G_PARAM_CONSTRUCT
> +                                                 | G_PARAM_READWRITE
> +                                                 | G_PARAM_STATIC_STRINGS)));
>  }
> -- 
> 2.41.0
>
Nicolas Dufresne June 13, 2023, 2:26 p.m. UTC | #2
Le mardi 13 juin 2023 à 12:34 +0100, Kieran Bingham via libcamera-devel a
écrit :
> Hi Robert,
> 
> Quoting Robert Mader via libcamera-devel (2023-06-13 11:34:49)
> > Get rid of a variable and use a more common style in Gstreamer in
> > preparation for more properties.
> > 
> > Signed-off-by: Robert Mader <robert.mader@collabora.com>
> > ---
> >  src/gstreamer/gstlibcamerasrc.cpp | 15 ++++++++-------
> >  1 file changed, 8 insertions(+), 7 deletions(-)
> > 
> > diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
> > index a10cbd4f..721b35c2 100644
> > --- a/src/gstreamer/gstlibcamerasrc.cpp
> > +++ b/src/gstreamer/gstlibcamerasrc.cpp
> > @@ -837,11 +837,12 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)
> >                                                              &request_src_template,
> >                                                              GST_TYPE_LIBCAMERA_PAD);
> >  
> > -       GParamSpec *spec = g_param_spec_string("camera-name", "Camera Name",
> > -                                              "Select by name which camera to use.", nullptr,
> > -                                              (GParamFlags)(GST_PARAM_MUTABLE_READY
> > -                                                            | G_PARAM_CONSTRUCT
> > -                                                            | G_PARAM_READWRITE
> > -                                                            | G_PARAM_STATIC_STRINGS));
> > -       g_object_class_install_property(object_class, PROP_CAMERA_NAME, spec);
> > +       g_object_class_install_property(object_class, PROP_CAMERA_NAME,
> > +               g_param_spec_string("camera-name", "Camera Name",
> 
> This sounds fine to me - but the indentation is going to drive our
> clang-format crazy which means this generates a fair bit of checkstyle
> noise.
> 
> In this instance, I think it's fine - as we probably expect in the
> future that this component could get moved into the gstreamer project so
> should be more closely aligned to styles there perhaps.
> 
> I don't think I can make clang-format/checkstyle have per file rules ;-(
> 
> Anyway, that's just checker noise. For the change:
> 
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

p.s. I had this split like this to make the style check happy. Not sure it was
important enough to change it to something the checker does not like ?

> 
> > +                                   "Select by name which camera to use.",
> > +                                   nullptr,
> > +                                   (GParamFlags)(GST_PARAM_MUTABLE_READY
> > +                                                 | G_PARAM_CONSTRUCT
> > +                                                 | G_PARAM_READWRITE
> > +                                                 | G_PARAM_STATIC_STRINGS)));
> >  }
> > -- 
> > 2.41.0
> >
Umang Jain June 13, 2023, 5:39 p.m. UTC | #3
Hi,

Thank you for the patch.

Probably the commit title can be expanded a bit more...

On 6/13/23 5:04 PM, Kieran Bingham via libcamera-devel wrote:
> Hi Robert,
>
> Quoting Robert Mader via libcamera-devel (2023-06-13 11:34:49)
>> Get rid of a variable and use a more common style in Gstreamer in
>> preparation for more properties.
>>
>> Signed-off-by: Robert Mader <robert.mader@collabora.com>
>> ---
>>   src/gstreamer/gstlibcamerasrc.cpp | 15 ++++++++-------
>>   1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
>> index a10cbd4f..721b35c2 100644
>> --- a/src/gstreamer/gstlibcamerasrc.cpp
>> +++ b/src/gstreamer/gstlibcamerasrc.cpp
>> @@ -837,11 +837,12 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)
>>                                                               &request_src_template,
>>                                                               GST_TYPE_LIBCAMERA_PAD);
>>   
>> -       GParamSpec *spec = g_param_spec_string("camera-name", "Camera Name",
>> -                                              "Select by name which camera to use.", nullptr,
>> -                                              (GParamFlags)(GST_PARAM_MUTABLE_READY
>> -                                                            | G_PARAM_CONSTRUCT
>> -                                                            | G_PARAM_READWRITE
>> -                                                            | G_PARAM_STATIC_STRINGS));
>> -       g_object_class_install_property(object_class, PROP_CAMERA_NAME, spec);
>> +       g_object_class_install_property(object_class, PROP_CAMERA_NAME,
>> +               g_param_spec_string("camera-name", "Camera Name",
> This sounds fine to me - but the indentation is going to drive our
> clang-format crazy which means this generates a fair bit of checkstyle
> noise.
>
> In this instance, I think it's fine - as we probably expect in the
> future that this component could get moved into the gstreamer project so
> should be more closely aligned to styles there perhaps.
>
> I don't think I can make clang-format/checkstyle have per file rules ;-(
>
> Anyway, that's just checker noise. For the change:
>
>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

>
>> +                                   "Select by name which camera to use.",
>> +                                   nullptr,
>> +                                   (GParamFlags)(GST_PARAM_MUTABLE_READY
>> +                                                 | G_PARAM_CONSTRUCT
>> +                                                 | G_PARAM_READWRITE
>> +                                                 | G_PARAM_STATIC_STRINGS)));
>>   }
>> -- 
>> 2.41.0
>>

Patch
diff mbox series

diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index a10cbd4f..721b35c2 100644
--- a/src/gstreamer/gstlibcamerasrc.cpp
+++ b/src/gstreamer/gstlibcamerasrc.cpp
@@ -837,11 +837,12 @@  gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)
 							     &request_src_template,
 							     GST_TYPE_LIBCAMERA_PAD);
 
-	GParamSpec *spec = g_param_spec_string("camera-name", "Camera Name",
-					       "Select by name which camera to use.", nullptr,
-					       (GParamFlags)(GST_PARAM_MUTABLE_READY
-							     | G_PARAM_CONSTRUCT
-							     | G_PARAM_READWRITE
-							     | G_PARAM_STATIC_STRINGS));
-	g_object_class_install_property(object_class, PROP_CAMERA_NAME, spec);
+	g_object_class_install_property(object_class, PROP_CAMERA_NAME,
+		g_param_spec_string("camera-name", "Camera Name",
+				    "Select by name which camera to use.",
+				    nullptr,
+				    (GParamFlags)(GST_PARAM_MUTABLE_READY
+						  | G_PARAM_CONSTRUCT
+						  | G_PARAM_READWRITE
+						  | G_PARAM_STATIC_STRINGS)));
 }