mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
collectpads2: rename to collectpads
This commit is contained in:
parent
b1a90e43c8
commit
a008aa0b46
4 changed files with 58 additions and 58 deletions
|
@ -128,10 +128,10 @@ static GstStaticPadTemplate subtitle_sink_factory =
|
|||
|
||||
static void gst_ogg_mux_finalize (GObject * object);
|
||||
|
||||
static GstFlowReturn gst_ogg_mux_collected (GstCollectPads2 * pads,
|
||||
static GstFlowReturn gst_ogg_mux_collected (GstCollectPads * pads,
|
||||
GstOggMux * ogg_mux);
|
||||
static gboolean gst_ogg_mux_sink_event (GstCollectPads2 * pads,
|
||||
GstCollectData2 * pad, GstEvent * event, gpointer user_data);
|
||||
static gboolean gst_ogg_mux_sink_event (GstCollectPads * pads,
|
||||
GstCollectData * pad, GstEvent * event, gpointer user_data);
|
||||
static gboolean gst_ogg_mux_handle_src_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static GstPad *gst_ogg_mux_request_new_pad (GstElement * element,
|
||||
|
@ -246,12 +246,12 @@ gst_ogg_mux_init (GstOggMux * ogg_mux)
|
|||
/* seed random number generator for creation of serial numbers */
|
||||
srand (time (NULL));
|
||||
|
||||
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->collect = gst_collect_pads_new ();
|
||||
gst_collect_pads_set_function (ogg_mux->collect,
|
||||
(GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_ogg_mux_collected),
|
||||
ogg_mux);
|
||||
gst_collect_pads2_set_event_function (ogg_mux->collect,
|
||||
(GstCollectPads2EventFunction) GST_DEBUG_FUNCPTR (gst_ogg_mux_sink_event),
|
||||
gst_collect_pads_set_event_function (ogg_mux->collect,
|
||||
(GstCollectPadsEventFunction) GST_DEBUG_FUNCPTR (gst_ogg_mux_sink_event),
|
||||
ogg_mux);
|
||||
|
||||
ogg_mux->max_delay = DEFAULT_MAX_DELAY;
|
||||
|
@ -277,7 +277,7 @@ gst_ogg_mux_finalize (GObject * object)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_ogg_mux_ogg_pad_destroy_notify (GstCollectData2 * data)
|
||||
gst_ogg_mux_ogg_pad_destroy_notify (GstCollectData * data)
|
||||
{
|
||||
GstOggPadData *oggpad = (GstOggPadData *) data;
|
||||
GstBuffer *buf;
|
||||
|
@ -309,7 +309,7 @@ gst_ogg_mux_sinkconnect (GstPad * pad, GstPad * peer)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_ogg_mux_sink_event (GstCollectPads2 * pads, GstCollectData2 * pad,
|
||||
gst_ogg_mux_sink_event (GstCollectPads * pads, GstCollectData * pad,
|
||||
GstEvent * event, gpointer user_data)
|
||||
{
|
||||
GstOggMux *ogg_mux = GST_OGG_MUX (user_data);
|
||||
|
@ -356,7 +356,7 @@ gst_ogg_mux_sink_event (GstCollectPads2 * pads, GstCollectData2 * pad,
|
|||
|
||||
/* now GstCollectPads can take care of the rest, e.g. EOS */
|
||||
if (event != NULL)
|
||||
return gst_collect_pads2_event_default (pads, pad, event, FALSE);
|
||||
return gst_collect_pads_event_default (pads, pad, event, FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ gst_ogg_mux_request_new_pad (GstElement * element,
|
|||
GstOggPadData *oggpad;
|
||||
|
||||
oggpad = (GstOggPadData *)
|
||||
gst_collect_pads2_add_pad_full (ogg_mux->collect, newpad,
|
||||
gst_collect_pads_add_pad_full (ogg_mux->collect, newpad,
|
||||
sizeof (GstOggPadData), gst_ogg_mux_ogg_pad_destroy_notify, FALSE);
|
||||
ogg_mux->active_pads++;
|
||||
|
||||
|
@ -510,7 +510,7 @@ gst_ogg_mux_release_pad (GstElement * element, GstPad * pad)
|
|||
|
||||
ogg_mux = GST_OGG_MUX (gst_pad_get_parent (pad));
|
||||
|
||||
gst_collect_pads2_remove_pad (ogg_mux->collect, pad);
|
||||
gst_collect_pads_remove_pad (ogg_mux->collect, pad);
|
||||
gst_element_remove_pad (element, pad);
|
||||
|
||||
gst_object_unref (ogg_mux);
|
||||
|
@ -919,9 +919,9 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux, gboolean * popped)
|
|||
walk = ogg_mux->collect->data;
|
||||
while (walk) {
|
||||
GstOggPadData *pad;
|
||||
GstCollectData2 *data;
|
||||
GstCollectData *data;
|
||||
|
||||
data = (GstCollectData2 *) walk->data;
|
||||
data = (GstCollectData *) walk->data;
|
||||
pad = (GstOggPadData *) data;
|
||||
|
||||
walk = g_slist_next (walk);
|
||||
|
@ -932,7 +932,7 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux, gboolean * popped)
|
|||
if (pad->buffer == NULL) {
|
||||
GstBuffer *buf;
|
||||
|
||||
buf = gst_collect_pads2_pop (ogg_mux->collect, data);
|
||||
buf = gst_collect_pads_pop (ogg_mux->collect, data);
|
||||
GST_LOG_OBJECT (data->pad, "popped buffer %" GST_PTR_FORMAT, buf);
|
||||
|
||||
/* On EOS we get a NULL buffer */
|
||||
|
@ -979,8 +979,8 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux, gboolean * popped)
|
|||
|
||||
if (pad->map.is_sparse) {
|
||||
GST_DEBUG_OBJECT (pad, "Pad is sparse, marking as such");
|
||||
gst_collect_pads2_set_waiting (ogg_mux->collect,
|
||||
(GstCollectData2 *) pad, FALSE);
|
||||
gst_collect_pads_set_waiting (ogg_mux->collect,
|
||||
(GstCollectData *) pad, FALSE);
|
||||
}
|
||||
}
|
||||
if (caps)
|
||||
|
@ -1584,7 +1584,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_pads2_peek (ogg_mux->collect,
|
||||
next_buf = gst_collect_pads_peek (ogg_mux->collect,
|
||||
&ogg_mux->pulling->collect);
|
||||
if (next_buf) {
|
||||
ogg_mux->pulling->eos = FALSE;
|
||||
|
@ -1598,7 +1598,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_pads2_peek (ogg_mux->collect, &best->collect);
|
||||
next_buf = gst_collect_pads_peek (ogg_mux->collect, &best->collect);
|
||||
if (next_buf) {
|
||||
best->eos = FALSE;
|
||||
gst_buffer_unref (next_buf);
|
||||
|
@ -1893,7 +1893,7 @@ gst_ogg_mux_process_best_pad (GstOggMux * ogg_mux, GstOggPadData * best)
|
|||
* Returns TRUE if all pads are EOS.
|
||||
*/
|
||||
static gboolean
|
||||
all_pads_eos (GstCollectPads2 * pads)
|
||||
all_pads_eos (GstCollectPads * pads)
|
||||
{
|
||||
GSList *walk;
|
||||
|
||||
|
@ -1924,7 +1924,7 @@ all_pads_eos (GstCollectPads2 * pads)
|
|||
* are all empty, and then sends EOS.
|
||||
*/
|
||||
static GstFlowReturn
|
||||
gst_ogg_mux_collected (GstCollectPads2 * pads, GstOggMux * ogg_mux)
|
||||
gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux)
|
||||
{
|
||||
GstOggPadData *best;
|
||||
GstFlowReturn ret;
|
||||
|
@ -2009,7 +2009,7 @@ gst_ogg_mux_set_property (GObject * object,
|
|||
|
||||
/* reset all variables in the ogg pads. */
|
||||
static void
|
||||
gst_ogg_mux_init_collectpads (GstCollectPads2 * collect)
|
||||
gst_ogg_mux_init_collectpads (GstCollectPads * collect)
|
||||
{
|
||||
GSList *walk;
|
||||
|
||||
|
@ -2037,7 +2037,7 @@ gst_ogg_mux_init_collectpads (GstCollectPads2 * collect)
|
|||
|
||||
/* Clear all buffers from the collectpads object */
|
||||
static void
|
||||
gst_ogg_mux_clear_collectpads (GstCollectPads2 * collect)
|
||||
gst_ogg_mux_clear_collectpads (GstCollectPads * collect)
|
||||
{
|
||||
GSList *walk;
|
||||
|
||||
|
@ -2081,12 +2081,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_pads2_start (ogg_mux->collect);
|
||||
gst_collect_pads_start (ogg_mux->collect);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
gst_collect_pads2_stop (ogg_mux->collect);
|
||||
gst_collect_pads_stop (ogg_mux->collect);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <ogg/ogg.h>
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstcollectpads2.h>
|
||||
#include <gst/base/gstcollectpads.h>
|
||||
#include "gstoggstream.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
@ -48,7 +48,7 @@ GstOggPadState;
|
|||
/* all information needed for one ogg stream */
|
||||
typedef struct
|
||||
{
|
||||
GstCollectData2 collect; /* we extend the CollectData */
|
||||
GstCollectData collect; /* we extend the CollectData */
|
||||
|
||||
GstOggStream map;
|
||||
gboolean have_type;
|
||||
|
@ -99,7 +99,7 @@ struct _GstOggMux
|
|||
GstPad *srcpad;
|
||||
|
||||
/* sinkpads */
|
||||
GstCollectPads2 *collect;
|
||||
GstCollectPads *collect;
|
||||
|
||||
/* number of pads which have not received EOS */
|
||||
gint active_pads;
|
||||
|
|
|
@ -116,8 +116,8 @@ static gboolean gst_adder_sink_query (GstPad * pad, GstObject * parent,
|
|||
GstQuery * query);
|
||||
static gboolean gst_adder_src_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event);
|
||||
static gboolean gst_adder_sink_event (GstCollectPads2 * pads,
|
||||
GstCollectData2 * pad, GstEvent * event, gpointer user_data);
|
||||
static gboolean gst_adder_sink_event (GstCollectPads * pads,
|
||||
GstCollectData * pad, GstEvent * event, gpointer user_data);
|
||||
|
||||
static GstPad *gst_adder_request_new_pad (GstElement * element,
|
||||
GstPadTemplate * temp, const gchar * unused, const GstCaps * caps);
|
||||
|
@ -126,10 +126,10 @@ static void gst_adder_release_pad (GstElement * element, GstPad * pad);
|
|||
static GstStateChangeReturn gst_adder_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
|
||||
static GstFlowReturn gst_adder_do_clip (GstCollectPads2 * pads,
|
||||
GstCollectData2 * data, GstBuffer * buffer, GstBuffer ** out,
|
||||
static GstFlowReturn gst_adder_do_clip (GstCollectPads * pads,
|
||||
GstCollectData * data, GstBuffer * buffer, GstBuffer ** out,
|
||||
gpointer user_data);
|
||||
static GstFlowReturn gst_adder_collected (GstCollectPads2 * pads,
|
||||
static GstFlowReturn gst_adder_collected (GstCollectPads * pads,
|
||||
gpointer user_data);
|
||||
|
||||
/* non-clipping versions (for float) */
|
||||
|
@ -701,7 +701,7 @@ gst_adder_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
* as we need to take the stream lock.
|
||||
*/
|
||||
gst_pad_push_event (adder->srcpad, gst_event_new_flush_start ());
|
||||
gst_collect_pads2_set_flushing (adder->collect, TRUE);
|
||||
gst_collect_pads_set_flushing (adder->collect, TRUE);
|
||||
|
||||
/* We can't send FLUSH_STOP here since upstream could start pushing data
|
||||
* after we unlock adder->collect.
|
||||
|
@ -716,7 +716,7 @@ gst_adder_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
/* now wait for the collected to be finished and mark a new
|
||||
* segment. After we have the lock, no collect function is running and no
|
||||
* new collect function will be called for as long as we're flushing. */
|
||||
GST_COLLECT_PADS2_STREAM_LOCK (adder->collect);
|
||||
GST_COLLECT_PADS_STREAM_LOCK (adder->collect);
|
||||
adder->segment.rate = rate;
|
||||
if (curtype == GST_SEEK_TYPE_SET)
|
||||
adder->segment.start = cur;
|
||||
|
@ -729,9 +729,9 @@ gst_adder_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
if (flush) {
|
||||
/* Yes, we need to call _set_flushing again *WHEN* the streaming threads
|
||||
* have stopped so that the cookie gets properly updated. */
|
||||
gst_collect_pads2_set_flushing (adder->collect, TRUE);
|
||||
gst_collect_pads_set_flushing (adder->collect, TRUE);
|
||||
}
|
||||
GST_COLLECT_PADS2_STREAM_UNLOCK (adder->collect);
|
||||
GST_COLLECT_PADS_STREAM_UNLOCK (adder->collect);
|
||||
GST_DEBUG_OBJECT (adder, "forwarding seek event: %" GST_PTR_FORMAT,
|
||||
event);
|
||||
|
||||
|
@ -774,7 +774,7 @@ done:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_adder_sink_event (GstCollectPads2 * pads, GstCollectData2 * pad,
|
||||
gst_adder_sink_event (GstCollectPads * pads, GstCollectData * pad,
|
||||
GstEvent * event, gpointer user_data)
|
||||
{
|
||||
GstAdder *adder = GST_ADDER (user_data);
|
||||
|
@ -831,7 +831,7 @@ gst_adder_sink_event (GstCollectPads2 * pads, GstCollectData2 * pad,
|
|||
}
|
||||
|
||||
if (G_LIKELY (event))
|
||||
return gst_collect_pads2_event_default (pads, pad, event, discard);
|
||||
return gst_collect_pads_event_default (pads, pad, event, discard);
|
||||
else
|
||||
return res;
|
||||
}
|
||||
|
@ -896,12 +896,12 @@ gst_adder_init (GstAdder * adder)
|
|||
adder->filter_caps = NULL;
|
||||
|
||||
/* keep track of the sinkpads requested */
|
||||
adder->collect = gst_collect_pads2_new ();
|
||||
gst_collect_pads2_set_function (adder->collect,
|
||||
adder->collect = gst_collect_pads_new ();
|
||||
gst_collect_pads_set_function (adder->collect,
|
||||
GST_DEBUG_FUNCPTR (gst_adder_collected), adder);
|
||||
gst_collect_pads2_set_clip_function (adder->collect,
|
||||
gst_collect_pads_set_clip_function (adder->collect,
|
||||
GST_DEBUG_FUNCPTR (gst_adder_do_clip), adder);
|
||||
gst_collect_pads2_set_event_function (adder->collect,
|
||||
gst_collect_pads_set_event_function (adder->collect,
|
||||
GST_DEBUG_FUNCPTR (gst_adder_sink_event), adder);
|
||||
}
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ gst_adder_request_new_pad (GstElement * element, GstPadTemplate * templ,
|
|||
g_free (name);
|
||||
|
||||
gst_pad_set_query_function (newpad, GST_DEBUG_FUNCPTR (gst_adder_sink_query));
|
||||
gst_collect_pads2_add_pad (adder->collect, newpad, sizeof (GstCollectData2));
|
||||
gst_collect_pads_add_pad (adder->collect, newpad, sizeof (GstCollectData));
|
||||
|
||||
/* takes ownership of the pad */
|
||||
if (!gst_element_add_pad (GST_ELEMENT (adder), newpad))
|
||||
|
@ -1017,7 +1017,7 @@ not_sink:
|
|||
could_not_add:
|
||||
{
|
||||
GST_DEBUG_OBJECT (adder, "could not add pad");
|
||||
gst_collect_pads2_remove_pad (adder->collect, newpad);
|
||||
gst_collect_pads_remove_pad (adder->collect, newpad);
|
||||
gst_object_unref (newpad);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1033,12 +1033,12 @@ gst_adder_release_pad (GstElement * element, GstPad * pad)
|
|||
GST_DEBUG_OBJECT (adder, "release pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
||||
|
||||
if (adder->collect)
|
||||
gst_collect_pads2_remove_pad (adder->collect, pad);
|
||||
gst_collect_pads_remove_pad (adder->collect, pad);
|
||||
gst_element_remove_pad (element, pad);
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_adder_do_clip (GstCollectPads2 * pads, GstCollectData2 * data,
|
||||
gst_adder_do_clip (GstCollectPads * pads, GstCollectData * data,
|
||||
GstBuffer * buffer, GstBuffer ** out, gpointer user_data)
|
||||
{
|
||||
GstAdder *adder = GST_ADDER (user_data);
|
||||
|
@ -1054,7 +1054,7 @@ gst_adder_do_clip (GstCollectPads2 * pads, GstCollectData2 * data,
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_adder_collected (GstCollectPads2 * pads, gpointer user_data)
|
||||
gst_adder_collected (GstCollectPads * pads, gpointer user_data)
|
||||
{
|
||||
/*
|
||||
* combine streams by adding data values
|
||||
|
@ -1096,7 +1096,7 @@ gst_adder_collected (GstCollectPads2 * pads, gpointer user_data)
|
|||
|
||||
/* get available bytes for reading, this can be 0 which could mean empty
|
||||
* buffers or EOS, which we will catch when we loop over the pads. */
|
||||
outsize = gst_collect_pads2_available (pads);
|
||||
outsize = gst_collect_pads_available (pads);
|
||||
/* can only happen when no pads to collect or all EOS */
|
||||
if (outsize == 0)
|
||||
goto eos;
|
||||
|
@ -1110,18 +1110,18 @@ gst_adder_collected (GstCollectPads2 * pads, gpointer user_data)
|
|||
outsize, bps, bpf);
|
||||
|
||||
for (collected = pads->data; collected; collected = next) {
|
||||
GstCollectData2 *collect_data;
|
||||
GstCollectData *collect_data;
|
||||
GstBuffer *inbuf;
|
||||
gboolean is_gap;
|
||||
|
||||
/* take next to see if this is the last collectdata */
|
||||
next = g_slist_next (collected);
|
||||
|
||||
collect_data = (GstCollectData2 *) collected->data;
|
||||
collect_data = (GstCollectData *) collected->data;
|
||||
|
||||
/* get a buffer of size bytes, if we get a buffer, it is at least outsize
|
||||
* bytes big. */
|
||||
inbuf = gst_collect_pads2_take_buffer (pads, collect_data, outsize);
|
||||
inbuf = gst_collect_pads_take_buffer (pads, collect_data, outsize);
|
||||
/* NULL means EOS or an empty buffer so we still need to flush in
|
||||
* case of an empty buffer. */
|
||||
if (inbuf == NULL) {
|
||||
|
@ -1314,14 +1314,14 @@ gst_adder_change_state (GstElement * element, GstStateChange transition)
|
|||
adder->new_segment_pending = TRUE;
|
||||
adder->wait_for_new_segment = FALSE;
|
||||
gst_segment_init (&adder->segment, GST_FORMAT_TIME);
|
||||
gst_collect_pads2_start (adder->collect);
|
||||
gst_collect_pads_start (adder->collect);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
/* need to unblock the collectpads2 before calling the
|
||||
/* need to unblock the collectpads before calling the
|
||||
* parent change_state so that streaming can finish */
|
||||
gst_collect_pads2_stop (adder->collect);
|
||||
gst_collect_pads_stop (adder->collect);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#define __GST_ADDER_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstcollectpads2.h>
|
||||
#include <gst/base/gstcollectpads.h>
|
||||
#include <gst/audio/audio.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
@ -51,7 +51,7 @@ struct _GstAdder {
|
|||
GstElement element;
|
||||
|
||||
GstPad *srcpad;
|
||||
GstCollectPads2 *collect;
|
||||
GstCollectPads *collect;
|
||||
/* pad counter, used for creating unique request pads */
|
||||
gint padcount;
|
||||
|
||||
|
|
Loading…
Reference in a new issue