mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-07 12:21:17 +00:00
ahcsrc: remove probe_properties
It's a residue of 0.10. https://bugzilla.gnome.org/show_bug.cgi?id=763100
This commit is contained in:
parent
8cdfb13658
commit
b9ecc42b76
2 changed files with 0 additions and 166 deletions
|
@ -523,10 +523,6 @@ gst_ahc_src_class_init (GstAHCSrcClass * klass)
|
|||
properties[PROP_ANALOG_GAIN] = g_object_class_find_property (gobject_class,
|
||||
GST_PHOTOGRAPHY_PROP_ANALOG_GAIN);
|
||||
|
||||
|
||||
|
||||
klass->probe_properties = NULL;
|
||||
|
||||
gst_element_class_set_static_metadata (element_class,
|
||||
"Android Camera Source",
|
||||
"Source/Video",
|
||||
|
@ -858,167 +854,6 @@ gst_ahc_src_get_property (GObject * object, guint prop_id,
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static const GList *
|
||||
gst_ahc_src_probe_get_properties (GstPropertyProbe * probe)
|
||||
{
|
||||
GstAHCSrcClass *ahc_class = GST_AHC_SRC_CLASS (probe);
|
||||
GList **list = &ahc_class->probe_properties;
|
||||
|
||||
if (!*list) {
|
||||
*list = g_list_append (*list, properties[PROP_DEVICE]);
|
||||
*list = g_list_append (*list, properties[PROP_EV_COMP]);
|
||||
*list = g_list_append (*list, properties[PROP_ZOOM]);
|
||||
*list = g_list_append (*list, properties[PROP_WB_MODE]);
|
||||
*list = g_list_append (*list, properties[PROP_COLOUR_TONE]);
|
||||
*list = g_list_append (*list, properties[PROP_FLASH_MODE]);
|
||||
*list = g_list_append (*list, properties[PROP_FOCUS_MODE]);
|
||||
*list = g_list_append (*list, properties[PROP_SCENE_MODE]);
|
||||
*list = g_list_append (*list, properties[PROP_FLICKER_MODE]);
|
||||
}
|
||||
|
||||
return *list;
|
||||
}
|
||||
|
||||
#define PROBE_GET_ENUM_VALUES(name, type, struct_name) \
|
||||
if (self->camera) { \
|
||||
GstAHCParameters *params; \
|
||||
\
|
||||
params = gst_ah_camera_get_parameters (self->camera); \
|
||||
if (params) { \
|
||||
GList *list = gst_ahc_parameters_get_supported_##name (params); \
|
||||
\
|
||||
if (list) { \
|
||||
GValue value = { 0 }; \
|
||||
GList *i; \
|
||||
\
|
||||
array = g_value_array_new (g_list_length (list)); \
|
||||
g_value_init (&value, type); \
|
||||
for (i = list; i; i = i->next) { \
|
||||
struct_name mode; \
|
||||
const gchar *name = i->data; \
|
||||
\
|
||||
if (_##name##_to_enum (name, &mode)) { \
|
||||
g_value_set_enum (&value, mode); \
|
||||
g_value_array_append (array, &value); \
|
||||
} \
|
||||
} \
|
||||
g_value_unset (&value); \
|
||||
} \
|
||||
\
|
||||
gst_ahc_parameters_supported_##name##_free (list); \
|
||||
gst_ahc_parameters_free (params); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
static GValueArray *
|
||||
gst_ahc_src_probe_get_values (GstPropertyProbe * probe,
|
||||
guint prop_id, const GParamSpec * pspec)
|
||||
{
|
||||
GstAHCSrc *self = GST_AHC_SRC (probe);
|
||||
GValueArray *array = NULL;
|
||||
|
||||
/* g_object_class_find_property returns overriden property with
|
||||
* param_id == 0, so we can't switch/case the prop_id and
|
||||
* we need to check the pspec instead */
|
||||
if (pspec == properties[PROP_DEVICE]) {
|
||||
GValue value = { 0 };
|
||||
gint num_cams = gst_ah_camera_get_number_of_cameras ();
|
||||
gint i;
|
||||
|
||||
array = g_value_array_new (num_cams);
|
||||
g_value_init (&value, G_TYPE_STRING);
|
||||
for (i = 0; i < num_cams; i++) {
|
||||
g_value_take_string (&value, g_strdup_printf ("%d", i));
|
||||
g_value_array_append (array, &value);
|
||||
}
|
||||
g_value_unset (&value);
|
||||
} else if (pspec == properties[PROP_EV_COMP]) {
|
||||
if (self->camera) {
|
||||
GstAHCParameters *params;
|
||||
|
||||
params = gst_ah_camera_get_parameters (self->camera);
|
||||
if (params) {
|
||||
gint min, max;
|
||||
gfloat step;
|
||||
|
||||
min = gst_ahc_parameters_get_min_exposure_compensation (params);
|
||||
max = gst_ahc_parameters_get_max_exposure_compensation (params);
|
||||
step = gst_ahc_parameters_get_exposure_compensation_step (params);
|
||||
|
||||
if (step != 0.0 && min != max) {
|
||||
GValue value = { 0 };
|
||||
gint i;
|
||||
|
||||
/* Min and Max are inclusive */
|
||||
array = g_value_array_new (max - min + 1);
|
||||
g_value_init (&value, G_TYPE_FLOAT);
|
||||
for (i = min; i <= max; i++) {
|
||||
g_value_set_float (&value, step * i);
|
||||
g_value_array_append (array, &value);
|
||||
}
|
||||
g_value_unset (&value);
|
||||
}
|
||||
|
||||
gst_ahc_parameters_free (params);
|
||||
}
|
||||
}
|
||||
} else if (pspec == properties[PROP_ZOOM]) {
|
||||
if (self->camera) {
|
||||
GstAHCParameters *params;
|
||||
|
||||
params = gst_ah_camera_get_parameters (self->camera);
|
||||
if (params) {
|
||||
GList *zoom_ratios = gst_ahc_parameters_get_zoom_ratios (params);
|
||||
gint max_zoom = gst_ahc_parameters_get_max_zoom (params);
|
||||
|
||||
if (zoom_ratios && g_list_length (zoom_ratios) == (max_zoom + 1)) {
|
||||
GValue value = { 0 };
|
||||
GList *i;
|
||||
|
||||
array = g_value_array_new (max_zoom + 1);
|
||||
g_value_init (&value, G_TYPE_FLOAT);
|
||||
for (i = zoom_ratios; i; i = i->next) {
|
||||
gint zoom_value = GPOINTER_TO_INT (i->data);
|
||||
gfloat zoom = (gfloat) zoom_value / 100.0;
|
||||
|
||||
g_value_set_float (&value, zoom);
|
||||
g_value_array_append (array, &value);
|
||||
}
|
||||
g_value_unset (&value);
|
||||
}
|
||||
|
||||
gst_ahc_parameters_zoom_ratios_free (zoom_ratios);
|
||||
gst_ahc_parameters_free (params);
|
||||
}
|
||||
}
|
||||
} else if (pspec == properties[PROP_WB_MODE]) {
|
||||
PROBE_GET_ENUM_VALUES (white_balance, GST_TYPE_WHITE_BALANCE_MODE,
|
||||
GstPhotographyWhiteBalanceMode);
|
||||
} else if (pspec == properties[PROP_COLOUR_TONE]) {
|
||||
PROBE_GET_ENUM_VALUES (color_effects, GST_TYPE_COLOUR_TONE_MODE,
|
||||
GstPhotographyColorToneMode);
|
||||
} else if (pspec == properties[PROP_FLASH_MODE]) {
|
||||
PROBE_GET_ENUM_VALUES (flash_modes, GST_TYPE_FLASH_MODE,
|
||||
GstPhotographyFlashMode);
|
||||
} else if (pspec == properties[PROP_FOCUS_MODE]) {
|
||||
PROBE_GET_ENUM_VALUES (focus_modes, GST_TYPE_FOCUS_MODE,
|
||||
GstPhotographyFocusMode);
|
||||
} else if (pspec == properties[PROP_SCENE_MODE]) {
|
||||
PROBE_GET_ENUM_VALUES (scene_modes, GST_TYPE_SCENE_MODE,
|
||||
GstPhotographySceneMode);
|
||||
} else if (pspec == properties[PROP_FLICKER_MODE]) {
|
||||
PROBE_GET_ENUM_VALUES (antibanding, GST_TYPE_FLICKER_REDUCTION_MODE,
|
||||
GstPhotographyFlickerReductionMode);
|
||||
} else {
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
_antibanding_to_enum (const gchar * antibanding,
|
||||
GstPhotographyFlickerReductionMode * mode)
|
||||
|
|
|
@ -80,7 +80,6 @@ struct _GstAHCSrc
|
|||
struct _GstAHCSrcClass
|
||||
{
|
||||
GstPushSrcClass parent_class;
|
||||
GList *probe_properties;
|
||||
};
|
||||
|
||||
GType gst_ahc_src_get_type (void);
|
||||
|
|
Loading…
Reference in a new issue