summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2017-04-04 16:53:39 (GMT)
committerTim-Philipp Müller <tim@centricular.com>2017-04-08 08:49:59 (GMT)
commit519d64881fad234c9a637c0c1bcc3d8155e46b3f (patch)
tree7045718d87b4aeff3941d1da0e2fb993515b29c9
parent7699b8a1bc49f30cd9a0c300831a085516f5442e (diff)
downloadgstreamer-519d64881fad234c9a637c0c1bcc3d8155e46b3f.tar.gz
gstreamer-519d64881fad234c9a637c0c1bcc3d8155e46b3f.tar.xz
Don't use deprecated g_object_newv()
Use g_object_new() instead which nowadays has a shortcut for the no-properties check. It still does an extra GType check in the function guard, but there's a pending patch to remove that and it's hardly going to be a performance issue in practice, even less so on a system that's compiled without run-time checks. Alternative would be to move to the new g_object_new_properties() with a fallback define for older glib versions, but it makes the code look more unwieldy and doesn't seem worth it. Fixes deprecation warnings when building against newer GLib versions. https://bugzilla.gnome.org/show_bug.cgi?id=780903
-rw-r--r--gst/gstbufferpool.c2
-rw-r--r--gst/gstbus.c2
-rw-r--r--gst/gstdeviceproviderfactory.c7
-rw-r--r--gst/gstdynamictypefactory.c4
-rw-r--r--gst/gstelementfactory.c9
-rw-r--r--gst/gstplugin.c6
-rw-r--r--gst/gstpluginloader.c2
-rw-r--r--gst/gstregistry.c2
-rw-r--r--gst/gstregistrychunks.c4
-rw-r--r--gst/gsttask.c2
-rw-r--r--gst/gsttaskpool.c2
-rw-r--r--gst/gsttracer.c2
-rw-r--r--gst/gsttracerrecord.c2
-rw-r--r--gst/gsttypefind.c2
-rw-r--r--libs/gst/base/gstadapter.c2
-rw-r--r--libs/gst/base/gstdataqueue.c2
-rw-r--r--libs/gst/base/gstindex.c2
-rw-r--r--libs/gst/controller/gstinterpolationcontrolsource.c2
-rw-r--r--libs/gst/controller/gstlfocontrolsource.c2
-rw-r--r--libs/gst/controller/gsttriggercontrolsource.c2
-rw-r--r--tests/check/gst/gstcontroller.c2
-rw-r--r--tests/check/gst/gstelementfactory.c2
22 files changed, 28 insertions, 36 deletions
diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c
index f984a26..9529208 100644
--- a/gst/gstbufferpool.c
+++ b/gst/gstbufferpool.c
@@ -219,7 +219,7 @@ gst_buffer_pool_new (void)
{
GstBufferPool *result;
- result = g_object_newv (GST_TYPE_BUFFER_POOL, 0, NULL);
+ result = g_object_new (GST_TYPE_BUFFER_POOL, NULL);
GST_DEBUG_OBJECT (result, "created new buffer pool");
return result;
diff --git a/gst/gstbus.c b/gst/gstbus.c
index 7bf71b6..6a7820c 100644
--- a/gst/gstbus.c
+++ b/gst/gstbus.c
@@ -285,7 +285,7 @@ gst_bus_new (void)
{
GstBus *result;
- result = g_object_newv (gst_bus_get_type (), 0, NULL);
+ result = g_object_new (gst_bus_get_type (), NULL);
GST_DEBUG_OBJECT (result, "created new bus");
return result;
diff --git a/gst/gstdeviceproviderfactory.c b/gst/gstdeviceproviderfactory.c
index 85dc53d..3fbaa3b 100644
--- a/gst/gstdeviceproviderfactory.c
+++ b/gst/gstdeviceproviderfactory.c
@@ -197,9 +197,7 @@ gst_device_provider_register (GstPlugin * plugin, const gchar * name,
return TRUE;
}
- factory =
- GST_DEVICE_PROVIDER_FACTORY_CAST (g_object_newv
- (GST_TYPE_DEVICE_PROVIDER_FACTORY, 0, NULL));
+ factory = g_object_new (GST_TYPE_DEVICE_PROVIDER_FACTORY, NULL);
gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name);
GST_LOG_OBJECT (factory, "Created new device providerfactory for type %s",
g_type_name (type));
@@ -284,8 +282,7 @@ gst_device_provider_factory_get (GstDeviceProviderFactory * factory)
/* create an instance of the device provider, cast so we don't assert on NULL
* also set name as early as we can
*/
- device_provider = GST_DEVICE_PROVIDER_CAST (g_object_newv (factory->type, 0,
- NULL));
+ device_provider = g_object_new (factory->type, NULL);
if (G_UNLIKELY (device_provider == NULL))
goto no_device_provider;
diff --git a/gst/gstdynamictypefactory.c b/gst/gstdynamictypefactory.c
index 5f52ac2..cb388a5 100644
--- a/gst/gstdynamictypefactory.c
+++ b/gst/gstdynamictypefactory.c
@@ -123,9 +123,7 @@ gst_dynamic_type_factory_create (GstRegistry * registry,
{
GstDynamicTypeFactory *factory;
- factory =
- GST_DYNAMIC_TYPE_FACTORY_CAST (g_object_newv
- (GST_TYPE_DYNAMIC_TYPE_FACTORY, 0, NULL));
+ factory = g_object_new (GST_TYPE_DYNAMIC_TYPE_FACTORY, NULL);
gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name);
GST_LOG_OBJECT (factory, "Created new dynamictypefactory for type %s", name);
diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c
index 20704a0..da64380 100644
--- a/gst/gstelementfactory.c
+++ b/gst/gstelementfactory.c
@@ -230,9 +230,7 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
return TRUE;
}
- factory =
- GST_ELEMENT_FACTORY_CAST (g_object_newv (GST_TYPE_ELEMENT_FACTORY, 0,
- NULL));
+ factory = g_object_new (GST_TYPE_ELEMENT_FACTORY, NULL);
gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name);
GST_LOG_OBJECT (factory, "Created new elementfactory for type %s",
g_type_name (type));
@@ -369,10 +367,9 @@ gst_element_factory_create (GstElementFactory * factory, const gchar * name)
* also set name as early as we can
*/
if (name)
- element =
- GST_ELEMENT_CAST (g_object_new (factory->type, "name", name, NULL));
+ element = g_object_new (factory->type, "name", name, NULL);
else
- element = GST_ELEMENT_CAST (g_object_newv (factory->type, 0, NULL));
+ element = g_object_new (factory->type, NULL);
if (G_UNLIKELY (element == NULL))
goto no_element;
diff --git a/gst/gstplugin.c b/gst/gstplugin.c
index 6285983..506478d 100644
--- a/gst/gstplugin.c
+++ b/gst/gstplugin.c
@@ -220,7 +220,7 @@ gst_plugin_register_static (gint major_version, gint minor_version,
g_return_val_if_fail (_gst_plugin_inited != FALSE, FALSE);
GST_LOG ("attempting to load static plugin \"%s\" now...", name);
- plugin = g_object_newv (GST_TYPE_PLUGIN, 0, NULL);
+ plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
if (gst_plugin_register_func (plugin, &desc, NULL) != NULL) {
GST_INFO ("registered static plugin \"%s\"", name);
res = gst_registry_add_plugin (gst_registry_get (), plugin);
@@ -287,7 +287,7 @@ gst_plugin_register_static_full (gint major_version, gint minor_version,
g_return_val_if_fail (_gst_plugin_inited != FALSE, FALSE);
GST_LOG ("attempting to load static plugin \"%s\" now...", name);
- plugin = g_object_newv (GST_TYPE_PLUGIN, 0, NULL);
+ plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
if (gst_plugin_register_func (plugin, &desc, user_data) != NULL) {
GST_INFO ("registered static plugin \"%s\"", name);
res = gst_registry_add_plugin (gst_registry_get (), plugin);
@@ -781,7 +781,7 @@ _priv_gst_plugin_load_file_for_registry (const gchar * filename,
}
if (new_plugin) {
- plugin = g_object_newv (GST_TYPE_PLUGIN, 0, NULL);
+ plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
plugin->file_mtime = file_status.st_mtime;
plugin->file_size = file_status.st_size;
plugin->filename = g_strdup (filename);
diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c
index dbd341d..430829d 100644
--- a/gst/gstpluginloader.c
+++ b/gst/gstpluginloader.c
@@ -339,7 +339,7 @@ static void
plugin_loader_create_blacklist_plugin (GstPluginLoader * l,
PendingPluginEntry * entry)
{
- GstPlugin *plugin = g_object_newv (GST_TYPE_PLUGIN, 0, NULL);
+ GstPlugin *plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
plugin->filename = g_strdup (entry->filename);
plugin->file_mtime = entry->file_mtime;
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index 7ea7784..dbd373a 100644
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
@@ -327,7 +327,7 @@ gst_registry_get (void)
g_mutex_lock (&_gst_registry_mutex);
if (G_UNLIKELY (!_gst_registry_default)) {
- _gst_registry_default = g_object_newv (GST_TYPE_REGISTRY, 0, NULL);
+ _gst_registry_default = g_object_new (GST_TYPE_REGISTRY, NULL);
gst_object_ref_sink (GST_OBJECT_CAST (_gst_registry_default));
}
registry = _gst_registry_default;
diff --git a/gst/gstregistrychunks.c b/gst/gstregistrychunks.c
index 193bb60..899b83d 100644
--- a/gst/gstregistrychunks.c
+++ b/gst/gstregistrychunks.c
@@ -576,7 +576,7 @@ gst_registry_chunks_load_feature (GstRegistry * registry, gchar ** in,
plugin_name);
return FALSE;
}
- if (G_UNLIKELY ((feature = g_object_newv (type, 0, NULL)) == NULL)) {
+ if (G_UNLIKELY ((feature = g_object_new (type, NULL)) == NULL)) {
GST_ERROR ("Can't create feature from type");
return FALSE;
}
@@ -827,7 +827,7 @@ _priv_gst_registry_chunks_load_plugin (GstRegistry * registry, gchar ** in,
*in);
unpack_element (*in, pe, GstRegistryChunkPluginElement, end, fail);
- plugin = g_object_newv (GST_TYPE_PLUGIN, 0, NULL);
+ plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
/* TODO: also set GST_PLUGIN_FLAG_CONST */
GST_OBJECT_FLAG_SET (plugin, GST_PLUGIN_FLAG_CACHED);
diff --git a/gst/gsttask.c b/gst/gsttask.c
index d5ce87c..d231bd1 100644
--- a/gst/gsttask.c
+++ b/gst/gsttask.c
@@ -423,7 +423,7 @@ gst_task_new (GstTaskFunction func, gpointer user_data, GDestroyNotify notify)
g_return_val_if_fail (func != NULL, NULL);
- task = g_object_newv (GST_TYPE_TASK, 0, NULL);
+ task = g_object_new (GST_TYPE_TASK, NULL);
task->func = func;
task->user_data = user_data;
task->notify = notify;
diff --git a/gst/gsttaskpool.c b/gst/gsttaskpool.c
index 18f0a61..cd0320f 100644
--- a/gst/gsttaskpool.c
+++ b/gst/gsttaskpool.c
@@ -166,7 +166,7 @@ gst_task_pool_new (void)
{
GstTaskPool *pool;
- pool = g_object_newv (GST_TYPE_TASK_POOL, 0, NULL);
+ pool = g_object_new (GST_TYPE_TASK_POOL, NULL);
return pool;
}
diff --git a/gst/gsttracer.c b/gst/gsttracer.c
index a75fb99..25cc94f 100644
--- a/gst/gsttracer.c
+++ b/gst/gsttracer.c
@@ -169,7 +169,7 @@ gst_tracer_register (GstPlugin * plugin, const gchar * name, GType type)
return TRUE;
}
- factory = g_object_newv (GST_TYPE_TRACER_FACTORY, 0, NULL);
+ factory = g_object_new (GST_TYPE_TRACER_FACTORY, NULL);
GST_DEBUG_OBJECT (factory, "new tracer factory for %s", name);
gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name);
diff --git a/gst/gsttracerrecord.c b/gst/gsttracerrecord.c
index 00102bd..c6651d2 100644
--- a/gst/gsttracerrecord.c
+++ b/gst/gsttracerrecord.c
@@ -218,7 +218,7 @@ gst_tracer_record_new (const gchar * name, const gchar * firstfield, ...)
}
va_end (varargs);
- self = g_object_newv (GST_TYPE_TRACER_RECORD, 0, NULL);
+ self = g_object_new (GST_TYPE_TRACER_RECORD, NULL);
self->spec = structure;
gst_tracer_record_build_format (self);
diff --git a/gst/gsttypefind.c b/gst/gsttypefind.c
index 93ea3cd..5c2b0d1 100644
--- a/gst/gsttypefind.c
+++ b/gst/gsttypefind.c
@@ -71,7 +71,7 @@ gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank,
GST_INFO ("registering typefind function for %s", name);
- factory = g_object_newv (GST_TYPE_TYPE_FIND_FACTORY, 0, NULL);
+ factory = g_object_new (GST_TYPE_TYPE_FIND_FACTORY, NULL);
GST_DEBUG_OBJECT (factory, "using new typefind factory for %s", name);
gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name);
diff --git a/libs/gst/base/gstadapter.c b/libs/gst/base/gstadapter.c
index bd62abe..6c56c41 100644
--- a/libs/gst/base/gstadapter.c
+++ b/libs/gst/base/gstadapter.c
@@ -240,7 +240,7 @@ gst_adapter_finalize (GObject * object)
GstAdapter *
gst_adapter_new (void)
{
- return g_object_newv (GST_TYPE_ADAPTER, 0, NULL);
+ return g_object_new (GST_TYPE_ADAPTER, NULL);
}
/**
diff --git a/libs/gst/base/gstdataqueue.c b/libs/gst/base/gstdataqueue.c
index 5c1c574..ab09cb6 100644
--- a/libs/gst/base/gstdataqueue.c
+++ b/libs/gst/base/gstdataqueue.c
@@ -236,7 +236,7 @@ gst_data_queue_new (GstDataQueueCheckFullFunction checkfull,
g_return_val_if_fail (checkfull != NULL, NULL);
- ret = g_object_newv (GST_TYPE_DATA_QUEUE, 0, NULL);
+ ret = g_object_new (GST_TYPE_DATA_QUEUE, NULL);
ret->priv->checkfull = checkfull;
ret->priv->checkdata = checkdata;
ret->priv->fullcallback = fullcallback;
diff --git a/libs/gst/base/gstindex.c b/libs/gst/base/gstindex.c
index 1df5bd2..80fbfe9 100644
--- a/libs/gst/base/gstindex.c
+++ b/libs/gst/base/gstindex.c
@@ -305,7 +305,7 @@ gst_index_new (void)
{
GstIndex *index;
- index = g_object_newv (gst_index_get_type (), 0, NULL);
+ index = g_object_new (gst_index_get_type (), NULL);
return index;
}
diff --git a/libs/gst/controller/gstinterpolationcontrolsource.c b/libs/gst/controller/gstinterpolationcontrolsource.c
index 21f5fea..ff8d8f7 100644
--- a/libs/gst/controller/gstinterpolationcontrolsource.c
+++ b/libs/gst/controller/gstinterpolationcontrolsource.c
@@ -666,7 +666,7 @@ struct _GstInterpolationControlSourcePrivate
GstControlSource *
gst_interpolation_control_source_new (void)
{
- return g_object_newv (GST_TYPE_INTERPOLATION_CONTROL_SOURCE, 0, NULL);
+ return g_object_new (GST_TYPE_INTERPOLATION_CONTROL_SOURCE, NULL);
}
static gboolean
diff --git a/libs/gst/controller/gstlfocontrolsource.c b/libs/gst/controller/gstlfocontrolsource.c
index 403adf5..e0adaaf 100644
--- a/libs/gst/controller/gstlfocontrolsource.c
+++ b/libs/gst/controller/gstlfocontrolsource.c
@@ -424,7 +424,7 @@ gst_lfo_control_source_reset (GstLFOControlSource * self)
GstControlSource *
gst_lfo_control_source_new (void)
{
- return g_object_newv (GST_TYPE_LFO_CONTROL_SOURCE, 0, NULL);
+ return g_object_new (GST_TYPE_LFO_CONTROL_SOURCE, NULL);
}
static gboolean
diff --git a/libs/gst/controller/gsttriggercontrolsource.c b/libs/gst/controller/gsttriggercontrolsource.c
index 8fd0c83..438ccb1 100644
--- a/libs/gst/controller/gsttriggercontrolsource.c
+++ b/libs/gst/controller/gsttriggercontrolsource.c
@@ -188,7 +188,7 @@ G_DEFINE_TYPE_WITH_CODE (GstTriggerControlSource, gst_trigger_control_source,
GstControlSource *
gst_trigger_control_source_new (void)
{
- return g_object_newv (GST_TYPE_TRIGGER_CONTROL_SOURCE, 0, NULL);
+ return g_object_new (GST_TYPE_TRIGGER_CONTROL_SOURCE, NULL);
}
static void
diff --git a/tests/check/gst/gstcontroller.c b/tests/check/gst/gstcontroller.c
index 531e727..ed91ffc 100644
--- a/tests/check/gst/gstcontroller.c
+++ b/tests/check/gst/gstcontroller.c
@@ -231,7 +231,7 @@ static GType gst_test_control_source_get_type (void);
static GstTestControlSource *
gst_test_control_source_new (void)
{
- return g_object_newv (GST_TYPE_TEST_CONTROL_SOURCE, 0, NULL);
+ return g_object_new (GST_TYPE_TEST_CONTROL_SOURCE, NULL);
}
static gboolean
diff --git a/tests/check/gst/gstelementfactory.c b/tests/check/gst/gstelementfactory.c
index 47c125c..294ebf1 100644
--- a/tests/check/gst/gstelementfactory.c
+++ b/tests/check/gst/gstelementfactory.c
@@ -50,7 +50,7 @@ setup_factory (void)
GstPluginFeature *feature;
GstElementFactory *factory;
- feature = g_object_newv (GST_TYPE_ELEMENT_FACTORY, 0, NULL);
+ feature = g_object_new (GST_TYPE_ELEMENT_FACTORY, NULL);
gst_plugin_feature_set_name (feature, "test");
factory = GST_ELEMENT_FACTORY_CAST (feature);