androidcamera: Use strcmp on the GParamSpec property name

Use strcmp instead of using the property_id because it's overriden
This commit is contained in:
Youness Alaoui 2012-11-02 18:07:24 -04:00 committed by Nicolas Dufresne
parent 49a40edae9
commit dae0337d91

View file

@ -535,9 +535,6 @@ gst_ahc_src_probe_get_properties (GstPropertyProbe * probe)
GObjectClass *klass = G_OBJECT_GET_CLASS (probe);
GstAHCSrcClass *ahc_class = GST_AHC_SRC_CLASS (probe);
/* FIXME: g_object_class_find_property returns overriden property with
* param_id == 0, so we can't switch/case the prop_id and
* g_param_spec_get_redirect_target() returns NULL */
if (!ahc_class->probe_properties) {
ahc_class->probe_properties = g_list_append (NULL,
g_object_class_find_property (klass, "device"));
@ -572,7 +569,13 @@ gst_ahc_src_probe_get_values (GstPropertyProbe * probe,
g_value_unset (&value);
}
break;
case PROP_EV_COMP:
default:
/* g_object_class_find_property returns overriden property with
* param_id == 0, so we can't switch/case the prop_id and
* g_param_spec_get_redirect_target() returns NULL, so we need to
* do a strcmp on the property's name instead */
if (!g_strcmp0 (pspec->name, GST_PHOTOGRAPHY_PROP_EV_COMP)) {
//case PROP_EV_COMP:
if (self->camera) {
GstAHCParameters *params;
@ -603,8 +606,8 @@ gst_ahc_src_probe_get_values (GstPropertyProbe * probe,
gst_ahc_parameters_free (params);
}
}
break;
case PROP_ZOOM:
} else if (!g_strcmp0 (pspec->name, GST_PHOTOGRAPHY_PROP_ZOOM)) {
//case PROP_ZOOM:
if (self->camera) {
GstAHCParameters *params;
@ -631,9 +634,9 @@ gst_ahc_src_probe_get_values (GstPropertyProbe * probe,
gst_ahc_parameters_free (params);
}
}
break;
default:
} else {
G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
}
break;
}