oggmux: port to gstcollectpads2
authorThiago Santos <thiagoss@embedded.ufcg.edu.br>
Mon, 10 Aug 2009 01:48:29 +0000 (01:48 +0000)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 28 Oct 2011 08:06:16 +0000 (10:06 +0200)
ext/ogg/gstoggmux.c
ext/ogg/gstoggmux.h

index f95402a..58dd85f 100644 (file)
@@ -117,7 +117,7 @@ static void gst_ogg_mux_init (GstOggMux * ogg_mux);
 static void gst_ogg_mux_finalize (GObject * object);
 
 static GstFlowReturn
-gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux);
+gst_ogg_mux_collected (GstCollectPads2 * pads, GstOggMux * ogg_mux);
 static gboolean gst_ogg_mux_handle_src_event (GstPad * pad, GstEvent * event);
 static GstPad *gst_ogg_mux_request_new_pad (GstElement * element,
     GstPadTemplate * templ, const gchar * name);
@@ -266,9 +266,9 @@ gst_ogg_mux_init (GstOggMux * ogg_mux)
   /* seed random number generator for creation of serial numbers */
   srand (time (NULL));
 
-  ogg_mux->collect = gst_collect_pads_new ();
-  gst_collect_pads_set_function (ogg_mux->collect,
-      (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_ogg_mux_collected),
+  ogg_mux->collect = gst_collect_pads2_new ();
+  gst_collect_pads2_set_function (ogg_mux->collect,
+      (GstCollectPads2Function) GST_DEBUG_FUNCPTR (gst_ogg_mux_collected),
       ogg_mux);
 
   ogg_mux->max_delay = DEFAULT_MAX_DELAY;
@@ -294,7 +294,7 @@ gst_ogg_mux_finalize (GObject * object)
 }
 
 static void
