change gst_pad_select() to gst_pad_selectv(), and add/fix gst_pad_select() and gst_pa...
authorDavid Schleef <ds@schleef.org>
Tue, 2 Dec 2003 04:39:00 +0000 (04:39 +0000)
committerDavid Schleef <ds@schleef.org>
Tue, 2 Dec 2003 04:39:00 +0000 (04:39 +0000)
Original commit message from CVS:
change gst_pad_select() to gst_pad_selectv(), and add/fix gst_pad_select()
and gst_pad_select_valist()

gst/elements/gstaggregator.c
gst/gstpad.c
gst/gstpad.h
plugins/elements/gstaggregator.c

index f5e6e31..a31036b 100644 (file)
@@ -334,7 +334,7 @@ gst_aggregator_loop (GstElement *element)
 
       debug = "loop_select";
 
-      pad = gst_pad_select (aggregator->sinkpads);
+      pad = gst_pad_selectv (aggregator->sinkpads);
       buf = GST_BUFFER (gst_pad_pull (pad));
 
       gst_aggregator_push (aggregator, pad, buf, debug);
index 446b068..b41899d 100644 (file)
@@ -2422,7 +2422,7 @@ restart:
 }
 
 /**
- * gst_pad_select:
+ * gst_pad_selectv:
  * @padlist: a #GList of pads.
  *
  * Waits for a buffer on any of the list of pads.
@@ -2431,7 +2431,7 @@ restart:
  * Use #gst_pad_pull() to get the buffer.
  */
 GstPad*
-gst_pad_select (GList *padlist)
+gst_pad_selectv (GList *padlist)
 {
   GstPad *pad;
 
@@ -2441,7 +2441,7 @@ gst_pad_select (GList *padlist)
 }
 
 /**
- * gst_pad_selectv:
+ * gst_pad_select:
  * @pad: a first #GstPad to perform the select on.
  * @...: A NULL-terminated list of more pads to select on.
  *
@@ -2451,10 +2451,9 @@ gst_pad_select (GList *padlist)
  * Use #gst_pad_pull() to get the buffer.
  */
 GstPad*
-gst_pad_selectv (GstPad *pad, ...)
+gst_pad_select (GstPad *pad, ...)
 {
   GstPad *result;
-  GList *padlist = NULL;
   va_list var_args;
 
   if (pad == NULL)
@@ -2462,15 +2461,39 @@ gst_pad_selectv (GstPad *pad, ...)
 
   va_start (var_args, pad);
 
+  result = gst_pad_select_valist (pad, var_args);
+
+  va_end (var_args);
+  
+  return result;
+}
+
+/**
+ * gst_pad_select_valist:
+ * @pad: a first #GstPad to perform the select on.
+ * @varargs: A va_list of more pads to select on.
+ *
+ * Waits for a buffer on the given set of pads.
+ *
+ * Returns: the #GstPad that has a buffer available.
+ * Use #gst_pad_pull() to get the buffer.
+ */
+GstPad*
+gst_pad_select_valist (GstPad *pad, va_list var_args)
+{
+  GstPad *result;
+  GList *padlist = NULL;
+
+  if (pad == NULL)
+    return NULL;
+
   while (pad) {
     padlist = g_list_prepend (padlist, pad);
     pad = va_arg (var_args, GstPad *);
   }
-  result = gst_pad_select (padlist);
+  result = gst_pad_selectv (padlist);
   g_list_free (padlist);
 
-  va_end (var_args);
-  
   return result;
 }
 
index db0a22c..d50f5b6 100644 (file)
@@ -476,8 +476,9 @@ void                        gst_pad_push                            (GstPad *pad, GstData *data);
 GstData*               gst_pad_pull                            (GstPad *pad);
 gboolean               gst_pad_send_event                      (GstPad *pad, GstEvent *event);
 gboolean               gst_pad_event_default                   (GstPad *pad, GstEvent *event);
-GstPad*                        gst_pad_select                          (GList *padlist);
-GstPad*                        gst_pad_selectv                         (GstPad *pad, ...);
+GstPad*                        gst_pad_selectv                         (GList *padlist);
+GstPad*                        gst_pad_select                          (GstPad *pad, ...);
+GstPad*                        gst_pad_select_valist                   (GstPad *pad, va_list varargs);
 
 
 /* convert/query/format functions */
index f5e6e31..a31036b 100644 (file)
@@ -334,7 +334,7 @@ gst_aggregator_loop (GstElement *element)
 
       debug = "loop_select";
 
-      pad = gst_pad_select (aggregator->sinkpads);
+      pad = gst_pad_selectv (aggregator->sinkpads);
       buf = GST_BUFFER (gst_pad_pull (pad));
 
       gst_aggregator_push (aggregator, pad, buf, debug);