extern gboolean _gst_disable_registry_cache;
#endif
+/* provide inline gst_g_value_get_foo_unchecked(), used in gststructure.c */
+#define DEFINE_INLINE_G_VALUE_GET_UNCHECKED(ret_type,name_type,v_field) \
+static inline ret_type \
+gst_g_value_get_##name_type##_unchecked (const GValue *value) \
+{ \
+ return value->data[0].v_field; \
+}
+
+DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gboolean,boolean,v_int)
+DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gint,int,v_int)
+DEFINE_INLINE_G_VALUE_GET_UNCHECKED(guint,uint,v_uint)
+DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gint64,int64,v_int64)
+DEFINE_INLINE_G_VALUE_GET_UNCHECKED(guint64,uint64,v_uint64)
+DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gfloat,float,v_float)
+DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gdouble,double,v_double)
+DEFINE_INLINE_G_VALUE_GET_UNCHECKED(const gchar *,string,v_pointer)
+
+
/*** debugging categories *****************************************************/
#ifndef GST_REMOVE_GST_DEBUG
if (!G_VALUE_HOLDS_BOOLEAN (&field->value))
return FALSE;
- *value = g_value_get_boolean (&field->value);
+ *value = gst_g_value_get_boolean_unchecked (&field->value);
return TRUE;
}
if (!G_VALUE_HOLDS_INT (&field->value))
return FALSE;
- *value = g_value_get_int (&field->value);
+ *value = gst_g_value_get_int_unchecked (&field->value);
return TRUE;
}
if (!G_VALUE_HOLDS_UINT (&field->value))
return FALSE;
- *value = g_value_get_uint (&field->value);
+ *value = gst_g_value_get_uint_unchecked (&field->value);
return TRUE;
}
if (!G_VALUE_HOLDS_UINT64 (&field->value))
return FALSE;
- *value = g_value_get_uint64 (&field->value);
+ *value = gst_g_value_get_uint64_unchecked (&field->value);
return TRUE;
}
if (!G_VALUE_HOLDS_DOUBLE (&field->value))
return FALSE;
- *value = g_value_get_double (&field->value);
+ *value = gst_g_value_get_double_unchecked (&field->value);
return TRUE;
}
if (!G_VALUE_HOLDS_STRING (&field->value))
return NULL;
- return g_value_get_string (&field->value);
+ return gst_g_value_get_string_unchecked (&field->value);
}
/**
if (G_VALUE_TYPE (&value1) == G_TYPE_DOUBLE) {
range_type = GST_TYPE_DOUBLE_RANGE;
g_value_init (value, range_type);
- gst_value_set_double_range (value, g_value_get_double (&value1),
- g_value_get_double (&value2));
+ gst_value_set_double_range (value,
+ gst_g_value_get_double_unchecked (&value1),
+ gst_g_value_get_double_unchecked (&value2));
} else if (G_VALUE_TYPE (&value1) == G_TYPE_INT) {
range_type = GST_TYPE_INT_RANGE;
g_value_init (value, range_type);
- gst_value_set_int_range (value, g_value_get_int (&value1),
- g_value_get_int (&value2));
+ gst_value_set_int_range (value, gst_g_value_get_int_unchecked (&value1),
+ gst_g_value_get_int_unchecked (&value2));
} else if (G_VALUE_TYPE (&value1) == GST_TYPE_FRACTION) {
range_type = GST_TYPE_FRACTION_RANGE;
g_value_init (value, range_type);
for (i = 0; i < n; i++) {
list_value = gst_value_list_get_value (value, i);
if (G_VALUE_TYPE (list_value) == G_TYPE_INT) {
- int x = g_value_get_int (list_value);
+ int x = gst_g_value_get_int_unchecked (list_value);
if (best_index == -1 || (ABS (target - x) < ABS (target - best))) {
best_index = i;
for (i = 0; i < n; i++) {
list_value = gst_value_list_get_value (value, i);
if (G_VALUE_TYPE (list_value) == G_TYPE_DOUBLE) {
- double x = g_value_get_double (list_value);
+ double x = gst_g_value_get_double_unchecked (list_value);
if (best_index == -1 || (ABS (target - x) < ABS (target - best))) {
best_index = i;
for (i = 0; i < n; i++) {
list_value = gst_value_list_get_value (value, i);
if (G_VALUE_TYPE (list_value) == G_TYPE_BOOLEAN) {
- gboolean x = g_value_get_boolean (list_value);
+ gboolean x = gst_g_value_get_boolean_unchecked (list_value);
if (best_index == -1 || x == target) {
best_index = i;