mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
ges: Handle g_object_newv deprecation in latest GLib
This commit is contained in:
parent
cc703228fb
commit
88a5894fbd
2 changed files with 51 additions and 2 deletions
|
@ -86,6 +86,8 @@
|
|||
#include "ges.h"
|
||||
#include "ges-internal.h"
|
||||
|
||||
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (ges_asset_debug);
|
||||
|
@ -288,15 +290,38 @@ ges_asset_extract_default (GESAsset * asset, GError ** error)
|
|||
GESAssetPrivate *priv = asset->priv;
|
||||
GESExtractable *n_extractable;
|
||||
|
||||
|
||||
params = ges_extractable_type_get_parameters_from_id (priv->extractable_type,
|
||||
priv->id, &n_params);
|
||||
|
||||
#if GLIB_CHECK_VERSION(2, 53, 1)
|
||||
{
|
||||
gint i;
|
||||
GValue *values;
|
||||
const gchar **names;
|
||||
|
||||
values = g_malloc0 (sizeof (GValue) * n_params);
|
||||
names = g_malloc0 (sizeof (gchar **) * n_params);
|
||||
|
||||
for (i = 0; i < n_params; i++) {
|
||||
values[i] = params[i].value;
|
||||
names[i] = params[i].name;
|
||||
}
|
||||
|
||||
n_extractable =
|
||||
GES_EXTRACTABLE (g_object_new_with_properties (priv->extractable_type,
|
||||
n_params, names, values));
|
||||
g_free (names);
|
||||
g_free (values);
|
||||
}
|
||||
#else
|
||||
n_extractable = g_object_newv (priv->extractable_type, n_params, params);
|
||||
#endif
|
||||
|
||||
while (n_params--)
|
||||
g_value_unset (¶ms[n_params].value);
|
||||
if (params)
|
||||
g_free (params);
|
||||
|
||||
g_free (params);
|
||||
|
||||
return n_extractable;
|
||||
}
|
||||
|
|
|
@ -1132,7 +1132,31 @@ ges_timeline_element_copy (GESTimelineElement * self, gboolean deep)
|
|||
}
|
||||
}
|
||||
|
||||
#if GLIB_CHECK_VERSION(2, 53, 1)
|
||||
{
|
||||
gint i;
|
||||
GValue *values;
|
||||
const gchar **names;
|
||||
values = g_malloc0 (sizeof (GValue) * n_specs);
|
||||
names = g_malloc0 (sizeof (gchar **) * n_specs);
|
||||
|
||||
for (i = 0; i < n_params; i++) {
|
||||
values[i] = params[i].value;
|
||||
names[i] = params[i].name;
|
||||
}
|
||||
|
||||
ret =
|
||||
GES_TIMELINE_ELEMENT (g_object_new_with_properties (G_OBJECT_TYPE
|
||||
(self), n_params, names, values));
|
||||
g_free (names);
|
||||
g_free (values);
|
||||
}
|
||||
#else
|
||||
ret = g_object_newv (G_OBJECT_TYPE (self), n_params, params);
|
||||
#endif
|
||||
|
||||
while (n_params--)
|
||||
g_value_unset (¶ms[n_params].value);
|
||||
|
||||
g_free (specs);
|
||||
g_free (params);
|
||||
|
|
Loading…
Reference in a new issue