diff --git a/gst/elements/gstbufferstore.c b/gst/elements/gstbufferstore.c index f399ab4d61..8d38740da5 100644 --- a/gst/elements/gstbufferstore.c +++ b/gst/elements/gstbufferstore.c @@ -119,7 +119,7 @@ gst_buffer_store_class_init (gpointer g_class, gpointer class_data) gst_buffer_store_signals[BUFFER_ADDED] = g_signal_new ("buffer-added", G_TYPE_FROM_CLASS (g_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstBufferStoreClass, buffer_added), continue_accu, NULL, - gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); + gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, GST_TYPE_BUFFER); store_class->cleared = gst_buffer_store_cleared_func; store_class->buffer_added = gst_buffer_store_add_buffer_func; diff --git a/gst/elements/gstfakesink.c b/gst/elements/gstfakesink.c index 4e8d3c010e..4f23d8b362 100644 --- a/gst/elements/gstfakesink.c +++ b/gst/elements/gstfakesink.c @@ -173,8 +173,8 @@ gst_fakesink_class_init (GstFakeSinkClass *klass) gst_fakesink_signals[SIGNAL_HANDOFF] = g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstFakeSinkClass, handoff), NULL, NULL, - g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + gst_marshal_VOID__POINTER_OBJECT, G_TYPE_NONE, 1, + GST_TYPE_BUFFER, GST_TYPE_PAD); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesink_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesink_get_property); diff --git a/gst/elements/gstfakesrc.c b/gst/elements/gstfakesrc.c index 3a82dc0c9d..b27ea09481 100644 --- a/gst/elements/gstfakesrc.c +++ b/gst/elements/gstfakesrc.c @@ -269,8 +269,8 @@ gst_fakesrc_class_init (GstFakeSrcClass *klass) gst_fakesrc_signals[SIGNAL_HANDOFF] = g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstFakeSrcClass, handoff), NULL, NULL, - g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + gst_marshal_VOID__POINTER_OBJECT, G_TYPE_NONE, 2, + GST_TYPE_BUFFER, GST_TYPE_PAD); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesrc_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesrc_get_property); diff --git a/gst/elements/gstidentity.c b/gst/elements/gstidentity.c index 24021be6b1..fadfa84ad9 100644 --- a/gst/elements/gstidentity.c +++ b/gst/elements/gstidentity.c @@ -145,8 +145,8 @@ gst_identity_class_init (GstIdentityClass *klass) gst_identity_signals[SIGNAL_HANDOFF] = g_signal_new ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstIdentityClass, handoff), NULL, NULL, - g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, + GST_TYPE_BUFFER); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_identity_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property); diff --git a/gst/gstbin.c b/gst/gstbin.c index a012b4d709..bec55ec430 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -135,11 +135,11 @@ gst_bin_class_init (GstBinClass * klass) gst_bin_signals[ELEMENT_ADDED] = g_signal_new ("element_added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GstBinClass, element_added), NULL, NULL, - gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); + gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, GST_TYPE_ELEMENT); gst_bin_signals[ELEMENT_REMOVED] = g_signal_new ("element_removed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GstBinClass, element_removed), NULL, NULL, - gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); + gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, GST_TYPE_ELEMENT); gst_bin_signals[ITERATE] = g_signal_new ("iterate", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstBinClass, iterate), diff --git a/gst/gstindex.c b/gst/gstindex.c index 2fee10915f..23f6ce74a3 100644 --- a/gst/gstindex.c +++ b/gst/gstindex.c @@ -88,6 +88,20 @@ gst_index_resolver_get_type (void) return index_resolver_type; } +GType +gst_index_entry_get_type (void) +{ + static GType index_entry_type = 0; + + if (!index_entry_type) { + index_entry_type = g_boxed_type_register_static ("GstIndexEntry", + (GBoxedCopyFunc) gst_index_entry_copy, + (GBoxedFreeFunc) gst_index_entry_free); + } + return index_entry_type; +} + + GType gst_index_get_type (void) { static GType index_type = 0; @@ -381,6 +395,18 @@ gst_index_set_resolver (GstIndex *index, index->method = GST_INDEX_RESOLVER_CUSTOM; } +/** + * gst_index_entry_copy: + * @entry: the entry to copy + * + * Copies an entry and returns the result. + */ +GstIndexEntry * +gst_index_entry_copy (GstIndexEntry *entry) +{ + return g_memdup(entry, sizeof(*entry)); +} + /** * gst_index_entry_free: * @entry: the entry to free diff --git a/gst/gstindex.h b/gst/gstindex.h index aa05ace801..fa6231b50b 100644 --- a/gst/gstindex.h +++ b/gst/gstindex.h @@ -229,6 +229,7 @@ GstIndexEntry* gst_index_get_assoc_entry_full (GstIndex *index, gint id, gpointer user_data); /* working with index entries */ +GstIndexEntry * gst_index_entry_copy (GstIndexEntry *entry); void gst_index_entry_free (GstIndexEntry *entry); gboolean gst_index_entry_assoc_map (GstIndexEntry *entry, GstFormat format, gint64 *value); diff --git a/gst/gstmarshal.list b/gst/gstmarshal.list index 0340c85f76..fabedd9c6f 100644 --- a/gst/gstmarshal.list +++ b/gst/gstmarshal.list @@ -3,6 +3,7 @@ VOID:BOOLEAN VOID:INT VOID:STRING VOID:POINTER +VOID:POINTER,OBJECT VOID:OBJECT VOID:OBJECT,PARAM VOID:OBJECT,POINTER diff --git a/gst/gstobject.c b/gst/gstobject.c index f45648c4d0..d6ea419175 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -139,6 +139,7 @@ gst_object_class_init (GstObjectClass *klass) g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); #ifndef GST_DISABLE_LOADSAVE_REGISTRY + /* FIXME This should be the GType of xmlNodePtr instead of G_TYPE_POINTER */ gst_object_signals[OBJECT_SAVED] = g_signal_new ("object_saved", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstObjectClass, object_saved), NULL, NULL, diff --git a/gst/gstpad.c b/gst/gstpad.c index 9966d7954f..446b0682d5 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -170,17 +170,17 @@ gst_real_pad_class_init (GstRealPadClass *klass) g_signal_new ("caps_nego_failed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, caps_nego_failed), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + GST_TYPE_CAPS); gst_real_pad_signals[REAL_LINKED] = g_signal_new ("linked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, linked), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + GST_TYPE_PAD); gst_real_pad_signals[REAL_UNLINKED] = g_signal_new ("unlinked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRealPadClass, unlinked), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + GST_TYPE_PAD); /* gtk_object_add_arg_type ("GstRealPad::active", G_TYPE_BOOLEAN, */ /* GTK_ARG_READWRITE, REAL_ARG_ACTIVE); */ diff --git a/gst/gstplugin.c b/gst/gstplugin.c index a39987bc09..b8f0759884 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -63,6 +63,19 @@ static void gst_plugin_desc_copy (GstPluginDesc *dest, static GstPlugin * gst_plugin_register_func (GstPlugin *plugin, GModule *module, GstPluginDesc *desc); + +GType +gst_plugin_get_type (void) +{ + static GType plugin_type; + + if (plugin_type == 0) { + plugin_type = g_boxed_type_register_static ("GstPlugin", NULL, g_free); + } + + return plugin_type; +} + GQuark gst_plugin_error_quark (void) { @@ -248,6 +261,16 @@ gst_plugin_load_file (const gchar *filename, GError **error) } GST_LOG ("Plugin %p for file \"%s\" prepared, calling entry function...", plugin, filename); + if (g_module_symbol (module, "plugin_init", &ptr)) { + g_print ("plugin %p from file \"%s\" exports a symbol named plugin_init\n", + plugin, plugin->filename); + g_set_error (error, + GST_PLUGIN_ERROR, + GST_PLUGIN_ERROR_NAME_MISMATCH, + "plugin \"%s\" exports a symbol named plugin_init", + desc->name); + } + if (gst_plugin_register_func (plugin, module, desc)) { GST_INFO ("plugin \"%s\" loaded", plugin->filename); return plugin; diff --git a/gst/gstplugin.h b/gst/gstplugin.h index 7e8ce2bd92..ae54425c73 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -128,10 +128,13 @@ _gst_plugin_static_init__ ##init (void) \ #define GST_LICENSE_UNKNOWN "unknown" + /* function for filters */ typedef gboolean (*GstPluginFilter) (GstPlugin *plugin, gpointer user_data); +#define GST_TYPE_PLUGIN (gst_plugin_get_type()) +GType gst_plugin_get_type (void); void _gst_plugin_initialize (void); void _gst_plugin_register_static (GstPluginDesc *desc); diff --git a/gst/gstregistry.c b/gst/gstregistry.c index df0f856279..3632a11d00 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -85,7 +85,7 @@ gst_registry_class_init (GstRegistryClass *klass) g_signal_new ("plugin_added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRegistryClass, plugin_added), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + GST_TYPE_PLUGIN); gobject_class->dispose = NULL; } diff --git a/gst/gstxml.c b/gst/gstxml.c index 4d413a5841..833008ae86 100644 --- a/gst/gstxml.c +++ b/gst/gstxml.c @@ -71,6 +71,7 @@ gst_xml_class_init (GstXMLClass *klass) parent_class = g_type_class_ref (GST_TYPE_OBJECT); + /* FIXME G_TYPE_POINTER should be GType of xmlNodePtr */ gst_xml_signals[OBJECT_LOADED] = g_signal_new ("object_loaded", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstXMLClass, object_loaded), NULL, NULL, diff --git a/plugins/elements/gstbufferstore.c b/plugins/elements/gstbufferstore.c index f399ab4d61..8d38740da5 100644 --- a/plugins/elements/gstbufferstore.c +++ b/plugins/elements/gstbufferstore.c @@ -119,7 +119,7 @@ gst_buffer_store_class_init (gpointer g_class, gpointer class_data) gst_buffer_store_signals[BUFFER_ADDED] = g_signal_new ("buffer-added", G_TYPE_FROM_CLASS (g_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstBufferStoreClass, buffer_added), continue_accu, NULL, - gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); + gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, GST_TYPE_BUFFER); store_class->cleared = gst_buffer_store_cleared_func; store_class->buffer_added = gst_buffer_store_add_buffer_func; diff --git a/plugins/elements/gstfakesink.c b/plugins/elements/gstfakesink.c index 4e8d3c010e..4f23d8b362 100644 --- a/plugins/elements/gstfakesink.c +++ b/plugins/elements/gstfakesink.c @@ -173,8 +173,8 @@ gst_fakesink_class_init (GstFakeSinkClass *klass) gst_fakesink_signals[SIGNAL_HANDOFF] = g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstFakeSinkClass, handoff), NULL, NULL, - g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + gst_marshal_VOID__POINTER_OBJECT, G_TYPE_NONE, 1, + GST_TYPE_BUFFER, GST_TYPE_PAD); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesink_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesink_get_property); diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index 3a82dc0c9d..b27ea09481 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -269,8 +269,8 @@ gst_fakesrc_class_init (GstFakeSrcClass *klass) gst_fakesrc_signals[SIGNAL_HANDOFF] = g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstFakeSrcClass, handoff), NULL, NULL, - g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + gst_marshal_VOID__POINTER_OBJECT, G_TYPE_NONE, 2, + GST_TYPE_BUFFER, GST_TYPE_PAD); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesrc_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesrc_get_property); diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index 24021be6b1..fadfa84ad9 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -145,8 +145,8 @@ gst_identity_class_init (GstIdentityClass *klass) gst_identity_signals[SIGNAL_HANDOFF] = g_signal_new ("handoff", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstIdentityClass, handoff), NULL, NULL, - g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, - G_TYPE_POINTER); + gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, + GST_TYPE_BUFFER); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_identity_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);