[v3,1/3] gstreamer: Remove auto-focus-mode property from device provider
diff mbox series

Message ID 20241017172331.16377-2-jaslo@ziska.de
State Accepted
Headers show
Series
  • gstreamer: Generate controls from control_ids_*.yaml files
Related show

Commit Message

Jaslo Ziska Oct. 17, 2024, 5:04 p.m. UTC
The device provider is not supposed to have control properties, remove
the auto-focus-mode property which was introduced by accident.

Fixes: 5a142438b025 ("gstreamer: Add enable_auto_focus option to the GStreamer plugin")
Signed-off-by: Jaslo Ziska <jaslo@ziska.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/gstreamer/gstlibcameraprovider.cpp | 15 ---------------
 1 file changed, 15 deletions(-)

Comments

Kieran Bingham Oct. 18, 2024, 2:13 p.m. UTC | #1
Quoting Jaslo Ziska (2024-10-17 18:04:13)
> The device provider is not supposed to have control properties, remove
> the auto-focus-mode property which was introduced by accident.
> 
> Fixes: 5a142438b025 ("gstreamer: Add enable_auto_focus option to the GStreamer plugin")
> Signed-off-by: Jaslo Ziska <jaslo@ziska.de>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  src/gstreamer/gstlibcameraprovider.cpp | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp
> index 4fb1b007..5da96ea3 100644
> --- a/src/gstreamer/gstlibcameraprovider.cpp
> +++ b/src/gstreamer/gstlibcameraprovider.cpp
> @@ -33,7 +33,6 @@ GST_DEBUG_CATEGORY_STATIC(provider_debug);
>  
>  enum {
>         PROP_DEVICE_NAME = 1,
> -       PROP_AUTO_FOCUS_MODE = 2,
>  };
>  
>  #define GST_TYPE_LIBCAMERA_DEVICE gst_libcamera_device_get_type()
> @@ -43,7 +42,6 @@ G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device,
>  struct _GstLibcameraDevice {
>         GstDevice parent;
>         gchar *name;
> -       controls::AfModeEnum auto_focus_mode = controls::AfModeManual;
>  };
>  
>  G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE)
> @@ -60,7 +58,6 @@ gst_libcamera_device_create_element(GstDevice *device, const gchar *name)
>         g_assert(source);
>  
>         g_object_set(source, "camera-name", GST_LIBCAMERA_DEVICE(device)->name, nullptr);
> -       g_object_set(source, "auto-focus-mode", GST_LIBCAMERA_DEVICE(device)->auto_focus_mode, nullptr);
>  
>         return source;
>  }
> @@ -87,9 +84,6 @@ gst_libcamera_device_set_property(GObject *object, guint prop_id,
>         case PROP_DEVICE_NAME:
>                 device->name = g_value_dup_string(value);
>                 break;
> -       case PROP_AUTO_FOCUS_MODE:
> -               device->auto_focus_mode = static_cast<controls::AfModeEnum>(g_value_get_enum(value));
> -               break;
>         default:
>                 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
>                 break;
> @@ -129,15 +123,6 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)
>                                                 (GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE |
>                                                               G_PARAM_CONSTRUCT_ONLY));
>         g_object_class_install_property(object_class, PROP_DEVICE_NAME, pspec);
> -
> -       pspec = g_param_spec_enum("auto-focus-mode",
> -                                 "Set auto-focus mode",
> -                                 "Available options: AfModeManual, "
> -                                 "AfModeAuto or AfModeContinuous.",
> -                                 gst_libcamera_auto_focus_get_type(),
> -                                 static_cast<gint>(controls::AfModeManual),
> -                                 G_PARAM_WRITABLE);
> -       g_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, pspec);
>  }
>  
>  static GstDevice *
> -- 
> 2.46.2
>

Patch
diff mbox series

diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp
index 4fb1b007..5da96ea3 100644
--- a/src/gstreamer/gstlibcameraprovider.cpp
+++ b/src/gstreamer/gstlibcameraprovider.cpp
@@ -33,7 +33,6 @@  GST_DEBUG_CATEGORY_STATIC(provider_debug);
 
 enum {
 	PROP_DEVICE_NAME = 1,
-	PROP_AUTO_FOCUS_MODE = 2,
 };
 
 #define GST_TYPE_LIBCAMERA_DEVICE gst_libcamera_device_get_type()
@@ -43,7 +42,6 @@  G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device,
 struct _GstLibcameraDevice {
 	GstDevice parent;
 	gchar *name;
-	controls::AfModeEnum auto_focus_mode = controls::AfModeManual;
 };
 
 G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE)
@@ -60,7 +58,6 @@  gst_libcamera_device_create_element(GstDevice *device, const gchar *name)
 	g_assert(source);
 
 	g_object_set(source, "camera-name", GST_LIBCAMERA_DEVICE(device)->name, nullptr);
-	g_object_set(source, "auto-focus-mode", GST_LIBCAMERA_DEVICE(device)->auto_focus_mode, nullptr);
 
 	return source;
 }
@@ -87,9 +84,6 @@  gst_libcamera_device_set_property(GObject *object, guint prop_id,
 	case PROP_DEVICE_NAME:
 		device->name = g_value_dup_string(value);
 		break;
-	case PROP_AUTO_FOCUS_MODE:
-		device->auto_focus_mode = static_cast<controls::AfModeEnum>(g_value_get_enum(value));
-		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
 		break;
@@ -129,15 +123,6 @@  gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)
 						(GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE |
 							      G_PARAM_CONSTRUCT_ONLY));
 	g_object_class_install_property(object_class, PROP_DEVICE_NAME, pspec);
-
-	pspec = g_param_spec_enum("auto-focus-mode",
-				  "Set auto-focus mode",
-				  "Available options: AfModeManual, "
-				  "AfModeAuto or AfModeContinuous.",
-				  gst_libcamera_auto_focus_get_type(),
-				  static_cast<gint>(controls::AfModeManual),
-				  G_PARAM_WRITABLE);
-	g_object_class_install_property(object_class, PROP_AUTO_FOCUS_MODE, pspec);
 }
 
 static GstDevice *