gst/: Patch from Alessandro Decina adding get_type_full and get_protocols_full privat...
authorAlessandro Decina <alessandro@nnva.org>
Thu, 25 Oct 2007 16:19:05 +0000 (16:19 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Thu, 25 Oct 2007 16:19:05 +0000 (16:19 +0000)
Original commit message from CVS:
* gst/gstelementfactory.c: (gst_element_register):
* gst/gsturi.h:
Patch from Alessandro Decina adding get_type_full and
get_protocols_full private vfuncs to the URIHandler interface
to allow bindings to support creating URI handlers.
Partially fixes: #339279
API: GstURIHandlerInterface::get_type_full
API: GstURIHandlerInterface::get_protocols_full

ChangeLog
gst/gstelementfactory.c
gst/gsturi.h

index 865fc4e..dd66e85 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2007-10-25  Jan Schmidt  <Jan.Schmidt@sun.com>
 
+       * gst/gstelementfactory.c: (gst_element_register):
+       * gst/gsturi.h:
+       Patch from Alessandro Decina adding get_type_full and
+       get_protocols_full private vfuncs to the URIHandler interface
+       to allow bindings to support creating URI handlers. 
+       Partially fixes: #339279
+       API: GstURIHandlerInterface::get_type_full
+       API: GstURIHandlerInterface::get_protocols_full
+
+2007-10-25  Jan Schmidt  <Jan.Schmidt@sun.com>
+
        * plugins/elements/gstmultiqueue.c: (gst_multi_queue_set_property),
        (gst_multi_queue_request_new_pad), (gst_single_queue_flush),
        (gst_multi_queue_loop), (gst_multi_queue_sink_activate_push):
index cc6367e..aed6898 100644 (file)
@@ -309,12 +309,19 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
     GstURIHandlerInterface *iface = (GstURIHandlerInterface *)
         g_type_interface_peek (klass, GST_TYPE_URI_HANDLER);
 
-    if (!iface || !iface->get_type || !iface->get_protocols)
+    if (!iface || (!iface->get_type && !iface->get_type_full) ||
+        (!iface->get_protocols && !iface->get_protocols_full))
       goto urierror;
-    factory->uri_type = iface->get_type ();
+    if (iface->get_type)
+      factory->uri_type = iface->get_type ();
+    else if (iface->get_type_full)
+      factory->uri_type = iface->get_type_full (factory->type);
     if (!GST_URI_TYPE_IS_VALID (factory->uri_type))
       goto urierror;
-    factory->uri_protocols = g_strdupv (iface->get_protocols ());
+    if (iface->get_protocols)
+      factory->uri_protocols = g_strdupv (iface->get_protocols ());
+    else if (iface->get_protocols_full)
+      factory->uri_protocols = iface->get_protocols_full (factory->type);
     if (!factory->uri_protocols)
       goto urierror;
   }
index 899bdad..eef0cf7 100644 (file)
@@ -75,6 +75,14 @@ typedef struct _GstURIHandlerInterface GstURIHandlerInterface;
  * @get_protocols: Method to return the list of protocols handled by the element.
  * @get_uri: Method to return the URI currently handled by the element.
  * @set_uri: Method to set a new URI.
+ * @get_type_full: Variant of get_type which takes a GType argument. This is 
+ *  for use by bindings that need to pass context when creating a URI Handler.  *  If implemented, get_type will be used in preference to get_type_full.
+ *      Since: 0.10.15
+ * @get_protocols_full: Variant of get_type which takes a GType argument. 
+ * This is for use by bindings that need to pass context when creating a URI 
+ * Handler. If implemented, get_protocols will be used in preference to 
+ * get_protocols_full.
+ *      Since: 0.10.15
  *
  * #GstElements using this interface should implement these methods.
  */
@@ -103,11 +111,14 @@ struct _GstURIHandlerInterface {
   gboolean             (* set_uri)             (GstURIHandler * handler,
                                                 const gchar *   uri);
 
+  GstURIType           (* get_type_full)       (GType type);
+  gchar **             (* get_protocols_full)  (GType type);
+
   /*< private >*/
   /* we might want to add functions here to query features,
    * someone with gnome-vfs knowledge go ahead */
 
-  gpointer _gst_reserved[GST_PADDING];
+  gpointer _gst_reserved[GST_PADDING - 2];
 };
 
 /* general URI functions */