-gst_ogg_mux_ogg_pad_destroy_notify (GstCollectData * data)
+gst_ogg_mux_ogg_pad_destroy_notify (GstCollectData2 * data)
 {
   GstOggPadData *oggpad = (GstOggPadData *) data;
   GstBuffer *buf;
@@ -465,8 +465,8 @@ gst_ogg_mux_request_new_pad (GstElement * element,
       GstOggPadData *oggpad;
 
       oggpad = (GstOggPadData *)
-          gst_collect_pads_add_pad_full (ogg_mux->collect, newpad,
-          sizeof (GstOggPadData), gst_ogg_mux_ogg_pad_destroy_notify);
+          gst_collect_pads2_add_pad_full (ogg_mux->collect, newpad,
+          sizeof (GstOggPadData), gst_ogg_mux_ogg_pad_destroy_notify, TRUE);
       ogg_mux->active_pads++;
 
       oggpad->map.serialno = serial;
@@ -522,7 +522,7 @@ gst_ogg_mux_release_pad (GstElement * element, GstPad * pad)
 
   ogg_mux = GST_OGG_MUX (gst_pad_get_parent (pad));
 
-  gst_collect_pads_remove_pad (ogg_mux->collect, pad);
+  gst_collect_pads2_remove_pad (ogg_mux->collect, pad);
   gst_element_remove_pad (element, pad);
 
   gst_object_unref (ogg_mux);
@@ -935,9 +935,9 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux, gboolean * popped)
   walk = ogg_mux->collect->data;
   while (walk) {
     GstOggPadData *pad;
-    GstCollectData *data;
+    GstCollectData2 *data;
 
-    data = (GstCollectData *) walk->data;
+    data = (GstCollectData2 *) walk->data;
     pad = (GstOggPadData *) data;
 
     walk = g_slist_next (walk);
@@ -948,7 +948,7 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux, gboolean * popped)
     if (pad->buffer == NULL) {
       GstBuffer *buf;
 
-      buf = gst_collect_pads_pop (ogg_mux->collect, data);
+      buf = gst_collect_pads2_pop (ogg_mux->collect, data);
       GST_LOG_OBJECT (data->pad, "popped buffer %" GST_PTR_FORMAT, buf);
 
       /* On EOS we get a NULL buffer */
@@ -1557,7 +1557,7 @@ gst_ogg_mux_process_best_pad (GstOggMux * ogg_mux, GstOggPadData * best)
       ogg_mux->pulling ? ogg_mux->pulling->collect.pad : NULL);
 
   if (ogg_mux->pulling) {
-    next_buf = gst_collect_pads_peek (ogg_mux->collect,
+    next_buf = gst_collect_pads2_peek (ogg_mux->collect,
         &ogg_mux->pulling->collect);
     if (next_buf) {
       ogg_mux->pulling->eos = FALSE;
@@ -1571,7 +1571,7 @@ gst_ogg_mux_process_best_pad (GstOggMux * ogg_mux, GstOggPadData * best)
   /* We could end up pushing from the best pad instead, so check that
    * as well */
   if (best && best != ogg_mux->pulling) {
-    next_buf = gst_collect_pads_peek (ogg_mux->collect, &best->collect);
+    next_buf = gst_collect_pads2_peek (ogg_mux->collect, &best->collect);
     if (next_buf) {
       best->eos = FALSE;
       gst_buffer_unref (next_buf);
@@ -1863,7 +1863,7 @@ gst_ogg_mux_process_best_pad (GstOggMux * ogg_mux, GstOggPadData * best)
  * Returns TRUE if all pads are EOS.
  */
 static gboolean
-all_pads_eos (GstCollectPads * pads)
+all_pads_eos (GstCollectPads2 * pads)
 {
   GSList *walk;
 
@@ -1894,7 +1894,7 @@ all_pads_eos (GstCollectPads * pads)
  * are all empty, and then sends EOS.
  */
 static GstFlowReturn
-gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux)
+gst_ogg_mux_collected (GstCollectPads2 * pads, GstOggMux * ogg_mux)
 {
   GstOggPadData *best;
   GstFlowReturn ret;
@@ -1979,7 +1979,7 @@ gst_ogg_mux_set_property (GObject * object,
 
 /* reset all variables in the ogg pads. */
 static void
-gst_ogg_mux_init_collectpads (GstCollectPads * collect)
+gst_ogg_mux_init_collectpads (GstCollectPads2 * collect)
 {
   GSList *walk;
 
@@ -2007,7 +2007,7 @@ gst_ogg_mux_init_collectpads (GstCollectPads * collect)
 
 /* Clear all buffers from the collectpads object */
 static void
-gst_ogg_mux_clear_collectpads (GstCollectPads * collect)
+gst_ogg_mux_clear_collectpads (GstCollectPads2 * collect)
 {
   GSList *walk;
 
@@ -2051,12 +2051,12 @@ gst_ogg_mux_change_state (GstElement * element, GstStateChange transition)
     case GST_STATE_CHANGE_READY_TO_PAUSED:
       gst_ogg_mux_clear (ogg_mux);
       gst_ogg_mux_init_collectpads (ogg_mux->collect);
-      gst_collect_pads_start (ogg_mux->collect);
+      gst_collect_pads2_start (ogg_mux->collect);
       break;
     case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
       break;
     case GST_STATE_CHANGE_PAUSED_TO_READY:
-      gst_collect_pads_stop (ogg_mux->collect);
+      gst_collect_pads2_stop (ogg_mux->collect);
       break;
     default:
       break;
index 1e2e8a9..64d71a1 100644 (file)
@@ -24,7 +24,7 @@
 #include <ogg/ogg.h>
 
 #include <gst/gst.h>
-#include <gst/base/gstcollectpads.h>
+#include <gst/base/gstcollectpads2.h>
 #include "gstoggstream.h"
 
 G_BEGIN_DECLS
@@ -48,7 +48,7 @@ GstOggPadState;
 /* all information needed for one ogg stream */
 typedef struct
 {
-  GstCollectData collect;       /* we extend the CollectData */
+  GstCollectData2 collect;       /* we extend the CollectData */
 
   GstOggStream map;
   gboolean have_type;
@@ -101,7 +101,7 @@ struct _GstOggMux
   GstPad *srcpad;
 
   /* sinkpads */
-  GstCollectPads *collect;
+  GstCollectPads2 *collect;
 
   /* number of pads which have not received EOS */
   gint active_pads;