Support for GValueArray marshalling in 'gb.media'.
[GB.MEDIA] * NEW: MediaControl: Support for GStreamer messages or properties being a GValueArray. They are returned as a Variant[].
This commit is contained in:
parent
4ccf87a00b
commit
b99546d40c
1 changed files with 28 additions and 0 deletions
|
@ -336,6 +336,34 @@ static void return_value(const GValue *value)
|
|||
|
||||
GB.ReturnObject(array);
|
||||
}
|
||||
#ifdef G_TYPE_VALUE_ARRAY
|
||||
else if (G_VALUE_HOLDS(value, G_TYPE_VALUE_ARRAY))
|
||||
{
|
||||
GValueArray *garray = (GValueArray *)g_value_get_boxed(value);
|
||||
guint len = garray->n_values;
|
||||
GB_ARRAY array;
|
||||
|
||||
GB.Array.New(&array, GB_T_VARIANT, len);
|
||||
|
||||
if (len <= 0)
|
||||
{
|
||||
GB.Array.New(&array, GB_T_VARIANT, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
GB_VALUE val;
|
||||
int i;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
to_gambas_value(g_value_array_get_nth(garray, i), &val);
|
||||
GB.Store(GB_T_VARIANT, &val, GB.Array.Get(array, i));
|
||||
GB.ReleaseValue(&val);
|
||||
}
|
||||
}
|
||||
|
||||
GB.ReturnObject(array);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "gb.media: warning: unsupported datatype: %s\n", G_VALUE_TYPE_NAME(value));
|
||||
|
|
Loading…
Reference in a new issue