gstreamer: Remove auto-focus-mode property from device provider

The device provider is not supposed to have control properties, remove
the auto-focus-mode property which was introduced by accident.

Fixes: 5a142438b0 ("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>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Jaslo Ziska 2024-10-21 18:45:31 +02:00 committed by Kieran Bingham
parent 77438775b3
commit 327b0d16a1

View file

@ -33,7 +33,6 @@ GST_DEBUG_CATEGORY_STATIC(provider_debug);
enum { enum {
PROP_DEVICE_NAME = 1, PROP_DEVICE_NAME = 1,
PROP_AUTO_FOCUS_MODE = 2,
}; };
#define GST_TYPE_LIBCAMERA_DEVICE gst_libcamera_device_get_type() #define GST_TYPE_LIBCAMERA_DEVICE gst_libcamera_device_get_type()
@ -43,7 +42,6 @@ G_DECLARE_FINAL_TYPE(GstLibcameraDevice, gst_libcamera_device,
struct _GstLibcameraDevice { struct _GstLibcameraDevice {
GstDevice parent; GstDevice parent;
gchar *name; gchar *name;
controls::AfModeEnum auto_focus_mode = controls::AfModeManual;
}; };
G_DEFINE_TYPE(GstLibcameraDevice, gst_libcamera_device, GST_TYPE_DEVICE) 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_assert(source);
g_object_set(source, "camera-name", GST_LIBCAMERA_DEVICE(device)->name, nullptr); 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; return source;
} }
@ -87,9 +84,6 @@ gst_libcamera_device_set_property(GObject *object, guint prop_id,
case PROP_DEVICE_NAME: case PROP_DEVICE_NAME:
device->name = g_value_dup_string(value); device->name = g_value_dup_string(value);
break; break;
case PROP_AUTO_FOCUS_MODE:
device->auto_focus_mode = static_cast<controls::AfModeEnum>(g_value_get_enum(value));
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break; break;
@ -129,15 +123,6 @@ gst_libcamera_device_class_init(GstLibcameraDeviceClass *klass)
(GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | (GParamFlags)(G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY)); G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(object_class, PROP_DEVICE_NAME, pspec); 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 * static GstDevice *