Commit 35d140ad authored by Niels De Graef's avatar Niels De Graef Committed by Thibault Saunier

Don't pass default GLib marshallers for signals

By passing NULL to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.

Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.
parent 44420b2e
Pipeline #76131 passed with stages
in 54 minutes and 11 seconds
......@@ -467,8 +467,7 @@ ges_container_class_init (GESContainerClass * klass)
ges_container_signals[CHILD_ADDED_SIGNAL] =
g_signal_new ("child-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESContainerClass, child_added),
NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 1, GES_TYPE_TIMELINE_ELEMENT);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_TIMELINE_ELEMENT);
/**
* GESContainer::child-removed:
......@@ -480,8 +479,7 @@ ges_container_class_init (GESContainerClass * klass)
ges_container_signals[CHILD_REMOVED_SIGNAL] =
g_signal_new ("child-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GESContainerClass, child_removed),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1,
GES_TYPE_TIMELINE_ELEMENT);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_TIMELINE_ELEMENT);
element_class->set_start = _set_start;
......
......@@ -196,7 +196,7 @@ ges_layer_class_init (GESLayerClass * klass)
ges_layer_signals[OBJECT_ADDED] =
g_signal_new ("clip-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESLayerClass, object_added),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_CLIP);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_CLIP);
/**
* GESLayer::clip-removed:
......@@ -208,8 +208,7 @@ ges_layer_class_init (GESLayerClass * klass)
ges_layer_signals[OBJECT_REMOVED] =
g_signal_new ("clip-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESLayerClass,
object_removed), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
1, GES_TYPE_CLIP);
object_removed), NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_CLIP);
}
static void
......
......@@ -177,7 +177,7 @@ ges_marker_list_class_init (GESMarkerListClass * klass)
*/
ges_marker_list_signals[MARKER_ADDED] =
g_signal_new ("marker-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_UINT64, GES_TYPE_MARKER);
/**
......@@ -190,8 +190,7 @@ ges_marker_list_class_init (GESMarkerListClass * klass)
*/
ges_marker_list_signals[MARKER_REMOVED] =
g_signal_new ("marker-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 1, GES_TYPE_MARKER);
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_MARKER);
/**
* GESMarkerList::marker-moved:
......@@ -205,7 +204,7 @@ ges_marker_list_class_init (GESMarkerListClass * klass)
*/
ges_marker_list_signals[MARKER_MOVED] =
g_signal_new ("marker-moved", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_UINT64, G_TYPE_UINT64, GES_TYPE_MARKER);
}
......
......@@ -76,7 +76,7 @@ ges_meta_container_default_init (GESMetaContainerInterface * iface)
_signals[NOTIFY_SIGNAL] =
g_signal_new ("notify-meta", G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED |
G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_generic,
G_SIGNAL_NO_HOOKS, 0, NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE);
}
......
......@@ -503,7 +503,7 @@ ges_project_class_init (GESProjectClass * klass)
_signals[ASSET_ADDED_SIGNAL] =
g_signal_new ("asset-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GESProjectClass, asset_added),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_ASSET);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_ASSET);
/**
* GESProject::asset-loading:
......@@ -515,7 +515,7 @@ ges_project_class_init (GESProjectClass * klass)
_signals[ASSET_LOADING_SIGNAL] =
g_signal_new ("asset-loading", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GESProjectClass, asset_loading),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_ASSET);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_ASSET);
/**
* GESProject::asset-removed:
......@@ -525,7 +525,7 @@ ges_project_class_init (GESProjectClass * klass)
_signals[ASSET_REMOVED_SIGNAL] =
g_signal_new ("asset-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GESProjectClass, asset_removed),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_ASSET);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_ASSET);
/**
* GESProject::loading:
......@@ -537,8 +537,7 @@ ges_project_class_init (GESProjectClass * klass)
_signals[LOADING_SIGNAL] =
g_signal_new ("loading", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESProjectClass, loading),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
1, GES_TYPE_TIMELINE);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_TIMELINE);
/**
* GESProject::loaded:
......@@ -548,8 +547,7 @@ ges_project_class_init (GESProjectClass * klass)
_signals[LOADED_SIGNAL] =
g_signal_new ("loaded", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESProjectClass, loaded),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
1, GES_TYPE_TIMELINE);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_TIMELINE);
/**
* GESProject::missing-uri:
......@@ -581,7 +579,7 @@ ges_project_class_init (GESProjectClass * klass)
_signals[MISSING_URI_SIGNAL] =
g_signal_new ("missing-uri", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GESProjectClass, missing_uri),
_uri_missing_accumulator, NULL, g_cclosure_marshal_generic,
_uri_missing_accumulator, NULL, NULL,
G_TYPE_STRING, 2, G_TYPE_ERROR, GES_TYPE_ASSET);
/**
......@@ -599,7 +597,7 @@ ges_project_class_init (GESProjectClass * klass)
_signals[ERROR_LOADING_ASSET] =
g_signal_new ("error-loading-asset", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GESProjectClass, loading_error),
NULL, NULL, g_cclosure_marshal_generic,
NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_ERROR, G_TYPE_STRING, G_TYPE_GTYPE);
/**
......@@ -612,9 +610,8 @@ ges_project_class_init (GESProjectClass * klass)
*/
_signals[ERROR_LOADING] =
g_signal_new ("error-loading", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0,
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 2, GES_TYPE_TIMELINE,
G_TYPE_ERROR);
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 2, GES_TYPE_TIMELINE, G_TYPE_ERROR);
object_class->dispose = _dispose;
object_class->finalize = _finalize;
......
......@@ -427,7 +427,7 @@ ges_timeline_element_class_init (GESTimelineElementClass * klass)
ges_timeline_element_signals[DEEP_NOTIFY] =
g_signal_new ("deep-notify", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED |
G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_generic,
G_SIGNAL_NO_HOOKS, 0, NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_PARAM);
object_class->dispose = ges_timeline_element_dispose;
......
......@@ -533,7 +533,7 @@ ges_timeline_class_init (GESTimelineClass * klass)
ges_timeline_signals[TRACK_ADDED] =
g_signal_new ("track-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESTimelineClass, track_added), NULL,
NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_TRACK);
NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_TRACK);
/**
* GESTimeline::track-removed:
......@@ -545,7 +545,7 @@ ges_timeline_class_init (GESTimelineClass * klass)
ges_timeline_signals[TRACK_REMOVED] =
g_signal_new ("track-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESTimelineClass, track_removed),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_TRACK);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_TRACK);
/**
* GESTimeline::layer-added:
......@@ -557,7 +557,7 @@ ges_timeline_class_init (GESTimelineClass * klass)
ges_timeline_signals[LAYER_ADDED] =
g_signal_new ("layer-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESTimelineClass, layer_added), NULL,
NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_LAYER);
NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_LAYER);
/**
* GESTimeline::layer-removed:
......@@ -569,7 +569,7 @@ ges_timeline_class_init (GESTimelineClass * klass)
ges_timeline_signals[LAYER_REMOVED] =
g_signal_new ("layer-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESTimelineClass, layer_removed),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_LAYER);
NULL, NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_LAYER);
/**
* GESTimeline::group-added
......@@ -581,7 +581,7 @@ ges_timeline_class_init (GESTimelineClass * klass)
ges_timeline_signals[GROUP_ADDED] =
g_signal_new ("group-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESTimelineClass, group_added), NULL,
NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_GROUP);
NULL, NULL, G_TYPE_NONE, 1, GES_TYPE_GROUP);
/**
* GESTimeline::group-removed
......@@ -594,8 +594,7 @@ ges_timeline_class_init (GESTimelineClass * klass)
ges_timeline_signals[GROUP_REMOVED] =
g_signal_new ("group-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESTimelineClass, group_removed),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 2, GES_TYPE_GROUP,
G_TYPE_PTR_ARRAY);
NULL, NULL, NULL, G_TYPE_NONE, 2, GES_TYPE_GROUP, G_TYPE_PTR_ARRAY);
/**
* GESTimeline::snapping-started:
......
......@@ -297,7 +297,7 @@ ges_track_element_class_init (GESTrackElementClass * klass)
*/
ges_track_element_signals[CONTROL_BINDING_ADDED] =
g_signal_new ("control-binding-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 1, GST_TYPE_CONTROL_BINDING);
/**
......@@ -310,7 +310,7 @@ ges_track_element_class_init (GESTrackElementClass * klass)
*/
ges_track_element_signals[CONTROL_BINDING_REMOVED] =
g_signal_new ("control-binding-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 1, GST_TYPE_CONTROL_BINDING);
element_class->set_start = _set_start;
......
......@@ -718,7 +718,7 @@ ges_track_class_init (GESTrackClass * klass)
*/
ges_track_signals[TRACK_ELEMENT_ADDED] =
g_signal_new ("track-element-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 1, GES_TYPE_TRACK_ELEMENT);
/**
......@@ -730,7 +730,7 @@ ges_track_class_init (GESTrackClass * klass)
*/
ges_track_signals[TRACK_ELEMENT_REMOVED] =
g_signal_new ("track-element-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 1, GES_TYPE_TRACK_ELEMENT);
/**
......
......@@ -1064,8 +1064,7 @@ nle_composition_class_init (NleCompositionClass * klass)
_signals[COMMITED_SIGNAL] =
g_signal_new ("commited", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
0, NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
GST_DEBUG_REGISTER_FUNCPTR (_seek_pipeline_func);
GST_DEBUG_REGISTER_FUNCPTR (_remove_object_func);
......
......@@ -149,7 +149,7 @@ nle_operation_class_init (NleOperationClass * klass)
nle_operation_signals[INPUT_PRIORITY_CHANGED] =
g_signal_new ("input-priority-changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NleOperationClass,
input_priority_changed), NULL, NULL, g_cclosure_marshal_generic,
input_priority_changed), NULL, NULL, NULL,
G_TYPE_NONE, 2, GST_TYPE_PAD, G_TYPE_UINT);
gstelement_class->request_new_pad =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment